Commit 1f43abcd authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Factor some constants out of ash_constants.h

Some constants in ash_constants.h are used in
BrowserNonClientFrameViewAsh. In order to make this
class available to lacros, these constants need to be
factored out, once lacros chrome can not link to ash symbols.

The following constants are moved:

 ash::kDefaultFrameColor
 ash::kResizeAreaCornerSize
 ash::kResizeInsideBoundsSize
 ash::kResizeOutsideBoundsSize
 ash::kResizeOutsideBoundsScaleForTouch

now under the `chromeos` namespace.

Also, CL adds a README.md to chromeos/ui directory.

This is phase 2.2 on the design document [1].

[1] https://docs.google.com/document/d/1xHwcHrAiEaWuA4usGEqKZ9zm1H8SGk3WkS-Jf2Q_los/

BUG=1113900
R=jamescook@chromium.org

Change-Id: I01cf20ed5a77f752fee2c72df0d5cb0cf42125a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429441Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Antonio Gomes (GMT-4) <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#811027}
parent fd31ad10
...@@ -1690,6 +1690,7 @@ component("ash") { ...@@ -1690,6 +1690,7 @@ component("ash") {
"//chromeos/components/phonehub", "//chromeos/components/phonehub",
"//chromeos/components/quick_answers", "//chromeos/components/quick_answers",
"//chromeos/components/quick_answers/public/cpp:prefs", "//chromeos/components/quick_answers/public/cpp:prefs",
"//chromeos/ui",
"//services/viz/public/mojom", "//services/viz/public/mojom",
# TODO(https://crbug.com/644336): Make CrasAudioHandler Chrome or Ash only. # TODO(https://crbug.com/644336): Make CrasAudioHandler Chrome or Ash only.
...@@ -2285,6 +2286,7 @@ test("ash_unittests") { ...@@ -2285,6 +2286,7 @@ test("ash_unittests") {
"//build:branding_buildflags", "//build:branding_buildflags",
"//chromeos:test_support", "//chromeos:test_support",
"//chromeos/strings:strings_grit", "//chromeos/strings:strings_grit",
"//chromeos/ui",
"//chromeos/ui/vector_icons", "//chromeos/ui/vector_icons",
# TODO(https://crbug.com/644336): Make CrasAudioHandler Chrome or Ash only. # TODO(https://crbug.com/644336): Make CrasAudioHandler Chrome or Ash only.
......
...@@ -88,6 +88,7 @@ include_rules = [ ...@@ -88,6 +88,7 @@ include_rules = [
"+chromeos/system", "+chromeos/system",
# Do not eliminate this. # Do not eliminate this.
"+chromeos/ui/vector_icons", "+chromeos/ui/vector_icons",
"+chromeos/ui/chromeos_ui_constants.h",
# ui/base/idle depends on SessionManagerClient so disallow it. # ui/base/idle depends on SessionManagerClient so disallow it.
"-ui/base/idle" "-ui/base/idle"
......
...@@ -330,6 +330,7 @@ component("cpp") { ...@@ -330,6 +330,7 @@ component("cpp") {
"//chromeos/services/assistant/public/cpp", "//chromeos/services/assistant/public/cpp",
"//chromeos/services/cellular_setup:in_process_esim_manager", "//chromeos/services/cellular_setup:in_process_esim_manager",
"//chromeos/services/network_config:in_process_instance", "//chromeos/services/network_config:in_process_instance",
"//chromeos/ui",
"//chromeos/ui/vector_icons", "//chromeos/ui/vector_icons",
"//components/prefs", "//components/prefs",
"//components/sync:rest_of_sync", "//components/sync:rest_of_sync",
......
include_rules = [ include_rules = [
"+chromeos/services", "+chromeos/services",
"+chromeos/ui/chromeos_ui_constants.h",
"+cc/metrics", "+cc/metrics",
"+components/prefs", "+components/prefs",
"+services/data_decoder/public", "+services/data_decoder/public",
......
...@@ -17,18 +17,6 @@ namespace ash { ...@@ -17,18 +17,6 @@ namespace ash {
// Radius of the header's top corners when the window is restored. // Radius of the header's top corners when the window is restored.
constexpr int kTopCornerRadiusWhenRestored = 2; constexpr int kTopCornerRadiusWhenRestored = 2;
// 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.
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.
constexpr int kResizeOutsideBoundsSize = 6;
constexpr int kResizeOutsideBoundsScaleForTouch = 5;
constexpr int kResizeInsideBoundsSize = 1;
// Background color used for the Chrome OS boot splash screen. // Background color used for the Chrome OS boot splash screen.
constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); constexpr SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
...@@ -66,9 +54,6 @@ constexpr FloatingMenuPosition kDefaultAutoclickMenuPosition = ...@@ -66,9 +54,6 @@ constexpr FloatingMenuPosition kDefaultAutoclickMenuPosition =
constexpr FloatingMenuPosition kDefaultFloatingMenuPosition = constexpr FloatingMenuPosition kDefaultFloatingMenuPosition =
FloatingMenuPosition::kSystemDefault; FloatingMenuPosition::kSystemDefault;
// The default frame color.
constexpr SkColor kDefaultFrameColor = SkColorSetRGB(0xFD, 0xFE, 0xFF);
// Whether keyboard auto repeat is enabled by default. // Whether keyboard auto repeat is enabled by default.
constexpr bool kDefaultKeyAutoRepeatEnabled = true; constexpr bool kDefaultKeyAutoRepeatEnabled = true;
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
#include <memory> #include <memory>
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_public_export.h" #include "ash/public/cpp/ash_public_export.h"
#include "ash/public/cpp/frame_header.h" #include "ash/public/cpp/frame_header.h"
#include "base/compiler_specific.h" // override #include "base/compiler_specific.h" // override
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/macros.h" #include "base/macros.h"
#include "chromeos/ui/chromeos_ui_constants.h"
namespace ash { namespace ash {
...@@ -49,8 +49,8 @@ class ASH_PUBLIC_EXPORT DefaultFrameHeader : public FrameHeader { ...@@ -49,8 +49,8 @@ class ASH_PUBLIC_EXPORT DefaultFrameHeader : public FrameHeader {
SkColor GetActiveFrameColorForPaintForTest(); SkColor GetActiveFrameColorForPaintForTest();
SkColor active_frame_color_ = kDefaultFrameColor; SkColor active_frame_color_ = chromeos::kDefaultFrameColor;
SkColor inactive_frame_color_ = kDefaultFrameColor; SkColor inactive_frame_color_ = chromeos::kDefaultFrameColor;
int width_in_pixels_ = -1; int width_in_pixels_ = -1;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include "ash/public/cpp/frame_utils.h" #include "ash/public/cpp/frame_utils.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/base/hit_test.h" #include "ui/base/hit_test.h"
...@@ -22,10 +22,10 @@ using WindowOpacity = views::Widget::InitParams::WindowOpacity; ...@@ -22,10 +22,10 @@ using WindowOpacity = views::Widget::InitParams::WindowOpacity;
int FrameBorderNonClientHitTest(views::NonClientFrameView* view, int FrameBorderNonClientHitTest(views::NonClientFrameView* view,
const gfx::Point& point_in_widget) { const gfx::Point& point_in_widget) {
gfx::Rect expanded_bounds = view->bounds(); gfx::Rect expanded_bounds = view->bounds();
int outside_bounds = kResizeOutsideBoundsSize; int outside_bounds = chromeos::kResizeOutsideBoundsSize;
if (aura::Env::GetInstance()->is_touch_down()) if (aura::Env::GetInstance()->is_touch_down())
outside_bounds *= kResizeOutsideBoundsScaleForTouch; outside_bounds *= chromeos::kResizeOutsideBoundsScaleForTouch;
expanded_bounds.Inset(-outside_bounds, -outside_bounds); expanded_bounds.Inset(-outside_bounds, -outside_bounds);
if (!expanded_bounds.Contains(point_in_widget)) if (!expanded_bounds.Contains(point_in_widget))
...@@ -37,14 +37,15 @@ int FrameBorderNonClientHitTest(views::NonClientFrameView* view, ...@@ -37,14 +37,15 @@ int FrameBorderNonClientHitTest(views::NonClientFrameView* view,
bool can_ever_resize = widget->widget_delegate()->CanResize(); bool can_ever_resize = widget->widget_delegate()->CanResize();
// Don't allow overlapping resize handles when the window is maximized or // Don't allow overlapping resize handles when the window is maximized or
// fullscreen, as it can't be resized in those states. // fullscreen, as it can't be resized in those states.
int resize_border = kResizeInsideBoundsSize; int resize_border = chromeos::kResizeInsideBoundsSize;
if (widget->IsMaximized() || widget->IsFullscreen()) { if (widget->IsMaximized() || widget->IsFullscreen()) {
resize_border = 0; resize_border = 0;
can_ever_resize = false; can_ever_resize = false;
} }
int frame_component = view->GetHTComponentForFrame( int frame_component = view->GetHTComponentForFrame(
point_in_widget, resize_border, resize_border, kResizeAreaCornerSize, point_in_widget, resize_border, resize_border,
kResizeAreaCornerSize, can_ever_resize); chromeos::kResizeAreaCornerSize, chromeos::kResizeAreaCornerSize,
can_ever_resize);
if (frame_component != HTNOWHERE) if (frame_component != HTNOWHERE)
return frame_component; return frame_component;
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/immersive/immersive_fullscreen_controller.h" #include "ash/public/cpp/immersive/immersive_fullscreen_controller.h"
#include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/window_backdrop.h" #include "ash/public/cpp/window_backdrop.h"
#include "ash/public/cpp/window_pin_type.h" #include "ash/public/cpp/window_pin_type.h"
#include "ash/public/cpp/window_state_type.h" #include "ash/public/cpp/window_state_type.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "third_party/skia/include/core/SkRegion.h" #include "third_party/skia/include/core/SkRegion.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/wm/core/window_properties.h" #include "ui/wm/core/window_properties.h"
...@@ -70,10 +70,12 @@ DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(SkRegion, ...@@ -70,10 +70,12 @@ DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(SkRegion,
DEFINE_UI_CLASS_PROPERTY_KEY(aura::Window*, DEFINE_UI_CLASS_PROPERTY_KEY(aura::Window*,
kTabDraggingSourceWindowKey, kTabDraggingSourceWindowKey,
nullptr) nullptr)
DEFINE_UI_CLASS_PROPERTY_KEY(SkColor, kFrameActiveColorKey, kDefaultFrameColor) DEFINE_UI_CLASS_PROPERTY_KEY(SkColor,
kFrameActiveColorKey,
chromeos::kDefaultFrameColor)
DEFINE_UI_CLASS_PROPERTY_KEY(SkColor, DEFINE_UI_CLASS_PROPERTY_KEY(SkColor,
kFrameInactiveColorKey, kFrameInactiveColorKey,
kDefaultFrameColor) chromeos::kDefaultFrameColor)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kFrameRestoreLookKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kFrameRestoreLookKey, false)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(base::string16, DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(base::string16,
kWindowOverviewTitleKey, kWindowOverviewTitleKey,
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/frame/non_client_frame_view_ash.h" #include "ash/frame/non_client_frame_view_ash.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "ash/wm/cursor_manager_test_api.h" #include "ash/wm/cursor_manager_test_api.h"
...@@ -11,6 +10,7 @@ ...@@ -11,6 +10,7 @@
#include "ash/wm/resize_shadow_controller.h" #include "ash/wm/resize_shadow_controller.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "base/bind.h" #include "base/bind.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_event_dispatcher.h"
#include "ui/base/cursor/cursor.h" #include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_delegate.h"
using chromeos::kResizeInsideBoundsSize;
using chromeos::kResizeOutsideBoundsSize;
namespace ash { namespace ash {
namespace { namespace {
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/public/cpp/tablet_mode_observer.h"
...@@ -27,6 +26,7 @@ ...@@ -27,6 +26,7 @@
#include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_positioning_utils.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/wm_event.h" #include "ash/wm/wm_event.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/capture_client.h" #include "ui/aura/client/capture_client.h"
#include "ui/aura/client/focus_client.h" #include "ui/aura/client/focus_client.h"
...@@ -58,7 +58,7 @@ namespace { ...@@ -58,7 +58,7 @@ namespace {
class InteriorResizeHandleTargeter : public aura::WindowTargeter { class InteriorResizeHandleTargeter : public aura::WindowTargeter {
public: public:
InteriorResizeHandleTargeter() { InteriorResizeHandleTargeter() {
SetInsets(gfx::Insets(kResizeInsideBoundsSize)); SetInsets(gfx::Insets(chromeos::kResizeInsideBoundsSize));
} }
~InteriorResizeHandleTargeter() override = default; ~InteriorResizeHandleTargeter() override = default;
...@@ -188,11 +188,11 @@ int GetNonClientComponent(aura::Window* window, const gfx::Point& location) { ...@@ -188,11 +188,11 @@ int GetNonClientComponent(aura::Window* window, const gfx::Point& location) {
} }
void SetChildrenUseExtendedHitRegionForWindow(aura::Window* window) { void SetChildrenUseExtendedHitRegionForWindow(aura::Window* window) {
gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, gfx::Insets mouse_extend(
-kResizeOutsideBoundsSize, -chromeos::kResizeOutsideBoundsSize, -chromeos::kResizeOutsideBoundsSize,
-kResizeOutsideBoundsSize); -chromeos::kResizeOutsideBoundsSize, -chromeos::kResizeOutsideBoundsSize);
gfx::Insets touch_extend = gfx::Insets touch_extend =
mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); mouse_extend.Scale(chromeos::kResizeOutsideBoundsScaleForTouch);
window->SetEventTargeter(std::make_unique<::wm::EasyResizeWindowTargeter>( window->SetEventTargeter(std::make_unique<::wm::EasyResizeWindowTargeter>(
mouse_extend, touch_extend)); mouse_extend, touch_extend));
} }
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "ash/wm/workspace/multi_window_resize_controller.h" #include "ash/wm/workspace/multi_window_resize_controller.h"
#include "ash/frame/non_client_frame_view_ash.h" #include "ash/frame/non_client_frame_view_ash.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/shelf_config.h" #include "ash/public/cpp/shelf_config.h"
#include "ash/public/cpp/test/shell_test_api.h" #include "ash/public/cpp/test/shell_test_api.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include "ash/wm/workspace_controller_test_api.h" #include "ash/wm/workspace_controller_test_api.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_delegate.h"
using chromeos::kResizeInsideBoundsSize;
using chromeos::kResizeOutsideBoundsSize;
namespace ash { namespace ash {
namespace { namespace {
......
...@@ -2622,6 +2622,7 @@ static_library("ui") { ...@@ -2622,6 +2622,7 @@ static_library("ui") {
"//chromeos/settings", "//chromeos/settings",
"//chromeos/strings", "//chromeos/strings",
"//chromeos/system", "//chromeos/system",
"//chromeos/ui",
"//chromeos/ui/vector_icons", "//chromeos/ui/vector_icons",
"//components/arc", "//components/arc",
"//components/assist_ranker", "//components/assist_ranker",
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "apps/ui/views/app_window_frame_view.h" #include "apps/ui/views/app_window_frame_view.h"
#include "ash/frame/non_client_frame_view_ash.h" #include "ash/frame/non_client_frame_view_ash.h"
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/immersive/immersive_fullscreen_controller.h" #include "ash/public/cpp/immersive/immersive_fullscreen_controller.h"
#include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shelf_types.h"
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
#include "chrome/browser/ui/views/exclusive_access_bubble_views.h" #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_constants.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager.h"
#include "extensions/browser/app_window/app_delegate.h" #include "extensions/browser/app_window/app_delegate.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
...@@ -151,9 +151,9 @@ ChromeNativeAppWindowViewsAuraAsh::CreateNonStandardAppFrame() { ...@@ -151,9 +151,9 @@ ChromeNativeAppWindowViewsAuraAsh::CreateNonStandardAppFrame() {
// For Aura windows on the Ash desktop the sizes are different and the user // For Aura windows on the Ash desktop the sizes are different and the user
// can resize the window from slightly outside the bounds as well. // can resize the window from slightly outside the bounds as well.
frame->SetResizeSizes(ash::kResizeInsideBoundsSize, frame->SetResizeSizes(chromeos::kResizeInsideBoundsSize,
ash::kResizeOutsideBoundsSize, chromeos::kResizeOutsideBoundsSize,
ash::kResizeAreaCornerSize); chromeos::kResizeAreaCornerSize);
return frame; return frame;
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <algorithm> #include <algorithm>
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/caption_buttons/frame_caption_button_container_view.h" #include "ash/public/cpp/caption_buttons/frame_caption_button_container_view.h"
#include "ash/public/cpp/default_frame_header.h" #include "ash/public/cpp/default_frame_header.h"
#include "ash/public/cpp/frame_utils.h" #include "ash/public/cpp/frame_utils.h"
...@@ -39,6 +38,7 @@ ...@@ -39,6 +38,7 @@
#include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h" #include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_enums.mojom.h"
...@@ -216,7 +216,7 @@ SkColor BrowserNonClientFrameViewAsh::GetCaptionColor( ...@@ -216,7 +216,7 @@ SkColor BrowserNonClientFrameViewAsh::GetCaptionColor(
bool active = ShouldPaintAsActive(active_state); bool active = ShouldPaintAsActive(active_state);
SkColor active_color = SkColor active_color =
views::FrameCaptionButton::GetButtonColor(ash::kDefaultFrameColor); views::FrameCaptionButton::GetButtonColor(chromeos::kDefaultFrameColor);
// Web apps apply a theme color if specified by the extension. // Web apps apply a theme color if specified by the extension.
Browser* browser = browser_view()->browser(); Browser* browser = browser_view()->browser();
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <string> #include <string>
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/caption_buttons/frame_caption_button_container_view.h" #include "ash/public/cpp/caption_buttons/frame_caption_button_container_view.h"
#include "ash/public/cpp/default_frame_header.h" #include "ash/public/cpp/default_frame_header.h"
...@@ -74,6 +73,7 @@ ...@@ -74,6 +73,7 @@
#include "chrome/common/web_application_info.h" #include "chrome/common/web_application_info.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "chromeos/ui/chromeos_ui_constants.h"
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "components/autofill/core/common/password_form.h" #include "components/autofill/core/common/password_form.h"
#include "components/keep_alive_registry/keep_alive_types.h" #include "components/keep_alive_registry/keep_alive_types.h"
...@@ -287,7 +287,7 @@ IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTestNoWebUiTabStrip, ...@@ -287,7 +287,7 @@ IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTestNoWebUiTabStrip,
EXPECT_EQ(HTTOP, frame_view->NonClientHitTest(top_edge)); EXPECT_EQ(HTTOP, frame_view->NonClientHitTest(top_edge));
// Click just below the resize handle hits the caption. // Click just below the resize handle hits the caption.
gfx::Point below_resize(kWindowWidth / 2, ash::kResizeInsideBoundsSize); gfx::Point below_resize(kWindowWidth / 2, chromeos::kResizeInsideBoundsSize);
EXPECT_EQ(HTCAPTION, frame_view->NonClientHitTest(below_resize)); EXPECT_EQ(HTCAPTION, frame_view->NonClientHitTest(below_resize));
// Click in the top edge of a maximized window now hits the client area, // Click in the top edge of a maximized window now hits the client area,
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include "url/gurl.h" #include "url/gurl.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "ash/public/cpp/ash_constants.h" #include "chromeos/ui/chromeos_ui_constants.h"
#else #else
#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_properties.h"
#endif #endif
...@@ -460,7 +460,7 @@ bool CustomTabBarView::IsShowingOriginForTesting() const { ...@@ -460,7 +460,7 @@ bool CustomTabBarView::IsShowingOriginForTesting() const {
SkColor CustomTabBarView::GetDefaultFrameColor() const { SkColor CustomTabBarView::GetDefaultFrameColor() const {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// Ash system frames differ from ChromeOS browser frames. // Ash system frames differ from ChromeOS browser frames.
return ash::kDefaultFrameColor; return chromeos::kDefaultFrameColor;
#else #else
return ThemeProperties::GetDefaultColor( return ThemeProperties::GetDefaultColor(
ThemeProperties::COLOR_FRAME_ACTIVE, false, ThemeProperties::COLOR_FRAME_ACTIVE, false,
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_chromeos || chromeos_is_browser_only,
"Non-Chrome-OS or Lacros builds must not depend on //chromeos")
# C++ headers and sources that can be used by both ash and lacros builds.
component("ui") {
sources = [ "chromeos_ui_constants.h" ]
output_name = "chromeos_ui"
deps = [ "//skia" ]
}
include_rules = [
"+third_party/skia",
]
This directory accommodates ChromeOS code that can be linked against both by
Ash and Lacros Chrome binaries. Some of the code residing here come originally,
but not exclusively, from //ash/public/cpp/. It includes classes, constants,
runtime switches, etc.
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_UI_CHROMEOS_UI_CONSTANTS_H_
#define CHROMEOS_UI_CHROMEOS_UI_CONSTANTS_H_
#include "third_party/skia/include/core/SkColor.h"
namespace chromeos {
// 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.
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.
constexpr int kResizeOutsideBoundsSize = 6;
constexpr int kResizeOutsideBoundsScaleForTouch = 5;
constexpr int kResizeInsideBoundsSize = 1;
// The default frame color.
constexpr SkColor kDefaultFrameColor = SkColorSetRGB(0xFD, 0xFE, 0xFF);
} // namespace chromeos
#endif // CHROMEOS_UI_CHROMEOS_UI_CONSTANTS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment