diff options
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/app_list_controller.cc | 4 | ||||
-rw-r--r-- | ash/wm/property_util.cc | 11 | ||||
-rw-r--r-- | ash/wm/property_util.h | 11 | ||||
-rw-r--r-- | ash/wm/screen_dimmer.h | 2 | ||||
-rw-r--r-- | ash/wm/screen_dimmer_unittest.cc | 3 | ||||
-rw-r--r-- | ash/wm/system_gesture_event_filter.cc | 7 | ||||
-rw-r--r-- | ash/wm/window_properties.cc | 4 | ||||
-rw-r--r-- | ash/wm/window_properties.h | 4 | ||||
-rw-r--r-- | ash/wm/window_util.cc | 5 | ||||
-rw-r--r-- | ash/wm/window_util.h | 6 |
10 files changed, 50 insertions, 7 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc index d4c51f1..5ffc075 100644 --- a/ash/wm/app_list_controller.cc +++ b/ash/wm/app_list_controller.cc @@ -5,6 +5,7 @@ #include "ash/wm/app_list_controller.h" #include "ash/ash_switches.h" +#include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" @@ -85,8 +86,7 @@ void AppListController::SetVisible(bool visible) { app_list::AppListView* view = new app_list::AppListView( Shell::GetInstance()->delegate()->CreateAppListViewDelegate()); view->InitAsBubble( - Shell::GetContainer( - Shell::GetPrimaryRootWindow(), + Shell::GetPrimaryRootWindowController()->GetContainer( kShellWindowId_AppListContainer), Shell::GetInstance()->launcher()->GetAppListButtonView(), GetBubbleArrowLocation()); diff --git a/ash/wm/property_util.cc b/ash/wm/property_util.cc index 50a7bed..a51d298 100644 --- a/ash/wm/property_util.cc +++ b/ash/wm/property_util.cc @@ -8,6 +8,7 @@ #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/rect.h" @@ -72,4 +73,14 @@ void SetDefaultPersistsAcrossAllWorkspaces(bool value) { g_default_windows_persist_across_all_workspaces = value; } +internal::RootWindowController* GetRootWindowController( + aura::RootWindow* root_window) { + return root_window->GetProperty(internal::kRootWindowControllerKey); } + +void SetRootWindowController(aura::RootWindow* root_window, + internal::RootWindowController* controller) { + root_window->SetProperty(internal::kRootWindowControllerKey, controller); +} + +} // namespace ash diff --git a/ash/wm/property_util.h b/ash/wm/property_util.h index ce0940b..1850269 100644 --- a/ash/wm/property_util.h +++ b/ash/wm/property_util.h @@ -9,6 +9,7 @@ #include "ash/ash_export.h" namespace aura { +class RootWindow; class Window; } @@ -17,6 +18,9 @@ class Rect; } namespace ash { +namespace internal { +class RootWindowController; +} // Sets the restore bounds property on |window|. Deletes existing bounds value // if exists. @@ -61,6 +65,13 @@ ASH_EXPORT bool GetPersistsAcrossAllWorkspaces(aura::Window* window); // The default is false. ASH_EXPORT void SetDefaultPersistsAcrossAllWorkspaces(bool value); +// Sets/Gets the RootWindowController for |root_window|. +ASH_EXPORT void SetRootWindowController( + aura::RootWindow* root_window, + internal::RootWindowController* controller); +ASH_EXPORT internal::RootWindowController* GetRootWindowController( + aura::RootWindow* root_window); + } #endif // ASH_WM_PROPERTY_UTIL_H_ diff --git a/ash/wm/screen_dimmer.h b/ash/wm/screen_dimmer.h index eeedecc..daa60ea0 100644 --- a/ash/wm/screen_dimmer.h +++ b/ash/wm/screen_dimmer.h @@ -47,7 +47,7 @@ class ASH_EXPORT ScreenDimmer : public aura::RootWindowObserver { explicit ScreenDimmer(aura::RootWindow* root_window); virtual ~ScreenDimmer(); - // Dim or undim the screen. + // Dim or undim the root window. void SetDimming(bool should_dim); // aura::RootWindowObserver overrides: diff --git a/ash/wm/screen_dimmer_unittest.cc b/ash/wm/screen_dimmer_unittest.cc index ecc6cd5..2c40e33 100644 --- a/ash/wm/screen_dimmer_unittest.cc +++ b/ash/wm/screen_dimmer_unittest.cc @@ -4,6 +4,7 @@ #include "ash/wm/screen_dimmer.h" +#include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/basictypes.h" @@ -21,7 +22,7 @@ class ScreenDimmerTest : public AshTestBase { void SetUp() OVERRIDE { AshTestBase::SetUp(); - dimmer_ = Shell::GetInstance()->screen_dimmer(); + dimmer_ = Shell::GetPrimaryRootWindowController()->screen_dimmer(); test_api_.reset(new internal::ScreenDimmer::TestApi(dimmer_)); } diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index 98cbac9..1db677f 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -6,6 +6,7 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/launcher/launcher.h" +#include "ash/root_window_controller.h" #include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" @@ -79,9 +80,9 @@ Widget* CreateAffordanceWidget() { params.transparent = true; widget->Init(params); widget->SetOpacity(0xFF); - widget->GetNativeWindow()->SetParent(ash::Shell::GetContainer( - ash::Shell::GetPrimaryRootWindow(), - ash::internal::kShellWindowId_OverlayContainer)); + widget->GetNativeWindow()->SetParent( + ash::Shell::GetPrimaryRootWindowController()->GetContainer( + ash::internal::kShellWindowId_OverlayContainer)); ash::SetWindowVisibilityAnimationTransition(widget->GetNativeView(), ash::ANIMATE_HIDE); return widget; diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc index 7f15c5b..a312149 100644 --- a/ash/wm/window_properties.cc +++ b/ash/wm/window_properties.cc @@ -4,6 +4,7 @@ #include "ash/wm/window_properties.h" +#include "ash/root_window_controller.h" #include "ash/wm/always_on_top_controller.h" #include "ash/wm/shadow_types.h" #include "ui/aura/window_property.h" @@ -15,6 +16,7 @@ DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::AlwaysOnTopController*); DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::ShadowType); DECLARE_WINDOW_PROPERTY_TYPE(ash::WindowPersistsAcrossAllWorkspacesType) DECLARE_WINDOW_PROPERTY_TYPE(ui_controls::UIControlsAura*) +DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::RootWindowController*); namespace ash { namespace internal { @@ -33,6 +35,8 @@ DEFINE_WINDOW_PROPERTY_KEY(ash::WindowPersistsAcrossAllWorkspacesType, kWindowPersistsAcrossAllWorkspacesKey, WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_DEFAULT); DEFINE_WINDOW_PROPERTY_KEY(bool, kWindowTrackedByWorkspaceKey, true); +DEFINE_WINDOW_PROPERTY_KEY(RootWindowController*, + kRootWindowControllerKey, NULL); } // namespace internal } // namespace ash diff --git a/ash/wm/window_properties.h b/ash/wm/window_properties.h index 88c1b70..ef99942 100644 --- a/ash/wm/window_properties.h +++ b/ash/wm/window_properties.h @@ -18,6 +18,7 @@ class UIControlsAura; namespace ash { namespace internal { class AlwaysOnTopController; +class RootWindowController; // Shell-specific window property keys. @@ -52,6 +53,9 @@ extern const aura::WindowProperty<WindowPersistsAcrossAllWorkspacesType>* const extern const aura::WindowProperty<bool>* const kWindowTrackedByWorkspaceKey; +extern const aura::WindowProperty<RootWindowController*>* const + kRootWindowControllerKey; + // Alphabetical sort. } // namespace internal diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 5ac2f11..833e02c 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc @@ -99,5 +99,10 @@ void CenterWindow(aura::Window* window) { window->SetBounds(center); } +internal::RootWindowController* GetRootWindowController( + aura::RootWindow* root_window) { + return root_window->GetProperty(internal::kRootWindowControllerKey); +} + } // namespace wm } // namespace ash diff --git a/ash/wm/window_util.h b/ash/wm/window_util.h index 6cfc907..e0bd718 100644 --- a/ash/wm/window_util.h +++ b/ash/wm/window_util.h @@ -9,10 +9,14 @@ #include "ash/ash_export.h" namespace aura { +class RootWindow; class Window; } namespace ash { +namespace internal { +class RootWindowController; +} namespace wm { // Convenience setters/getters for |aura::client::kRootWindowActiveWindow|. @@ -21,6 +25,8 @@ ASH_EXPORT void DeactivateWindow(aura::Window* window); ASH_EXPORT bool IsActiveWindow(aura::Window* window); ASH_EXPORT aura::Window* GetActiveWindow(); ASH_EXPORT bool CanActivateWindow(aura::Window* window); +ASH_EXPORT internal::RootWindowController* GetRootWindowController( + aura::RootWindow* root_window); // Retrieves the activatable window for |window|. If |window| is activatable, // this will just return it, otherwise it will climb the parent/transient parent |