summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 18:22:44 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 18:22:44 +0000
commit8a45c9775a4ccf87bf30a73df8954fe9446d6e2a (patch)
treefd100c56b428bb56b19f47291d95e4466d10e8bf /ash
parent23589b731fa97a94db920670795c9c91250c25f1 (diff)
downloadchromium_src-8a45c9775a4ccf87bf30a73df8954fe9446d6e2a.zip
chromium_src-8a45c9775a4ccf87bf30a73df8954fe9446d6e2a.tar.gz
chromium_src-8a45c9775a4ccf87bf30a73df8954fe9446d6e2a.tar.bz2
MonitorManager to manage multiple monitors.
This is clone of issue 9689027, which I can't access due to some internal error. BUG=115510 TEST=none Review URL: https://chromiumcodereview.appspot.com/9699013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/screen_ash.cc35
-rw-r--r--ash/screen_ash.h13
-rw-r--r--ash/shell.cc17
-rw-r--r--ash/shell.h6
-rw-r--r--ash/shell_observer.h2
-rw-r--r--ash/wm/base_layout_manager.cc2
-rw-r--r--ash/wm/base_layout_manager.h2
-rw-r--r--ash/wm/base_layout_manager_unittest.cc6
-rw-r--r--ash/wm/shelf_layout_manager.cc9
-rw-r--r--ash/wm/shelf_layout_manager_unittest.cc25
-rw-r--r--ash/wm/workspace/workspace_layout_manager.cc4
-rw-r--r--ash/wm/workspace/workspace_layout_manager.h2
-rw-r--r--ash/wm/workspace/workspace_manager.cc13
-rw-r--r--ash/wm/workspace/workspace_manager.h6
-rw-r--r--ash/wm/workspace/workspace_manager_unittest.cc10
-rw-r--r--ash/wm/workspace/workspace_window_resizer_unittest.cc7
16 files changed, 89 insertions, 70 deletions
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc
index bbdf9e8..9847480 100644
--- a/ash/screen_ash.cc
+++ b/ash/screen_ash.cc
@@ -5,12 +5,19 @@
#include "ash/screen_ash.h"
#include "base/logging.h"
+#include "ui/aura/env.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
-#include "ui/gfx/native_widget_types.h"
namespace ash {
+namespace {
+const aura::MonitorManager* GetMonitorManager() {
+ return aura::Env::GetInstance()->monitor_manager();
+}
+} // namespace
+
ScreenAsh::ScreenAsh(aura::RootWindow* root_window)
: root_window_(root_window) {
}
@@ -24,21 +31,23 @@ gfx::Point ScreenAsh::GetCursorScreenPointImpl() {
gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestWindowImpl(
gfx::NativeWindow window) {
- return GetWorkAreaBounds();
+ return GetMonitorManager()->GetMonitorNearestWindow(window)->
+ GetWorkAreaBounds();
}
gfx::Rect ScreenAsh::GetMonitorAreaNearestWindowImpl(
gfx::NativeWindow window) {
- return GetBounds();
+ return GetMonitorManager()->GetMonitorNearestWindow(window)->bounds();
}
gfx::Rect ScreenAsh::GetMonitorWorkAreaNearestPointImpl(
const gfx::Point& point) {
- return GetWorkAreaBounds();
+ return GetMonitorManager()->GetMonitorNearestPoint(point)->
+ GetWorkAreaBounds();
}
gfx::Rect ScreenAsh::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
- return GetBounds();
+ return GetMonitorManager()->GetMonitorNearestPoint(point)->bounds();
}
gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() {
@@ -46,22 +55,12 @@ gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPointImpl() {
return root_window_->GetTopWindowContainingPoint(point);
}
-gfx::Rect ScreenAsh::GetBounds() {
- return gfx::Rect(root_window_->bounds().size());
-}
-
-gfx::Rect ScreenAsh::GetWorkAreaBounds() {
- gfx::Rect bounds(GetBounds());
- bounds.Inset(work_area_insets_);
- return bounds;
-}
-
gfx::Size ScreenAsh::GetPrimaryMonitorSizeImpl() {
- return GetMonitorWorkAreaNearestPoint(gfx::Point()).size();
+ return GetMonitorManager()->GetPrimaryMonitor()->size();
}
int ScreenAsh::GetNumMonitorsImpl() {
- return 1;
+ return GetMonitorManager()->GetNumMonitors();
}
} // namespace ash
diff --git a/ash/screen_ash.h b/ash/screen_ash.h
index deaa76f..20340a7 100644
--- a/ash/screen_ash.h
+++ b/ash/screen_ash.h
@@ -24,11 +24,6 @@ class ASH_EXPORT ScreenAsh : public gfx::Screen {
explicit ScreenAsh(aura::RootWindow* root_window);
virtual ~ScreenAsh();
- void set_work_area_insets(const gfx::Insets& insets) {
- work_area_insets_ = insets;
- }
- const gfx::Insets& work_area_insets() const { return work_area_insets_; }
-
protected:
virtual gfx::Point GetCursorScreenPointImpl() OVERRIDE;
virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl(
@@ -44,14 +39,6 @@ class ASH_EXPORT ScreenAsh : public gfx::Screen {
virtual int GetNumMonitorsImpl() OVERRIDE;
private:
- // We currently support only one monitor. These two methods return the bounds
- // and work area.
- gfx::Rect GetBounds();
- gfx::Rect GetWorkAreaBounds();
-
- // Insets for the work area.
- gfx::Insets work_area_insets_;
-
aura::RootWindow* root_window_;
DISALLOW_COPY_AND_ASSIGN(ScreenAsh);
diff --git a/ash/shell.cc b/ash/shell.cc
index 44e3ba3..399082f 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -57,12 +57,14 @@
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
-#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
#include "ui/views/widget/native_widget_aura.h"
#include "ui/views/widget/widget.h"
@@ -333,6 +335,8 @@ Shell::Shell(ShellDelegate* delegate)
desktop_background_mode_(BACKGROUND_IMAGE),
root_window_layout_(NULL),
status_widget_(NULL) {
+ aura::Env::GetInstance()->SetMonitorManager(
+ aura::CreateSingleMonitorManager(root_window_.get()));
gfx::Screen::SetInstance(screen_);
}
@@ -618,12 +622,15 @@ void Shell::RotateFocus(Direction direction) {
internal::FocusCycler::BACKWARD);
}
-void Shell::SetScreenWorkAreaInsets(const gfx::Insets& insets) {
- if (screen_->work_area_insets() == insets)
+void Shell::SetMonitorWorkAreaInsets(Window* contains,
+ const gfx::Insets& insets) {
+ aura::Monitor* monitor = aura::Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestWindow(contains);
+ if (monitor->work_area_insets() == insets)
return;
- screen_->set_work_area_insets(insets);
+ monitor->set_work_area_insets(insets);
FOR_EACH_OBSERVER(ShellObserver, observers_,
- OnScreenWorkAreaInsetsChanged());
+ OnMonitorWorkAreaInsetsChanged());
}
void Shell::AddShellObserver(ShellObserver* observer) {
diff --git a/ash/shell.h b/ash/shell.h
index 70d8b63..90e7093 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -158,8 +158,10 @@ class ASH_EXPORT Shell {
// Rotate focus through containers that can receive focus.
void RotateFocus(Direction direction);
- // Sets the screen's work area insets, this notifies observers too.
- void SetScreenWorkAreaInsets(const gfx::Insets& insets);
+ // Sets the work area insets of the monitor that contains |window|,
+ // this notifies observers too.
+ void SetMonitorWorkAreaInsets(aura::Window* window,
+ const gfx::Insets& insets);
// Add/remove observer.
void AddShellObserver(ShellObserver* observer);
diff --git a/ash/shell_observer.h b/ash/shell_observer.h
index 0ecf927..d9852bc 100644
--- a/ash/shell_observer.h
+++ b/ash/shell_observer.h
@@ -13,7 +13,7 @@ namespace ash {
class ASH_EXPORT ShellObserver {
public:
// Invoked after the screen's work area insets changes.
- virtual void OnScreenWorkAreaInsetsChanged() {}
+ virtual void OnMonitorWorkAreaInsetsChanged() {}
protected:
virtual ~ShellObserver() {}
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index 86d09b1..81163dd 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -76,7 +76,7 @@ void BaseLayoutManager::OnRootWindowResized(const gfx::Size& new_size) {
/////////////////////////////////////////////////////////////////////////////
// BaseLayoutManager, ash::ShellObserver overrides:
-void BaseLayoutManager::OnScreenWorkAreaInsetsChanged() {
+void BaseLayoutManager::OnMonitorWorkAreaInsetsChanged() {
AdjustWindowSizesForScreenChange();
}
diff --git a/ash/wm/base_layout_manager.h b/ash/wm/base_layout_manager.h
index f752495..fa5405e 100644
--- a/ash/wm/base_layout_manager.h
+++ b/ash/wm/base_layout_manager.h
@@ -54,7 +54,7 @@ class ASH_EXPORT BaseLayoutManager : public aura::LayoutManager,
virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE;
// ash::ShellObserver overrides:
- virtual void OnScreenWorkAreaInsetsChanged() OVERRIDE;
+ virtual void OnMonitorWorkAreaInsetsChanged() OVERRIDE;
// WindowObserver overrides:
virtual void OnWindowPropertyChanged(aura::Window* window,
diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc
index f63e38c..fdb7649 100644
--- a/ash/wm/base_layout_manager_unittest.cc
+++ b/ash/wm/base_layout_manager_unittest.cc
@@ -13,8 +13,9 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/test_windows.h"
-#include "ui/base/ui_base_types.h"
#include "ui/aura/window.h"
+#include "ui/base/ui_base_types.h"
+#include "ui/gfx/insets.h"
namespace ash {
@@ -27,7 +28,8 @@ class BaseLayoutManagerTest : public test::AshTestBase {
virtual void SetUp() OVERRIDE {
test::AshTestBase::SetUp();
- Shell::GetInstance()->SetScreenWorkAreaInsets(
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(),
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 9691a5f..9ebb15e 100644
--- a/ash/wm/shelf_layout_manager.cc
+++ b/ash/wm/shelf_layout_manager.cc
@@ -47,7 +47,8 @@ ShelfLayoutManager::ShelfLayoutManager(views::Widget* launcher,
ShelfLayoutManager::~ShelfLayoutManager() {
// Without a shelf we don't need special insets anymore.
- Shell::GetInstance()->SetScreenWorkAreaInsets(gfx::Insets());
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(), gfx::Insets());
}
void ShelfLayoutManager::LayoutShelf() {
@@ -62,7 +63,8 @@ void ShelfLayoutManager::LayoutShelf() {
status_->SetBounds(target_bounds.status_bounds);
Shell::GetInstance()->launcher()->SetStatusWidth(
target_bounds.status_bounds.width());
- Shell::GetInstance()->SetScreenWorkAreaInsets(
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(),
target_bounds.work_area_insets);
}
@@ -155,7 +157,8 @@ void ShelfLayoutManager::CalculateTargetBounds(bool visible,
void ShelfLayoutManager::OnImplicitAnimationsCompleted() {
TargetBounds target_bounds;
CalculateTargetBounds(visible_, &target_bounds);
- Shell::GetInstance()->SetScreenWorkAreaInsets(
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(),
target_bounds.work_area_insets);
}
diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc
index bfedd5a..47b6fae 100644
--- a/ash/wm/shelf_layout_manager_unittest.cc
+++ b/ash/wm/shelf_layout_manager_unittest.cc
@@ -9,11 +9,15 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
+#include "ui/aura/env.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/base/animation/animation_container_element.h"
#include "ui/gfx/compositor/layer_animator.h"
#include "ui/gfx/compositor/layer.h"
+#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"
namespace ash {
@@ -50,12 +54,14 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
// Force an initial layout.
shelf->LayoutShelf();
ASSERT_TRUE(shelf->visible());
-
- const ash::ScreenAsh* screen = Shell::GetInstance()->screen();
- ASSERT_TRUE(screen);
+ const aura::MonitorManager* manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ manager->GetMonitorNearestWindow(Shell::GetRootWindow());
+ ASSERT_TRUE(monitor);
// Bottom inset should be the max of widget heights.
EXPECT_EQ(shelf->max_height() + ShelfLayoutManager::kWorkspaceAreaBottomInset,
- screen->work_area_insets().bottom());
+ monitor->work_area_insets().bottom());
// Hide the shelf.
shelf->SetVisible(false);
@@ -63,7 +69,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
StepWidgetLayerAnimatorToEnd(shelf->launcher());
StepWidgetLayerAnimatorToEnd(shelf->status());
EXPECT_FALSE(shelf->visible());
- EXPECT_EQ(0, screen->work_area_insets().bottom());
+ EXPECT_EQ(0, monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
EXPECT_GE(shelf->launcher()->GetNativeView()->bounds().y(),
@@ -78,7 +84,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
StepWidgetLayerAnimatorToEnd(shelf->status());
EXPECT_TRUE(shelf->visible());
EXPECT_EQ(shelf->max_height() + ShelfLayoutManager::kWorkspaceAreaBottomInset,
- screen->work_area_insets().bottom());
+ monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
gfx::Rect launcher_bounds(shelf->launcher()->GetNativeView()->bounds());
@@ -98,14 +104,17 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) {
shelf->LayoutShelf();
ASSERT_TRUE(shelf->visible());
- const ash::ScreenAsh* screen = Shell::GetInstance()->screen();
+ const aura::MonitorManager* manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ manager->GetMonitorNearestWindow(Shell::GetRootWindow());
// Hide the shelf.
shelf->SetVisible(false);
shelf->LayoutShelf();
EXPECT_FALSE(shelf->visible());
EXPECT_FALSE(shelf->visible());
- EXPECT_EQ(0, screen->work_area_insets().bottom());
+ EXPECT_EQ(0, monitor->work_area_insets().bottom());
// Make sure the bounds of the two widgets changed.
EXPECT_GE(shelf->launcher()->GetNativeView()->bounds().y(),
gfx::Screen::GetPrimaryMonitorBounds().bottom());
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 95301f2..3c9caab 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -101,8 +101,8 @@ void WorkspaceLayoutManager::OnRootWindowResized(const gfx::Size& new_size) {
workspace_manager_->SetWorkspaceSize(new_size);
}
-void WorkspaceLayoutManager::OnScreenWorkAreaInsetsChanged() {
- workspace_manager_->OnScreenWorkAreaInsetsChanged();
+void WorkspaceLayoutManager::OnMonitorWorkAreaInsetsChanged() {
+ workspace_manager_->OnMonitorWorkAreaInsetsChanged();
}
void WorkspaceLayoutManager::OnWindowPropertyChanged(aura::Window* window,
diff --git a/ash/wm/workspace/workspace_layout_manager.h b/ash/wm/workspace/workspace_layout_manager.h
index cf644d1..b1ddf94 100644
--- a/ash/wm/workspace/workspace_layout_manager.h
+++ b/ash/wm/workspace/workspace_layout_manager.h
@@ -48,7 +48,7 @@ class ASH_EXPORT WorkspaceLayoutManager : public BaseLayoutManager {
virtual void SetChildBounds(aura::Window* child,
const gfx::Rect& requested_bounds) OVERRIDE;
virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE;
- virtual void OnScreenWorkAreaInsetsChanged() OVERRIDE;
+ virtual void OnMonitorWorkAreaInsetsChanged() OVERRIDE;
// Overriden from aura::WindowObserver:
virtual void OnWindowPropertyChanged(aura::Window* window,
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc
index 7315a5db..bb74fe1 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -18,8 +18,11 @@
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/stl_util.h"
+#include "ui/aura/env.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/compositor/layer.h"
@@ -159,7 +162,7 @@ void WorkspaceManager::SetWorkspaceSize(const gfx::Size& workspace_size) {
SetWorkspaceBounds();
}
-void WorkspaceManager::OnScreenWorkAreaInsetsChanged() {
+void WorkspaceManager::OnMonitorWorkAreaInsetsChanged() {
SetWorkspaceBounds();
}
@@ -288,9 +291,13 @@ void WorkspaceManager::SetActiveWorkspace(Workspace* workspace) {
is_overview_ = false;
}
-gfx::Rect WorkspaceManager::GetWorkAreaBounds() {
+gfx::Rect WorkspaceManager::GetWorkAreaBounds() const {
gfx::Rect bounds(workspace_size_);
- bounds.Inset(Shell::GetInstance()->screen()->work_area_insets());
+ const aura::MonitorManager* monitor_manager =
+ aura::Env::GetInstance()->monitor_manager();
+ const aura::Monitor* monitor =
+ monitor_manager->GetMonitorNearestWindow(contents_view_);
+ bounds.Inset(monitor->work_area_insets());
return bounds;
}
diff --git a/ash/wm/workspace/workspace_manager.h b/ash/wm/workspace/workspace_manager.h
index 876209c..a1b1020 100644
--- a/ash/wm/workspace/workspace_manager.h
+++ b/ash/wm/workspace/workspace_manager.h
@@ -66,8 +66,8 @@ class ASH_EXPORT WorkspaceManager {
// Sets the size of a single workspace (all workspaces have the same size).
void SetWorkspaceSize(const gfx::Size& workspace_size);
- // Called when screen work area insets changes.
- void OnScreenWorkAreaInsetsChanged();
+ // Called when monitor's work area insets changes.
+ void OnMonitorWorkAreaInsetsChanged();
// Returns the window the layout manager should allow the size to be set for.
// TODO: maybe this should be set on WorkspaceLayoutManager.
@@ -126,7 +126,7 @@ class ASH_EXPORT WorkspaceManager {
void SetActiveWorkspace(Workspace* workspace);
// Returns the bounds of the work area.
- gfx::Rect GetWorkAreaBounds();
+ gfx::Rect GetWorkAreaBounds() const;
// Returns the index of the workspace that contains the |window|.
int GetWorkspaceIndexContaining(aura::Window* window) const;
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index a1d88f4..12fd5af 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -174,8 +174,9 @@ TEST_F(WorkspaceManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) {
EXPECT_EQ(251, w1->bounds().height());
// Maximize the window.
- Shell::GetInstance()->SetScreenWorkAreaInsets(
- gfx::Insets(0, 0, 30, 0));
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(),
+ gfx::Insets(0, 0, 30, 0));
w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
// Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the work area bounds.
@@ -187,8 +188,9 @@ TEST_F(WorkspaceManagerTest, ResizeMaximizedWindowOnWorkAreaInsetsChange) {
EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height());
// Change work area insets.
- Shell::GetInstance()->SetScreenWorkAreaInsets(
- gfx::Insets(0, 0, 60, 0));
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(
+ Shell::GetRootWindow(),
+ gfx::Insets(0, 0, 60, 0));
// Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the changed work
// area bounds.
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index f26460a..cf4c836 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -12,6 +12,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/base/hit_test.h"
+#include "ui/gfx/insets.h"
namespace ash {
namespace internal {
@@ -52,7 +53,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());
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(root, gfx::Insets());
window_.reset(new aura::Window(&delegate_));
window_->Init(ui::Layer::LAYER_NOT_DRAWN);
window_->SetParent(Shell::GetInstance()->GetRootWindow());
@@ -547,7 +548,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());
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(root, gfx::Insets());
window_->SetBounds(gfx::Rect( 300, 100, 300, 200));
window2_->SetBounds(gfx::Rect(300, 300, 200, 150));
@@ -589,7 +590,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());
+ Shell::GetInstance()->SetMonitorWorkAreaInsets(root, gfx::Insets());
window_->SetBounds(gfx::Rect( 300, 100, 300, 200));
window2_->SetBounds(gfx::Rect(300, 300, 200, 150));