diff options
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/base_layout_manager.cc | 5 | ||||
-rw-r--r-- | ash/wm/base_layout_manager.h | 4 | ||||
-rw-r--r-- | ash/wm/base_layout_manager_unittest.cc | 4 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager.cc | 8 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager_unittest.cc | 6 | ||||
-rw-r--r-- | ash/wm/toplevel_layout_manager_unittest.cc | 10 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_filter.cc | 2 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_layout_manager.cc | 2 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager.cc | 4 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager_unittest.cc | 6 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer_unittest.cc | 8 |
11 files changed, 26 insertions, 33 deletions
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc index 6a5e5e4..7fc116d 100644 --- a/ash/wm/base_layout_manager.cc +++ b/ash/wm/base_layout_manager.cc @@ -20,7 +20,6 @@ namespace internal { // BaseLayoutManager, public: BaseLayoutManager::BaseLayoutManager() { - Shell::GetInstance()->AddShellObserver(this); Shell::GetRootWindow()->AddRootWindowObserver(this); } @@ -28,7 +27,6 @@ BaseLayoutManager::~BaseLayoutManager() { for (WindowSet::const_iterator i = windows_.begin(); i != windows_.end(); ++i) (*i)->RemoveObserver(this); Shell::GetRootWindow()->RemoveRootWindowObserver(this); - Shell::GetInstance()->RemoveShellObserver(this); } ///////////////////////////////////////////////////////////////////////////// @@ -72,9 +70,6 @@ void BaseLayoutManager::OnRootWindowResized(const gfx::Size& new_size) { AdjustWindowSizesForScreenChange(); } -///////////////////////////////////////////////////////////////////////////// -// BaseLayoutManager, ash::ShellObserver overrides: - void BaseLayoutManager::OnScreenWorkAreaInsetsChanged() { AdjustWindowSizesForScreenChange(); } diff --git a/ash/wm/base_layout_manager.h b/ash/wm/base_layout_manager.h index df858c8..79fd1fe 100644 --- a/ash/wm/base_layout_manager.h +++ b/ash/wm/base_layout_manager.h @@ -9,7 +9,6 @@ #include <set> #include "ash/ash_export.h" -#include "ash/shell_observer.h" #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/aura/layout_manager.h" @@ -30,7 +29,6 @@ namespace internal { // properly. class ASH_EXPORT BaseLayoutManager : public aura::LayoutManager, public aura::RootWindowObserver, - public ash::ShellObserver, public aura::WindowObserver { public: typedef std::set<aura::Window*> WindowSet; @@ -51,8 +49,6 @@ class ASH_EXPORT BaseLayoutManager : public aura::LayoutManager, // RootWindowObserver overrides: virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE; - - // ash::ShellObserver overrides: virtual void OnScreenWorkAreaInsetsChanged() OVERRIDE; // WindowObserver overrides: diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc index f8045a4..b6e4901 100644 --- a/ash/wm/base_layout_manager_unittest.cc +++ b/ash/wm/base_layout_manager_unittest.cc @@ -4,7 +4,6 @@ #include "ash/wm/base_layout_manager.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" @@ -12,6 +11,7 @@ #include "base/compiler_specific.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/test/test_windows.h" #include "ui/base/ui_base_types.h" #include "ui/aura/window.h" @@ -27,7 +27,7 @@ class BaseLayoutManagerTest : public test::AshTestBase { virtual void SetUp() OVERRIDE { test::AshTestBase::SetUp(); - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( gfx::Insets(1, 2, 3, 4)); Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); aura::Window* default_container = Shell::GetInstance()->GetContainer( diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index eca4c40c..6b37e3f 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -5,10 +5,10 @@ #include "ash/wm/shelf_layout_manager.h" #include "ash/launcher/launcher.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "base/auto_reset.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/gfx/compositor/layer.h" #include "ui/gfx/compositor/layer_animation_observer.h" #include "ui/gfx/compositor/layer_animator.h" @@ -43,7 +43,7 @@ ShelfLayoutManager::ShelfLayoutManager(views::Widget* launcher, ShelfLayoutManager::~ShelfLayoutManager() { // Without a shelf we don't need special insets anymore. - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets()); + Shell::GetRootWindow()->SetScreenWorkAreaInsets(gfx::Insets()); } void ShelfLayoutManager::LayoutShelf() { @@ -58,7 +58,7 @@ void ShelfLayoutManager::LayoutShelf() { status_->SetBounds(target_bounds.status_bounds); Shell::GetInstance()->launcher()->SetStatusWidth( target_bounds.status_bounds.width()); - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( target_bounds.work_area_insets); } @@ -150,7 +150,7 @@ void ShelfLayoutManager::CalculateTargetBounds(bool visible, void ShelfLayoutManager::OnImplicitAnimationsCompleted() { TargetBounds target_bounds; CalculateTargetBounds(visible_, &target_bounds); - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( target_bounds.work_area_insets); } diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc index fbf924d..8a83cb0 100644 --- a/ash/wm/shelf_layout_manager_unittest.cc +++ b/ash/wm/shelf_layout_manager_unittest.cc @@ -5,11 +5,11 @@ #include "ash/wm/shelf_layout_manager.h" #include "ash/launcher/launcher.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/window.h" #include "ui/base/animation/animation_container_element.h" #include "ui/gfx/compositor/layer_animator.h" @@ -51,7 +51,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { shelf->LayoutShelf(); ASSERT_TRUE(shelf->visible()); - const ash::ScreenAsh* screen = Shell::GetInstance()->screen(); + const aura::ScreenAura* screen = Shell::GetRootWindow()->screen(); ASSERT_TRUE(screen); // Bottom inset should be the max of widget heights. EXPECT_EQ(shelf->max_height(), screen->work_area_insets().bottom()); @@ -96,7 +96,7 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { shelf->LayoutShelf(); ASSERT_TRUE(shelf->visible()); - const ash::ScreenAsh* screen = Shell::GetInstance()->screen(); + const aura::ScreenAura* screen = Shell::GetRootWindow()->screen(); // Hide the shelf. shelf->SetVisible(false); diff --git a/ash/wm/toplevel_layout_manager_unittest.cc b/ash/wm/toplevel_layout_manager_unittest.cc index dff916a..246c835 100644 --- a/ash/wm/toplevel_layout_manager_unittest.cc +++ b/ash/wm/toplevel_layout_manager_unittest.cc @@ -4,7 +4,6 @@ #include "ash/wm/toplevel_layout_manager.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" @@ -13,6 +12,7 @@ #include "base/compiler_specific.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/test/test_windows.h" #include "ui/base/ui_base_types.h" #include "ui/aura/window.h" @@ -33,7 +33,7 @@ class ToplevelLayoutManagerTest : public test::AshTestBase { virtual void SetUp() OVERRIDE { test::AshTestBase::SetUp(); - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( gfx::Insets(1, 2, 3, 4)); Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); aura::Window* default_container = Shell::GetInstance()->GetContainer( @@ -105,14 +105,16 @@ TEST_F(ToplevelLayoutManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) { gfx::Rect bounds(100, 100, 200, 200); scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets(0, 0, 30, 0)); + Shell::GetRootWindow()->SetScreenWorkAreaInsets( + gfx::Insets(0, 0, 30, 0)); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); // Maximized window fills the work area. EXPECT_EQ(gfx::Screen::GetMonitorWorkAreaNearestWindow(window.get()), window->bounds()); // Change work area insets. - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets(0, 0, 60, 0)); + Shell::GetRootWindow()->SetScreenWorkAreaInsets( + gfx::Insets(0, 0, 60, 0)); // Maximized window fills the changed work area. EXPECT_EQ(gfx::Screen::GetMonitorWorkAreaNearestWindow(window.get()), window->bounds()); diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc index 786c1c5..84046b9 100644 --- a/ash/wm/workspace/workspace_event_filter.cc +++ b/ash/wm/workspace/workspace_event_filter.cc @@ -4,7 +4,6 @@ #include "ash/wm/workspace/workspace_event_filter.h" -#include "ash/screen_ash.h" #include "ash/wm/property_util.h" #include "ash/wm/window_frame.h" #include "ash/wm/window_util.h" @@ -12,6 +11,7 @@ #include "ash/wm/workspace/workspace_window_resizer.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/event.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" #include "ui/base/hit_test.h" diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc index b984493..52c50c4 100644 --- a/ash/wm/workspace/workspace_layout_manager.cc +++ b/ash/wm/workspace/workspace_layout_manager.cc @@ -4,7 +4,6 @@ #include "ash/wm/workspace/workspace_layout_manager.h" -#include "ash/screen_ash.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace.h" @@ -13,6 +12,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/event.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/window.h" #include "ui/aura/window_observer.h" #include "ui/base/ui_base_types.h" diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc index 1aaa8d0..caf7d93 100644 --- a/ash/wm/workspace/workspace_manager.cc +++ b/ash/wm/workspace/workspace_manager.cc @@ -6,7 +6,6 @@ #include <algorithm> -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/wm/property_util.h" #include "ash/wm/shelf_layout_manager.h" @@ -20,6 +19,7 @@ #include "base/stl_util.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/window.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/compositor/layer.h" @@ -288,7 +288,7 @@ void WorkspaceManager::SetActiveWorkspace(Workspace* workspace) { gfx::Rect WorkspaceManager::GetWorkAreaBounds() { gfx::Rect bounds(workspace_size_); - bounds.Inset(Shell::GetInstance()->screen()->work_area_insets()); + bounds.Inset(Shell::GetRootWindow()->screen()->work_area_insets()); return bounds; } diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc index 20fa704..a9312ca 100644 --- a/ash/wm/workspace/workspace_manager_unittest.cc +++ b/ash/wm/workspace/workspace_manager_unittest.cc @@ -4,7 +4,6 @@ #include "ash/wm/workspace/workspace_manager.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" @@ -16,6 +15,7 @@ #include "ash/wm/workspace/workspace_layout_manager.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/window.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/screen.h" @@ -174,7 +174,7 @@ TEST_F(WorkspaceManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) { EXPECT_EQ(251, w1->bounds().height()); // Maximize the window. - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( gfx::Insets(0, 0, 30, 0)); w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); @@ -187,7 +187,7 @@ TEST_F(WorkspaceManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) { EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height()); // Change work area insets. - Shell::GetInstance()->SetScreenWorkAreaInsets( + Shell::GetRootWindow()->SetScreenWorkAreaInsets( gfx::Insets(0, 0, 60, 0)); // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the changed work diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 88c8987..d129d1e 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -4,11 +4,11 @@ #include "ash/wm/workspace/workspace_window_resizer.h" -#include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/string_number_conversions.h" #include "ui/aura/root_window.h" +#include "ui/aura/screen_aura.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/base/hit_test.h" @@ -51,7 +51,7 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { root->SetBounds(gfx::Rect(0, 0, 800, kRootHeight)); gfx::Rect root_bounds(root->bounds()); EXPECT_EQ(kRootHeight, root_bounds.height()); - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets()); + root->SetScreenWorkAreaInsets(gfx::Insets()); window_.reset(new aura::Window(&delegate_)); window_->Init(ui::Layer::LAYER_NOT_DRAWN); window_->SetParent(Shell::GetInstance()->GetRootWindow()); @@ -546,7 +546,7 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_2_REMEMBER) { TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3) { aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); root->SetBounds(gfx::Rect(0, 0, 600, 800)); - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets()); + root->SetScreenWorkAreaInsets(gfx::Insets()); window_->SetBounds(gfx::Rect( 300, 100, 300, 200)); window2_->SetBounds(gfx::Rect(300, 300, 200, 150)); @@ -588,7 +588,7 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3) { TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_RememberHeight) { aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); root->SetBounds(gfx::Rect(0, 0, 600, 800)); - Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets()); + root->SetScreenWorkAreaInsets(gfx::Insets()); window_->SetBounds(gfx::Rect( 300, 100, 300, 200)); window2_->SetBounds(gfx::Rect(300, 300, 200, 150)); |