Commit 9131a10e authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Declare kWindowManagerManagesOpacityKey in //chromeos/ui/base/

... as well as kFrameRestoreLookKey.

Dependency/include graph:

- frame_util.cc uses kWindowManagerManagesOpacityKey
  and kFrameRestoreLookKey;

- frame_utils.h is included by frame_header.cc;

- frame_header.h is included by default_frame_header.h

- browser_non_client_frame_view_ash.cc includes default_frame_header.h.

So, in order to free browser_non_client_frame_view_ash.cc|h from
including //ash/ headers, the items above will migrate step by step
to //chromeos/ui.

BUG=1113900
R=jamescook@chromium.org, sky@chromium.org

Change-Id: If1ba34dca49f752ec3c9247e366879c10455a5c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521691Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#824848}
parent ed1cf34b
...@@ -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/window_properties.h"
#include "chromeos/ui/base/chromeos_ui_constants.h" #include "chromeos/ui/base/chromeos_ui_constants.h"
#include "chromeos/ui/base/window_properties.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"
...@@ -73,7 +73,7 @@ void ResolveInferredOpacity(views::Widget::InitParams* params) { ...@@ -73,7 +73,7 @@ void ResolveInferredOpacity(views::Widget::InitParams* params) {
// window to be transparent. WindowManager controls the actual // window to be transparent. WindowManager controls the actual
// opaque-ness of the window depending on its window state. // opaque-ness of the window depending on its window state.
params->init_properties_container.SetProperty( params->init_properties_container.SetProperty(
ash::kWindowManagerManagesOpacityKey, true); chromeos::kWindowManagerManagesOpacityKey, true);
params->opacity = WindowOpacity::kTranslucent; params->opacity = WindowOpacity::kTranslucent;
} else { } else {
params->opacity = WindowOpacity::kOpaque; params->opacity = WindowOpacity::kOpaque;
...@@ -84,7 +84,7 @@ bool ShouldUseRestoreFrame(const views::Widget* widget) { ...@@ -84,7 +84,7 @@ bool ShouldUseRestoreFrame(const views::Widget* widget) {
aura::Window* window = widget->GetNativeWindow(); aura::Window* window = widget->GetNativeWindow();
// This is true when dragging a maximized window in ash. During this phase, // This is true when dragging a maximized window in ash. During this phase,
// the window should look as if it was restored, but keep its maximized state. // the window should look as if it was restored, but keep its maximized state.
if (window->GetProperty(kFrameRestoreLookKey)) if (window->GetProperty(chromeos::kFrameRestoreLookKey))
return true; return true;
// Maximized and fullscreen windows should use the maximized frame. // Maximized and fullscreen windows should use the maximized frame.
......
...@@ -38,7 +38,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kForceVisibleInMiniViewKey, false) ...@@ -38,7 +38,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kForceVisibleInMiniViewKey, false)
DEFINE_UI_CLASS_PROPERTY_KEY(chromeos::WindowStateType, DEFINE_UI_CLASS_PROPERTY_KEY(chromeos::WindowStateType,
kPrePipWindowStateTypeKey, kPrePipWindowStateTypeKey,
chromeos::WindowStateType::kDefault) chromeos::WindowStateType::kDefault)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kWindowManagerManagesOpacityKey, false)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(bool, kMinimizeOnBackKey, nullptr) DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(bool, kMinimizeOnBackKey, nullptr)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kPipOriginalWindowKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kPipOriginalWindowKey, false)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(float, kPipSnapFractionKey, nullptr) DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(float, kPipSnapFractionKey, nullptr)
...@@ -64,7 +63,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(SkColor, ...@@ -64,7 +63,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(SkColor,
DEFINE_UI_CLASS_PROPERTY_KEY(SkColor, DEFINE_UI_CLASS_PROPERTY_KEY(SkColor,
kFrameInactiveColorKey, kFrameInactiveColorKey,
chromeos::kDefaultFrameColor) chromeos::kDefaultFrameColor)
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,
nullptr) nullptr)
......
...@@ -100,10 +100,6 @@ ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const ...@@ -100,10 +100,6 @@ ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const
ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const
kForceVisibleInMiniViewKey; kForceVisibleInMiniViewKey;
// A property key to tell if the window's opacity should be managed by WM.
ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const
kWindowManagerManagesOpacityKey;
// A property key to store whether we should minimize a window when a system // A property key to store whether we should minimize a window when a system
// synthesized back event (back gesture, back button) is processed by this // synthesized back event (back gesture, back button) is processed by this
// window and when this window is at the bottom of its navigation stack. // window and when this window is at the bottom of its navigation stack.
...@@ -188,11 +184,6 @@ ASH_PUBLIC_EXPORT extern const aura::WindowProperty<SkColor>* const ...@@ -188,11 +184,6 @@ ASH_PUBLIC_EXPORT extern const aura::WindowProperty<SkColor>* const
// A property key to store the inactive color on the window frame. // A property key to store the inactive color on the window frame.
ASH_PUBLIC_EXPORT extern const aura::WindowProperty<SkColor>* const ASH_PUBLIC_EXPORT extern const aura::WindowProperty<SkColor>* const
kFrameInactiveColorKey; kFrameInactiveColorKey;
// A property key that is set to true when the window frame should look like it
// is in restored state, but actually isn't. Set while dragging a maximized
// window.
ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const
kFrameRestoreLookKey;
// A property key whose value is shown in alt-tab/overview mode. If non-value // A property key whose value is shown in alt-tab/overview mode. If non-value
// is set, the window's title is used. // is set, the window's title is used.
......
...@@ -53,6 +53,7 @@ namespace { ...@@ -53,6 +53,7 @@ namespace {
using ::chromeos::kHideShelfWhenFullscreenKey; using ::chromeos::kHideShelfWhenFullscreenKey;
using ::chromeos::kImmersiveIsActive; using ::chromeos::kImmersiveIsActive;
using ::chromeos::kWindowManagerManagesOpacityKey;
using ::chromeos::kWindowPinTypeKey; using ::chromeos::kWindowPinTypeKey;
using ::chromeos::WindowPinType; using ::chromeos::WindowPinType;
using ::chromeos::WindowStateType; using ::chromeos::WindowStateType;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "ash/wm/wm_event.h" #include "ash/wm/wm_event.h"
#include "ash/wm/workspace/phantom_window_controller.h" #include "ash/wm/workspace/phantom_window_controller.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "chromeos/ui/base/window_properties.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/window_types.h" #include "ui/aura/client/window_types.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
...@@ -48,6 +49,7 @@ namespace ash { ...@@ -48,6 +49,7 @@ namespace ash {
namespace { namespace {
using ::chromeos::kFrameRestoreLookKey;
using ::chromeos::WindowStateType; using ::chromeos::WindowStateType;
constexpr double kMinHorizVelocityForWindowSwipe = 1100; constexpr double kMinHorizVelocityForWindowSwipe = 1100;
......
...@@ -508,7 +508,7 @@ void BrowserNonClientFrameViewAsh::OnWindowPropertyChanged(aura::Window* window, ...@@ -508,7 +508,7 @@ void BrowserNonClientFrameViewAsh::OnWindowPropertyChanged(aura::Window* window,
if (key == aura::client::kShowStateKey) { if (key == aura::client::kShowStateKey) {
frame_header_->OnShowStateChanged( frame_header_->OnShowStateChanged(
window->GetProperty(aura::client::kShowStateKey)); window->GetProperty(aura::client::kShowStateKey));
} else if (key == ash::kFrameRestoreLookKey) { } else if (key == chromeos::kFrameRestoreLookKey) {
frame_header_->view()->InvalidateLayout(); frame_header_->view()->InvalidateLayout();
} }
} }
......
...@@ -14,6 +14,8 @@ DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(COMPONENT_EXPORT(CHROMEOS_UI_BASE), ...@@ -14,6 +14,8 @@ DEFINE_EXPORTED_UI_CLASS_PROPERTY_TYPE(COMPONENT_EXPORT(CHROMEOS_UI_BASE),
namespace chromeos { namespace chromeos {
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kFrameRestoreLookKey, false)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kHideShelfWhenFullscreenKey, true) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kHideShelfWhenFullscreenKey, true)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveImpliedByFullscreen, true) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveImpliedByFullscreen, true)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveIsActive, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveIsActive, false)
...@@ -23,6 +25,7 @@ DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, ...@@ -23,6 +25,7 @@ DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect,
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kIsShowingInOverviewKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kIsShowingInOverviewKey, false)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kWindowManagerManagesOpacityKey, false)
DEFINE_UI_CLASS_PROPERTY_KEY(WindowPinType, DEFINE_UI_CLASS_PROPERTY_KEY(WindowPinType,
kWindowPinTypeKey, kWindowPinTypeKey,
WindowPinType::kNone) WindowPinType::kNone)
......
...@@ -21,6 +21,12 @@ enum class WindowPinType; ...@@ -21,6 +21,12 @@ enum class WindowPinType;
// Alphabetical sort. // Alphabetical sort.
// A property key that is set to true when the window frame should look like it
// is in restored state, but actually isn't. Set while dragging a maximized
// window.
COMPONENT_EXPORT(CHROMEOS_UI_BASE)
extern const ui::ClassProperty<bool>* const kFrameRestoreLookKey;
// Whether the shelf should be hidden when this window is put into fullscreen. // Whether the shelf should be hidden when this window is put into fullscreen.
// Exposed because some windows want to explicitly opt-out of this. // Exposed because some windows want to explicitly opt-out of this.
COMPONENT_EXPORT(CHROMEOS_UI_BASE) COMPONENT_EXPORT(CHROMEOS_UI_BASE)
...@@ -45,6 +51,10 @@ extern const ui::ClassProperty<gfx::Rect*>* const ...@@ -45,6 +51,10 @@ extern const ui::ClassProperty<gfx::Rect*>* const
COMPONENT_EXPORT(CHROMEOS_UI_BASE) COMPONENT_EXPORT(CHROMEOS_UI_BASE)
extern const ui::ClassProperty<bool>* const kIsShowingInOverviewKey; extern const ui::ClassProperty<bool>* const kIsShowingInOverviewKey;
// A property key to tell if the window's opacity should be managed by WM.
COMPONENT_EXPORT(CHROMEOS_UI_BASE)
extern const ui::ClassProperty<bool>* const kWindowManagerManagesOpacityKey;
// A property key to indicate ash's extended window state. // A property key to indicate ash's extended window state.
COMPONENT_EXPORT(CHROMEOS_UI_BASE) COMPONENT_EXPORT(CHROMEOS_UI_BASE)
extern const ui::ClassProperty<WindowStateType>* const kWindowStateTypeKey; extern const ui::ClassProperty<WindowStateType>* const kWindowStateTypeKey;
......
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