Skip to content

Commit

Permalink
Move ash_constants.h to ash/public
Browse files Browse the repository at this point in the history
This also converts everything to inlined constexpr.

Bug: 798569
Change-Id: Ia5f026a2e30b8a590e761860d063d42cfdf54bbc
Reviewed-on: https://chromium-review.googlesource.com/1043647
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556284}
  • Loading branch information
stevenjb authored and Commit Bot committed May 5, 2018
1 parent 03bb7d1 commit 93d3e5b
Show file tree
Hide file tree
Showing 38 changed files with 49 additions and 83 deletions.
2 changes: 0 additions & 2 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ component("ash") {
"app_list/app_list_presenter_impl.h",
"app_list/app_list_view_delegate_mash.cc",
"app_list/app_list_view_delegate_mash.h",
"ash_constants.cc",
"ash_constants.h",
"ash_export.h",
"ash_layout_constants.cc",
"ash_layout_constants.h",
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/accessibility_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <memory>

#include "ash/ash_constants.h"
#include "ash/ash_export.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/interfaces/accessibility_controller.mojom.h"
#include "ash/session/session_observer.h"
#include "base/macros.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/accessibility_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "ash/accessibility/accessibility_observer.h"
#include "ash/accessibility/test_accessibility_controller_client.h"
#include "ash/ash_constants.h"
#include "ash/magnifier/docked_magnifier_controller.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/config.h"
Expand Down
21 changes: 0 additions & 21 deletions ash/ash_constants.cc

This file was deleted.

3 changes: 1 addition & 2 deletions ash/autoclick/autoclick_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "ash/autoclick/common/autoclick_controller_common.h"
#include "ash/autoclick/common/autoclick_controller_common_delegate.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shell.h"
#include "ash/wm/root_window_finder.h"
Expand All @@ -26,8 +27,6 @@ base::TimeDelta AutoclickController::GetDefaultAutoclickDelay() {
return base::TimeDelta::FromMilliseconds(int64_t{kDefaultAutoclickDelayMs});
}

const int AutoclickController::kDefaultAutoclickDelayMs = 1000;

class AutoclickControllerImpl : public AutoclickController,
public ui::EventHandler,
public AutoclickControllerCommonDelegate,
Expand Down
4 changes: 0 additions & 4 deletions ash/autoclick/autoclick_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ class ASH_EXPORT AutoclickController {

static AutoclickController* CreateInstance();

// The default wait time between last mouse movement and sending
// the autoclick.
static const int kDefaultAutoclickDelayMs;

// Gets the default wait time as a base::TimeDelta object.
static base::TimeDelta GetDefaultAutoclickDelay();

Expand Down
11 changes: 3 additions & 8 deletions ash/components/autoclick/autoclick_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <utility>

#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "base/bind_helpers.h"
#include "base/macros.h"
Expand All @@ -29,13 +30,6 @@
#include "ui/views/widget/widget_delegate.h"

namespace autoclick {
namespace {

// The default wait time between last mouse movement and sending
// the autoclick.
const int kDefaultAutoclickDelayMs = 1000;

} // namespace

// AutoclickUI handles events to the autoclick app.
class AutoclickUI : public views::WidgetDelegateView,
Expand Down Expand Up @@ -110,7 +104,8 @@ void AutoclickApplication::OnStart() {
}
autoclick_controller_common_ =
std::make_unique<ash::AutoclickControllerCommon>(
base::TimeDelta::FromMilliseconds(kDefaultAutoclickDelayMs), this);
base::TimeDelta::FromMilliseconds(ash::kDefaultAutoclickDelayMs),
this);
}

void AutoclickApplication::OnBindInterface(
Expand Down
2 changes: 1 addition & 1 deletion ash/display/cursor_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

#include "ash/display/cursor_window_controller.h"

#include "ash/ash_constants.h"
#include "ash/components/cursor/cursor_view.h"
#include "ash/display/display_color_manager.h"
#include "ash/display/mirror_window_controller.h"
#include "ash/display/window_tree_host_manager.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/shell_window_ids.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/display/cursor_window_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <memory>

#include "ash/ash_constants.h"
#include "ash/ash_export.h"
#include "ash/public/cpp/ash_constants.h"
#include "base/macros.h"
#include "ui/aura/window.h"
#include "ui/base/cursor/cursor.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/frame/caption_buttons/frame_caption_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ash/frame/caption_buttons/frame_caption_button.h"

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/frame/frame_border_hit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "ash/frame/frame_border_hit_test.h"

#include "ash/ash_constants.h"
#include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/shell_port.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/login/ui/login_bubble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#include <memory>
#include <utility>

#include "ash/ash_constants.h"
#include "ash/focus_cycler.h"
#include "ash/login/ui/layout_util.h"
#include "ash/login/ui/lock_screen.h"
#include "ash/login/ui/lock_window.h"
#include "ash/login/ui/login_button.h"
#include "ash/login/ui/login_menu_view.h"
#include "ash/login/ui/non_accessible_view.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/login/ui/login_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ash/login/ui/login_button.h"

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/login/ui/login_pin_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <memory>

#include "ash/ash_constants.h"
#include "ash/login/ui/login_button.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/login_constants.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/login/ui/login_user_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <memory>

#include "ash/ash_constants.h"
#include "ash/login/ui/animated_rounded_image_view.h"
#include "ash/login/ui/hover_notifier.h"
#include "ash/login/ui/image_parser.h"
Expand All @@ -15,6 +14,7 @@
#include "ash/login/ui/login_button.h"
#include "ash/login/ui/non_accessible_view.h"
#include "ash/login/ui/user_switch_flip_animation.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/login_constants.h"
#include "ash/public/interfaces/user_info.mojom.h"
#include "ash/resources/vector_icons/vector_icons.h"
Expand Down
1 change: 1 addition & 0 deletions ash/public/cpp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ component("cpp") {
"app_list/tokenized_string_match.cc",
"app_list/tokenized_string_match.h",
"app_types.h",
"ash_constants.h",
"ash_features.cc",
"ash_features.h",
"ash_pref_names.cc",
Expand Down
23 changes: 12 additions & 11 deletions ash/ash_constants.h → ash/public/cpp/ash_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_ASH_CONSTANTS_H_
#define ASH_ASH_CONSTANTS_H_

#include "ash/ash_export.h"
#ifndef ASH_PUBLIC_CPP_ASH_CONSTANTS_H_
#define ASH_PUBLIC_CPP_ASH_CONSTANTS_H_

#include "third_party/skia/include/core/SkColor.h"

Expand All @@ -15,25 +13,28 @@ namespace ash {

// In the window corners, the resize areas don't actually expand bigger, but the
// 16 px at the end of each edge triggers diagonal resizing.
ASH_EXPORT extern const int kResizeAreaCornerSize;
constexpr int kResizeAreaCornerSize = 16;

// Ash windows do not have a traditional visible window frame. Window content
// extends to the edge of the window. We consider a small region outside the
// window bounds and an even smaller region overlapping the window to be the
// "non-client" area and use it for resizing.
ASH_EXPORT extern const int kResizeOutsideBoundsSize;
ASH_EXPORT extern const int kResizeOutsideBoundsScaleForTouch;
ASH_EXPORT extern const int kResizeInsideBoundsSize;
constexpr int kResizeOutsideBoundsSize = 6;
constexpr int kResizeOutsideBoundsScaleForTouch = 5;
constexpr int kResizeInsideBoundsSize = 1;

// Background color used for the Chrome OS boot splash screen.
extern const SkColor kChromeOsBootColor;
constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);

// The border color of keyboard focus for launcher items and system tray.
constexpr SkColor kFocusBorderColor = SK_ColorTRANSPARENT;
constexpr int kFocusBorderThickness = 0;

ASH_EXPORT extern const int kDefaultLargeCursorSize;
constexpr int kDefaultLargeCursorSize = 64;

// The default wait time between last mouse movement and sending autoclick.
constexpr int kDefaultAutoclickDelayMs = 1000;

} // namespace ash

#endif // ASH_ASH_CONSTANTS_H_
#endif // ASH_PUBLIC_CPP_ASH_CONSTANTS_H_
2 changes: 1 addition & 1 deletion ash/root_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include "ash/accessibility/accessibility_panel_layout_manager.h"
#include "ash/accessibility/touch_exploration_controller.h"
#include "ash/accessibility/touch_exploration_manager.h"
#include "ash/ash_constants.h"
#include "ash/focus_cycler.h"
#include "ash/high_contrast/high_contrast_controller.h"
#include "ash/host/ash_window_tree_host.h"
#include "ash/lock_screen_action/lock_screen_action_background_controller.h"
#include "ash/login_status.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/config.h"
#include "ash/public/cpp/shelf_types.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/login_shelf_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#include <memory>
#include <utility>

#include "ash/ash_constants.h"
#include "ash/focus_cycler.h"
#include "ash/lock_screen_action/lock_screen_action_background_controller.h"
#include "ash/lock_screen_action/lock_screen_action_background_state.h"
#include "ash/login/login_screen_controller.h"
#include "ash/login/ui/lock_screen.h"
#include "ash/login/ui/lock_window.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/shelf_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <algorithm>
#include <memory>

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/shelf/ink_drop_button_listener.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/shelf_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <algorithm>
#include <memory>

#include "ash/ash_constants.h"
#include "ash/drag_drop/drag_image_view.h"
#include "ash/metrics/user_metrics_recorder.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shelf_item_delegate.h"
#include "ash/public/cpp/shelf_model.h"
#include "ash/scoped_root_window_for_new_windows.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "ash/accessibility/accessibility_focus_ring_controller.h"
#include "ash/accessibility/key_accessibility_enabler.h"
#include "ash/app_list/app_list_controller_impl.h"
#include "ash/ash_constants.h"
#include "ash/assistant/ash_assistant_controller.h"
#include "ash/autoclick/autoclick_controller.h"
#include "ash/cast_config_controller.h"
Expand Down Expand Up @@ -66,6 +65,7 @@
#include "ash/multi_device_setup/multi_device_notification_presenter.h"
#include "ash/new_window_controller.h"
#include "ash/note_taking_controller.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/config.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/ime_menu/ime_menu_tray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "ash/system/ime_menu/ime_menu_tray.h"

#include "ash/accessibility/accessibility_controller.h"
#include "ash/ash_constants.h"
#include "ash/ime/ime_controller.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller.h"
#include "ash/shelf/shelf.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/tray/actionable_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ash/system/tray/actionable_view.h"

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_item.h"
#include "ash/system/tray/tray_constants.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/tray/system_menu_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ash/system/tray/system_menu_button.h"

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/tray_constants.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/tray/tray_background_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <algorithm>
#include <memory>

#include "ash/ash_constants.h"
#include "ash/focus_cycler.h"
#include "ash/login/ui/lock_screen.h"
#include "ash/login/ui/lock_window.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/tray/tray_popup_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <memory>
#include <utility>

#include "ash/ash_constants.h"
#include "ash/ash_view_ids.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/session/session_controller.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/user/button_from_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "ash/system/user/button_from_view.h"

#include "ash/ash_constants.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/non_client_frame_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include <string>
#include <vector>

#include "ash/ash_constants.h"
#include "ash/ash_layout_constants.h"
#include "ash/frame/custom_frame_view_ash.h"
#include "ash/frame/detached_title_area_renderer.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/immersive/immersive_fullscreen_controller_delegate.h"
#include "ash/window_manager.h"
#include "ash/wm/move_event_handler.h"
Expand Down
Loading

0 comments on commit 93d3e5b

Please sign in to comment.