diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-17 03:50:33 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-17 03:50:33 +0000 |
commit | 42c0a0c6d7f217aa7b52a4f3452f74857d894229 (patch) | |
tree | ac51dd0c4ee2e4cf8b3425ede7a78cb5a8da257c /ash | |
parent | 0e62ba1500c67c29943d8ff3ea48d07599396e92 (diff) | |
download | chromium_src-42c0a0c6d7f217aa7b52a4f3452f74857d894229.zip chromium_src-42c0a0c6d7f217aa7b52a4f3452f74857d894229.tar.gz chromium_src-42c0a0c6d7f217aa7b52a4f3452f74857d894229.tar.bz2 |
Rename gfx::Screen::GetMonitorXXXX to gfx::Screen::GetDisplayXXX.
BUG=130828
R=oshima@chromium.org
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10540123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
29 files changed, 114 insertions, 114 deletions
diff --git a/ash/dip_unittest.cc b/ash/dip_unittest.cc index 118350d..a6ebe14 100644 --- a/ash/dip_unittest.cc +++ b/ash/dip_unittest.cc @@ -39,7 +39,7 @@ TEST_F(DIPTest, MAYBE_WorkArea) { ChangeMonitorConfig(1.0f, gfx::Rect(0, 0, 1000, 900)); aura::RootWindow* root = Shell::GetPrimaryRootWindow(); - const gfx::Display display = gfx::Screen::GetMonitorNearestWindow(root); + const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(root); EXPECT_EQ("0,0 1000x900", display.bounds().ToString()); gfx::Rect work_area = display.work_area(); @@ -48,7 +48,7 @@ TEST_F(DIPTest, MAYBE_WorkArea) { ChangeMonitorConfig(2.0f, gfx::Rect(0, 0, 2000, 1800)); - const gfx::Display display_2x = gfx::Screen::GetMonitorNearestWindow(root); + const gfx::Display display_2x = gfx::Screen::GetDisplayNearestWindow(root); // The |bounds_in_pixel()| should report bounds in pixel coordinate. EXPECT_EQ("0,0 2000x1800", display_2x.bounds_in_pixel().ToString()); diff --git a/ash/monitor/monitor_controller.cc b/ash/monitor/monitor_controller.cc index d224b94..0cdb550 100644 --- a/ash/monitor/monitor_controller.cc +++ b/ash/monitor/monitor_controller.cc @@ -46,7 +46,7 @@ MonitorController::~MonitorController() { void MonitorController::InitPrimaryDisplay() { aura::MonitorManager* monitor_manager = aura::Env::GetInstance()->monitor_manager(); - const gfx::Display& display = monitor_manager->GetMonitorAt(0); + const gfx::Display& display = monitor_manager->GetDisplayAt(0); DCHECK_EQ(0, display.id()); aura::RootWindow* root = monitor_manager->CreateRootWindowForMonitor(display); @@ -61,8 +61,8 @@ void MonitorController::InitPrimaryDisplay() { void MonitorController::InitSecondaryDisplays() { aura::MonitorManager* monitor_manager = aura::Env::GetInstance()->monitor_manager(); - for (size_t i = 1; i < monitor_manager->GetNumMonitors(); ++i) { - const gfx::Display& display = monitor_manager->GetMonitorAt(i); + for (size_t i = 1; i < monitor_manager->GetNumDisplays(); ++i) { + const gfx::Display& display = monitor_manager->GetDisplayAt(i); aura::RootWindow* root = monitor_manager->CreateRootWindowForMonitor(display); root_windows_[display.id()] = root; diff --git a/ash/monitor/multi_monitor_manager.cc b/ash/monitor/multi_monitor_manager.cc index e36cf01..25ff1f7 100644 --- a/ash/monitor/multi_monitor_manager.cc +++ b/ash/monitor/multi_monitor_manager.cc @@ -124,19 +124,19 @@ RootWindow* MultiMonitorManager::CreateRootWindowForMonitor( return root_window; } -const gfx::Display& MultiMonitorManager::GetMonitorAt(size_t index) { +const gfx::Display& MultiMonitorManager::GetDisplayAt(size_t index) { return index < displays_.size() ? displays_[index] : GetInvalidDisplay(); } -size_t MultiMonitorManager::GetNumMonitors() const { +size_t MultiMonitorManager::GetNumDisplays() const { return displays_.size(); } -const gfx::Display& MultiMonitorManager::GetMonitorNearestWindow( +const gfx::Display& MultiMonitorManager::GetDisplayNearestWindow( const Window* window) const { if (!window) { MultiMonitorManager* manager = const_cast<MultiMonitorManager*>(this); - return manager->GetMonitorAt(0); + return manager->GetDisplayAt(0); } const RootWindow* root = window->GetRootWindow(); MultiMonitorManager* that = const_cast<MultiMonitorManager*>(this); @@ -145,12 +145,12 @@ const gfx::Display& MultiMonitorManager::GetMonitorNearestWindow( GetInvalidDisplay(); } -const gfx::Display& MultiMonitorManager::GetMonitorNearestPoint( +const gfx::Display& MultiMonitorManager::GetDisplayNearestPoint( const gfx::Point& point) const { // TODO(oshima): For m19, mouse is constrained within // the primary window. MultiMonitorManager* manager = const_cast<MultiMonitorManager*>(this); - return manager->GetMonitorAt(0); + return manager->GetDisplayAt(0); } void MultiMonitorManager::OnRootWindowResized(const aura::RootWindow* root, diff --git a/ash/monitor/multi_monitor_manager.h b/ash/monitor/multi_monitor_manager.h index 381bba8..0faf39d 100644 --- a/ash/monitor/multi_monitor_manager.h +++ b/ash/monitor/multi_monitor_manager.h @@ -48,12 +48,12 @@ class ASH_EXPORT MultiMonitorManager : public aura::MonitorManager, const std::vector<gfx::Display>& displays) OVERRIDE; virtual aura::RootWindow* CreateRootWindowForMonitor( const gfx::Display& display) OVERRIDE; - virtual const gfx::Display& GetMonitorAt(size_t index) OVERRIDE; + virtual const gfx::Display& GetDisplayAt(size_t index) OVERRIDE; - virtual size_t GetNumMonitors() const OVERRIDE; - virtual const gfx::Display& GetMonitorNearestPoint( + virtual size_t GetNumDisplays() const OVERRIDE; + virtual const gfx::Display& GetDisplayNearestPoint( const gfx::Point& point) const OVERRIDE; - virtual const gfx::Display& GetMonitorNearestWindow( + virtual const gfx::Display& GetDisplayNearestWindow( const aura::Window* window) const OVERRIDE; // RootWindowObserver overrides: diff --git a/ash/monitor/multi_monitor_manager_unittest.cc b/ash/monitor/multi_monitor_manager_unittest.cc index 3a31fd3..94a28cd 100644 --- a/ash/monitor/multi_monitor_manager_unittest.cc +++ b/ash/monitor/multi_monitor_manager_unittest.cc @@ -92,14 +92,14 @@ class MultiMonitorManagerTest : public test::AshTestBase, TEST_F(MultiMonitorManagerTest, NativeMonitorTest) { aura::MonitorManager::set_use_fullscreen_host_window(true); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); // Update primary and add seconary. UpdateMonitor("0+0-500x500,0+501-400x400"); - EXPECT_EQ(2U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(2U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("1 1 0", GetCountSummary()); - EXPECT_EQ(monitor_manager()->GetMonitorAt(0).id(), changed()[0].id()); - EXPECT_EQ(monitor_manager()->GetMonitorAt(1).id(), added()[0].id()); + EXPECT_EQ(monitor_manager()->GetDisplayAt(0).id(), changed()[0].id()); + EXPECT_EQ(monitor_manager()->GetDisplayAt(1).id(), added()[0].id()); EXPECT_EQ("0,0 500x500", changed()[0].bounds().ToString()); EXPECT_EQ("0,0 400x400", added()[0].bounds().ToString()); EXPECT_EQ("0,501 400x400", added()[0].bounds_in_pixel().ToString()); @@ -113,41 +113,41 @@ TEST_F(MultiMonitorManagerTest, NativeMonitorTest) { // Change primary. UpdateMonitor("0+0-1000x600"); EXPECT_EQ("1 0 0", GetCountSummary()); - EXPECT_EQ(monitor_manager()->GetMonitorAt(0).id(), changed()[0].id()); + EXPECT_EQ(monitor_manager()->GetDisplayAt(0).id(), changed()[0].id()); EXPECT_EQ("0,0 1000x600", changed()[0].bounds().ToString()); reset(); // Add secondary. UpdateMonitor("0+0-1000x600,1001+0-600x400"); - EXPECT_EQ(2U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(2U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("0 1 0", GetCountSummary()); - EXPECT_EQ(monitor_manager()->GetMonitorAt(1).id(), added()[0].id()); + EXPECT_EQ(monitor_manager()->GetDisplayAt(1).id(), added()[0].id()); EXPECT_EQ("0,0 600x400", added()[0].bounds().ToString()); EXPECT_EQ("1001,0 600x400", added()[0].bounds_in_pixel().ToString()); reset(); // Secondary removed, primary changed. UpdateMonitor("0+0-800x300"); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("1 0 1", GetCountSummary()); - EXPECT_EQ(monitor_manager()->GetMonitorAt(0).id(), changed()[0].id()); + EXPECT_EQ(monitor_manager()->GetDisplayAt(0).id(), changed()[0].id()); EXPECT_EQ("0,0 800x300", changed()[0].bounds().ToString()); reset(); // # of display can go to zero when screen is off. const vector<gfx::Display> empty; monitor_manager()->OnNativeMonitorsChanged(empty); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("0 0 0", GetCountSummary()); EXPECT_FALSE(root_window_destroyed()); // Monitor configuration stays the same EXPECT_EQ("0,0 800x300", - monitor_manager()->GetMonitorAt(0).bounds().ToString()); + monitor_manager()->GetDisplayAt(0).bounds().ToString()); reset(); // Connect to monitor again UpdateMonitor("100+100-500x400"); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("1 0 0", GetCountSummary()); EXPECT_FALSE(root_window_destroyed()); EXPECT_EQ("0,0 500x400", changed()[0].bounds().ToString()); @@ -156,19 +156,19 @@ TEST_F(MultiMonitorManagerTest, NativeMonitorTest) { // Go back to zero and wake up with multiple monitors. monitor_manager()->OnNativeMonitorsChanged(empty); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_FALSE(root_window_destroyed()); reset(); // Add secondary. UpdateMonitor("0+0-1000x600,1000+0-600x400"); - EXPECT_EQ(2U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(2U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("0,0 1000x600", - monitor_manager()->GetMonitorAt(0).bounds().ToString()); + monitor_manager()->GetDisplayAt(0).bounds().ToString()); EXPECT_EQ("0,0 600x400", - monitor_manager()->GetMonitorAt(1).bounds().ToString()); + monitor_manager()->GetDisplayAt(1).bounds().ToString()); EXPECT_EQ("1000,0 600x400", - monitor_manager()->GetMonitorAt(1).bounds_in_pixel().ToString()); + monitor_manager()->GetDisplayAt(1).bounds_in_pixel().ToString()); reset(); aura::MonitorManager::set_use_fullscreen_host_window(false); @@ -176,11 +176,11 @@ TEST_F(MultiMonitorManagerTest, NativeMonitorTest) { // Test in emulation mode (use_fullscreen_host_window=false) TEST_F(MultiMonitorManagerTest, EmulatorTest) { - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); internal::MultiMonitorManager::AddRemoveMonitor(); // Update primary and add seconary. - EXPECT_EQ(2U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(2U, monitor_manager()->GetNumDisplays()); #if defined(OS_WIN) // TODO(oshima): Windows receives resize event for some reason. EXPECT_EQ("1 1 0", GetCountSummary()); @@ -190,7 +190,7 @@ TEST_F(MultiMonitorManagerTest, EmulatorTest) { reset(); internal::MultiMonitorManager::CycleMonitor(); - EXPECT_EQ(2U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(2U, monitor_manager()->GetNumDisplays()); // Observer gets called twice in this mode because // it gets notified both from |OnNativeMonitorChagned| // and from |RootWindowObserver|, which is the consequence of @@ -199,12 +199,12 @@ TEST_F(MultiMonitorManagerTest, EmulatorTest) { reset(); internal::MultiMonitorManager::AddRemoveMonitor(); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("0 0 1", GetCountSummary()); reset(); internal::MultiMonitorManager::CycleMonitor(); - EXPECT_EQ(1U, monitor_manager()->GetNumMonitors()); + EXPECT_EQ(1U, monitor_manager()->GetNumDisplays()); EXPECT_EQ("0 0 0", GetCountSummary()); reset(); } diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc index 71df546..e444ebf 100644 --- a/ash/screen_ash.cc +++ b/ash/screen_ash.cc @@ -32,7 +32,7 @@ gfx::Rect ScreenAsh::GetMaximizedWindowBounds(aura::Window* window) { if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) return Shell::GetInstance()->shelf()->GetMaximizedWindowBounds(window); else - return gfx::Screen::GetMonitorNearestWindow(window).bounds(); + return gfx::Screen::GetDisplayNearestWindow(window).bounds(); } // static @@ -40,7 +40,7 @@ gfx::Rect ScreenAsh::GetUnmaximizedWorkAreaBounds(aura::Window* window) { if (window->GetRootWindow() == Shell::GetPrimaryRootWindow()) return Shell::GetInstance()->shelf()->GetUnmaximizedWorkAreaBounds(window); else - return gfx::Screen::GetMonitorNearestWindow(window).work_area(); + return gfx::Screen::GetDisplayNearestWindow(window).work_area(); } gfx::Point ScreenAsh::GetCursorScreenPoint() { @@ -54,20 +54,20 @@ gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { return Shell::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); } -int ScreenAsh::GetNumMonitors() { - return GetMonitorManager()->GetNumMonitors(); +int ScreenAsh::GetNumDisplays() { + return GetMonitorManager()->GetNumDisplays(); } -gfx::Display ScreenAsh::GetMonitorNearestWindow(gfx::NativeView window) const { - return GetMonitorManager()->GetMonitorNearestWindow(window); +gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { + return GetMonitorManager()->GetDisplayNearestWindow(window); } -gfx::Display ScreenAsh::GetMonitorNearestPoint(const gfx::Point& point) const { - return GetMonitorManager()->GetMonitorNearestPoint(point); +gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { + return GetMonitorManager()->GetDisplayNearestPoint(point); } -gfx::Display ScreenAsh::GetPrimaryMonitor() const { - return GetMonitorManager()->GetMonitorAt(0); +gfx::Display ScreenAsh::GetPrimaryDisplay() const { + return GetMonitorManager()->GetDisplayAt(0); } } // namespace ash diff --git a/ash/screen_ash.h b/ash/screen_ash.h index bfe29b3..bd987d3 100644 --- a/ash/screen_ash.h +++ b/ash/screen_ash.h @@ -32,12 +32,12 @@ class ASH_EXPORT ScreenAsh : public gfx::ScreenImpl { virtual gfx::Point GetCursorScreenPoint() OVERRIDE; virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE; - virtual int GetNumMonitors() OVERRIDE; - virtual gfx::Display GetMonitorNearestWindow( + virtual int GetNumDisplays() OVERRIDE; + virtual gfx::Display GetDisplayNearestWindow( gfx::NativeView view) const OVERRIDE; - virtual gfx::Display GetMonitorNearestPoint( + virtual gfx::Display GetDisplayNearestPoint( const gfx::Point& point) const OVERRIDE; - virtual gfx::Display GetPrimaryMonitor() const OVERRIDE; + virtual gfx::Display GetPrimaryDisplay() const OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ScreenAsh); diff --git a/ash/screensaver/screensaver_view.cc b/ash/screensaver/screensaver_view.cc index 39eb8fb..013024a 100644 --- a/ash/screensaver/screensaver_view.cc +++ b/ash/screensaver/screensaver_view.cc @@ -10,10 +10,10 @@ #include "base/logging.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" -#include "ui/gfx/screen.h" #include "ui/aura/root_window.h" -#include "ui/views/layout/fill_layout.h" +#include "ui/gfx/screen.h" #include "ui/views/controls/webview/webview.h" +#include "ui/views/layout/fill_layout.h" #include "ui/views/widget/widget.h" using content::BrowserThread; @@ -129,7 +129,7 @@ void ScreensaverView::LoadScreensaver() { void ScreensaverView::ShowWindow() { aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); gfx::Rect screen_rect = - gfx::Screen::GetMonitorNearestWindow(root_window).bounds(); + gfx::Screen::GetDisplayNearestWindow(root_window).bounds(); // We want to be the fullscreen topmost child of the root window. // There should be nothing ever really that should show up on top of us. diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc index 250cb0c..da998a1d 100644 --- a/ash/system/tray/tray_bubble_view.cc +++ b/ash/system/tray/tray_bubble_view.cc @@ -269,7 +269,7 @@ gfx::Rect TrayBubbleView::GetAnchorRect() { rect = host_->GetAnchorRect(); // TODO(jennyz): May need to add left/right alignment in the following code. if (rect.IsEmpty()) { - rect = gfx::Screen::GetPrimaryMonitor().bounds(); + rect = gfx::Screen::GetPrimaryDisplay().bounds(); rect = gfx::Rect( base::i18n::IsRTL() ? kPaddingFromRightEdgeOfScreenBottomAlignment : rect.width() - kPaddingFromRightEdgeOfScreenBottomAlignment, diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 323790c..5b92cd8 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -74,7 +74,7 @@ void AshTestBase::TearDown() { void AshTestBase::ChangeMonitorConfig(float scale, const gfx::Rect& bounds_in_pixel) { - gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryMonitor().id()); + gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryDisplay().id()); display.SetScaleAndBounds(scale, bounds_in_pixel); std::vector<gfx::Display> displays; displays.push_back(display); diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index 23b30a5..64ca6f0 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -67,7 +67,7 @@ int GetMaxWidth(int x, int y) { // TODO(varunjain): implementation duplicated in tooltip_manager_aura. Figure // out a way to merge. gfx::Rect monitor_bounds = - gfx::Screen::GetMonitorNearestPoint(gfx::Point(x, y)).bounds(); + gfx::Screen::GetDisplayNearestPoint(gfx::Point(x, y)).bounds(); return (monitor_bounds.width() + 1) / 2; } @@ -156,7 +156,7 @@ class TooltipController::Tooltip { tooltip_rect.Offset(kCursorOffsetX, kCursorOffsetY); gfx::Rect monitor_bounds = - gfx::Screen::GetMonitorNearestPoint(tooltip_rect.origin()).bounds(); + gfx::Screen::GetDisplayNearestPoint(tooltip_rect.origin()).bounds(); // If tooltip is out of bounds on the x axis, we simply shift it // horizontally by the offset. diff --git a/ash/touch/touch_observer_hud.cc b/ash/touch/touch_observer_hud.cc index c9372aa..82ac305 100644 --- a/ash/touch/touch_observer_hud.cc +++ b/ash/touch/touch_observer_hud.cc @@ -42,7 +42,7 @@ class TouchHudCanvas : public views::View { : owner_(owner), path_index_(0), color_index_(0) { - gfx::Display display = gfx::Screen::GetPrimaryMonitor(); + gfx::Display display = gfx::Screen::GetPrimaryDisplay(); gfx::Rect bounds = display.bounds(); size_.set_width(bounds.width() / kScale); size_.set_height(bounds.height() / kScale); diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc index d9f90a6..4e39fff 100644 --- a/ash/wm/base_layout_manager.cc +++ b/ash/wm/base_layout_manager.cc @@ -105,7 +105,7 @@ void BaseLayoutManager::SetChildBounds(aura::Window* child, if (wm::IsWindowMaximized(child)) child_bounds = ScreenAsh::GetMaximizedWindowBounds(child); else if (wm::IsWindowFullscreen(child)) - child_bounds = gfx::Screen::GetMonitorNearestWindow(child).bounds(); + child_bounds = gfx::Screen::GetDisplayNearestWindow(child).bounds(); SetChildBoundsDirect(child, child_bounds); } @@ -198,7 +198,7 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window, // Don't animate the full-screen window transition. // TODO(jamescook): Use animation here. Be sure the lock screen works. SetChildBoundsDirect( - window, gfx::Screen::GetMonitorNearestWindow(window).bounds()); + window, gfx::Screen::GetDisplayNearestWindow(window).bounds()); break; default: @@ -235,11 +235,11 @@ void BaseLayoutManager::AdjustWindowSizesForScreenChange() { SetChildBoundsDirect(window, ScreenAsh::GetMaximizedWindowBounds(window)); } else if (wm::IsWindowFullscreen(window)) { SetChildBoundsDirect( - window, gfx::Screen::GetMonitorNearestWindow(window).bounds()); + window, gfx::Screen::GetDisplayNearestWindow(window).bounds()); } else { // The work area may be smaller than the full screen. gfx::Rect monitor_rect = - gfx::Screen::GetMonitorNearestWindow(window).work_area(); + gfx::Screen::GetDisplayNearestWindow(window).work_area(); // Put as much of the window as possible within the monitor area. window->SetBounds(window->bounds().AdjustToFit(monitor_rect)); } diff --git a/ash/wm/base_layout_manager_unittest.cc b/ash/wm/base_layout_manager_unittest.cc index 7420d23..626aa66 100644 --- a/ash/wm/base_layout_manager_unittest.cc +++ b/ash/wm/base_layout_manager_unittest.cc @@ -95,7 +95,7 @@ TEST_F(BaseLayoutManagerTest, Fullscreen) { window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); // Fullscreen window fills the whole monitor. EXPECT_EQ( - gfx::Screen::GetMonitorNearestWindow(window.get()).bounds().ToString(), + gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(), window->bounds().ToString()); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); EXPECT_EQ(bounds.ToString(), window->bounds().ToString()); @@ -108,12 +108,12 @@ TEST_F(BaseLayoutManagerTest, FullscreenRootWindowResize) { // Fullscreen window fills the whole monitor. window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); EXPECT_EQ( - gfx::Screen::GetMonitorNearestWindow(window.get()).bounds().ToString(), + gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(), window->bounds().ToString()); // Enlarge the root window. We should still match the monitor size. Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600)); EXPECT_EQ( - gfx::Screen::GetMonitorNearestWindow(window.get()).bounds().ToString(), + gfx::Screen::GetDisplayNearestWindow(window.get()).bounds().ToString(), window->bounds().ToString()); } @@ -130,20 +130,20 @@ TEST_F(BaseLayoutManagerTest, MAYBE_RootWindowResizeShrinksWindows) { scoped_ptr<aura::Window> window( CreateTestWindow(gfx::Rect(10, 20, 500, 400))); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(window.get()).work_area(); + gfx::Screen::GetDisplayNearestWindow(window.get()).work_area(); // Invariant: Window is smaller than work area. EXPECT_LE(window->bounds().width(), work_area.width()); EXPECT_LE(window->bounds().height(), work_area.height()); // Make the root window narrower than our window. Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(300, 400)); - work_area = gfx::Screen::GetMonitorNearestWindow(window.get()).work_area(); + work_area = gfx::Screen::GetDisplayNearestWindow(window.get()).work_area(); EXPECT_LE(window->bounds().width(), work_area.width()); EXPECT_LE(window->bounds().height(), work_area.height()); // Make the root window shorter than our window. Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(300, 200)); - work_area = gfx::Screen::GetMonitorNearestWindow(window.get()).work_area(); + work_area = gfx::Screen::GetDisplayNearestWindow(window.get()).work_area(); EXPECT_LE(window->bounds().width(), work_area.width()); EXPECT_LE(window->bounds().height(), work_area.height()); @@ -158,7 +158,7 @@ TEST_F(BaseLayoutManagerTest, MAYBE_RootWindowResizeShrinksWindows) { // to smaller than the full work area. TEST_F(BaseLayoutManagerTest, BoundsWithScreenEdgeVisible) { // Create a window with bounds that fill the screen. - gfx::Rect bounds = gfx::Screen::GetPrimaryMonitor().bounds(); + gfx::Rect bounds = gfx::Screen::GetPrimaryDisplay().bounds(); scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); // Maximize it, which writes the old bounds to restore bounds. window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index e6c674a..3c3246f 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -156,7 +156,7 @@ bool ShelfLayoutManager::IsVisible() const { gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( aura::Window* window) { // TODO: needs to be multi-mon aware. - gfx::Rect bounds(gfx::Screen::GetMonitorNearestWindow(window).bounds()); + gfx::Rect bounds(gfx::Screen::GetDisplayNearestWindow(window).bounds()); if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { AdjustBoundsBasedOnAlignment(kAutoHideSize, &bounds); @@ -169,7 +169,7 @@ gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( gfx::Rect ShelfLayoutManager::GetUnmaximizedWorkAreaBounds( aura::Window* window) { // TODO: needs to be multi-mon aware. - gfx::Rect bounds(gfx::Screen::GetMonitorNearestWindow(window).bounds()); + gfx::Rect bounds(gfx::Screen::GetDisplayNearestWindow(window).bounds()); int size; if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { size = kAutoHideSize; @@ -209,7 +209,7 @@ gfx::Rect ShelfLayoutManager::GetIdealBounds() { // TODO: this is wrong. Figure out what monitor shelf is on and everything // should be based on it. gfx::Rect bounds( - gfx::Screen::GetMonitorNearestWindow(status_->GetNativeView()).bounds()); + gfx::Screen::GetDisplayNearestWindow(status_->GetNativeView()).bounds()); int width = 0, height = 0; GetShelfSize(&width, &height); switch (alignment_) { diff --git a/ash/wm/shelf_layout_manager_unittest.cc b/ash/wm/shelf_layout_manager_unittest.cc index cd88130..7bade22 100644 --- a/ash/wm/shelf_layout_manager_unittest.cc +++ b/ash/wm/shelf_layout_manager_unittest.cc @@ -95,7 +95,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { const aura::MonitorManager* manager = aura::Env::GetInstance()->monitor_manager(); const gfx::Display& display = - manager->GetMonitorNearestWindow(Shell::GetPrimaryRootWindow()); + manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); // Bottom inset should be the max of widget heights. EXPECT_EQ(shelf_height, @@ -112,9 +112,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { // Make sure the bounds of the two widgets changed. EXPECT_GE(shelf->launcher_widget()->GetNativeView()->bounds().y(), - gfx::Screen::GetPrimaryMonitor().bounds().bottom()); + gfx::Screen::GetPrimaryDisplay().bounds().bottom()); EXPECT_GE(shelf->status()->GetNativeView()->bounds().y(), - gfx::Screen::GetPrimaryMonitor().bounds().bottom()); + gfx::Screen::GetPrimaryDisplay().bounds().bottom()); // And show it again. SetState(shelf, ShelfLayoutManager::VISIBLE); @@ -127,7 +127,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) { // Make sure the bounds of the two widgets changed. launcher_bounds = shelf->launcher_widget()->GetNativeView()->bounds(); - int bottom = gfx::Screen::GetPrimaryMonitor().bounds().bottom() - + int bottom = gfx::Screen::GetPrimaryDisplay().bounds().bottom() - shelf_height; EXPECT_EQ(launcher_bounds.y(), bottom + (shelf->GetIdealBounds().height() - @@ -147,7 +147,7 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { const aura::MonitorManager* manager = aura::Env::GetInstance()->monitor_manager(); const gfx::Display& display = - manager->GetMonitorNearestWindow(Shell::GetPrimaryRootWindow()); + manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); // Hide the shelf. SetState(shelf, ShelfLayoutManager::HIDDEN); @@ -157,9 +157,9 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { // Make sure the bounds of the two widgets changed. EXPECT_GE(shelf->launcher_widget()->GetNativeView()->bounds().y(), - gfx::Screen::GetPrimaryMonitor().bounds().bottom()); + gfx::Screen::GetPrimaryDisplay().bounds().bottom()); EXPECT_GE(shelf->status()->GetNativeView()->bounds().y(), - gfx::Screen::GetPrimaryMonitor().bounds().bottom()); + gfx::Screen::GetPrimaryDisplay().bounds().bottom()); } // Makes sure the launcher is initially sized correctly. @@ -221,7 +221,7 @@ TEST_F(ShelfLayoutManagerTest, AutoHide) { EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, shelf->launcher_widget()->GetWindowScreenBounds().y()); EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, - gfx::Screen::GetMonitorNearestWindow(root).work_area().bottom()); + gfx::Screen::GetDisplayNearestWindow(root).work_area().bottom()); // Move the mouse to the bottom of the screen. generator.MoveMouseTo(0, root->bounds().bottom() - 1); @@ -233,7 +233,7 @@ TEST_F(ShelfLayoutManagerTest, AutoHide) { EXPECT_EQ(root->bounds().bottom() - shelf->GetIdealBounds().height(), shelf->launcher_widget()->GetWindowScreenBounds().y()); EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, - gfx::Screen::GetMonitorNearestWindow(root).work_area().bottom()); + gfx::Screen::GetDisplayNearestWindow(root).work_area().bottom()); // Move mouse back up. generator.MoveMouseTo(0, 0); @@ -327,7 +327,7 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) { widget->Show(); aura::Window* window = widget->GetNativeWindow(); gfx::Rect monitor_bounds( - gfx::Screen::GetMonitorNearestWindow(window).bounds()); + gfx::Screen::GetDisplayNearestWindow(window).bounds()); EXPECT_EQ(monitor_bounds.bottom() - ShelfLayoutManager::kAutoHideSize, shelf->GetMaximizedWindowBounds(window).bottom()); EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); @@ -349,17 +349,17 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) { widget->Maximize(); EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); - EXPECT_EQ(gfx::Screen::GetMonitorNearestWindow(window).work_area().bottom(), + EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), widget->GetWorkAreaBoundsInScreen().bottom()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); - EXPECT_EQ(gfx::Screen::GetMonitorNearestWindow(window).work_area().bottom(), + EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), widget->GetWorkAreaBoundsInScreen().bottom()); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); EXPECT_EQ(ShelfLayoutManager::VISIBLE, shelf->visibility_state()); - EXPECT_EQ(gfx::Screen::GetMonitorNearestWindow(window).work_area().bottom(), + EXPECT_EQ(gfx::Screen::GetDisplayNearestWindow(window).work_area().bottom(), widget->GetWorkAreaBoundsInScreen().bottom()); } @@ -504,7 +504,7 @@ TEST_F(ShelfLayoutManagerTest, SetAlignment) { const aura::MonitorManager* manager = aura::Env::GetInstance()->monitor_manager(); gfx::Display display = - manager->GetMonitorNearestWindow(Shell::GetPrimaryRootWindow()); + manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); EXPECT_EQ(shelf->GetIdealBounds().width(), display.GetWorkAreaInsets().left()); @@ -527,7 +527,7 @@ TEST_F(ShelfLayoutManagerTest, SetAlignment) { shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); launcher_bounds = shelf->launcher_widget()->GetWindowScreenBounds(); - display = manager->GetMonitorNearestWindow(Shell::GetPrimaryRootWindow()); + display = manager->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()); ASSERT_NE(-1, display.id()); EXPECT_EQ(shelf->GetIdealBounds().width(), display.GetWorkAreaInsets().right()); diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index ecde085..8e12bb8 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -25,11 +25,11 @@ #include "third_party/skia/include/core/SkRect.h" #include "ui/aura/event.h" #include "ui/aura/root_window.h" -#include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/base/animation/animation.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/linear_animation.h" #include "ui/base/gestures/gesture_configuration.h" +#include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -477,7 +477,7 @@ ui::GestureStatus SystemGestureEventFilter::PreHandleGestureEvent( switch (event->type()) { case ui::ET_GESTURE_SCROLL_BEGIN: { gfx::Rect screen = - gfx::Screen::GetMonitorNearestWindow(target).bounds(); + gfx::Screen::GetDisplayNearestWindow(target).bounds(); int overlap_area = screen.width() * overlap_percent_ / 100; orientation_ = SCROLL_ORIENTATION_UNSET; @@ -578,7 +578,7 @@ void SystemGestureEventFilter::ClearGestureHandlerForWindow( bool SystemGestureEventFilter::HandleDeviceControl(aura::Window* target, aura::GestureEvent* event) { - gfx::Rect screen = gfx::Screen::GetMonitorNearestWindow(target).bounds(); + gfx::Rect screen = gfx::Screen::GetDisplayNearestWindow(target).bounds(); double percent = 100.0 * (event->y() - screen.y()) / screen.height(); if (percent > 100.0) percent = 100.0; diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index 5070b14..2ca46bf 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -14,10 +14,10 @@ #include "ash/volume_control_delegate.h" #include "ash/wm/window_util.h" #include "base/time.h" -#include "ui/gfx/screen.h" #include "ui/aura/event.h" #include "ui/aura/root_window.h" #include "ui/aura/test/test_windows.h" +#include "ui/gfx/screen.h" namespace ash { namespace test { @@ -134,7 +134,7 @@ TEST_F(SystemGestureEventFilterTest, TapOutsideRootWindow) { TEST_F(SystemGestureEventFilterTest, DeviceControl) { aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); - gfx::Rect screen = gfx::Screen::GetPrimaryMonitor().bounds(); + gfx::Rect screen = gfx::Screen::GetPrimaryDisplay().bounds(); int ypos_half = screen.height() / 2; ash::AcceleratorController* accelerator = @@ -244,7 +244,7 @@ TEST_F(SystemGestureEventFilterTest, DeviceControl) { TEST_F(SystemGestureEventFilterTest, ApplicationControl) { aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); - gfx::Rect screen = gfx::Screen::GetPrimaryMonitor().bounds(); + gfx::Rect screen = gfx::Screen::GetPrimaryDisplay().bounds(); int ypos_half = screen.height() / 2; aura::test::TestWindowDelegate delegate; diff --git a/ash/wm/toplevel_window_event_filter_unittest.cc b/ash/wm/toplevel_window_event_filter_unittest.cc index f66cec3..fc8984b 100644 --- a/ash/wm/toplevel_window_event_filter_unittest.cc +++ b/ash/wm/toplevel_window_event_filter_unittest.cc @@ -350,7 +350,7 @@ TEST_F(ToplevelWindowEventFilterTest, DoubleClickCaptionTogglesMaximize) { TEST_F(ToplevelWindowEventFilterTest, BottomRightWorkArea) { scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT)); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(target.get()).work_area(); + gfx::Screen::GetDisplayNearestWindow(target.get()).work_area(); gfx::Point position = target->bounds().origin(); // Drag further than work_area bottom. DragFromCenterBy(target.get(), 100, work_area.height()); @@ -364,7 +364,7 @@ TEST_F(ToplevelWindowEventFilterTest, BottomRightWorkArea) { TEST_F(ToplevelWindowEventFilterTest, BottomLeftWorkArea) { scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMLEFT)); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(target.get()).work_area(); + gfx::Screen::GetDisplayNearestWindow(target.get()).work_area(); gfx::Point position = target->bounds().origin(); // Drag further than work_area bottom. DragFromCenterBy(target.get(), -30, work_area.height()); @@ -379,7 +379,7 @@ TEST_F(ToplevelWindowEventFilterTest, BottomLeftWorkArea) { TEST_F(ToplevelWindowEventFilterTest, BottomWorkArea) { scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOM)); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(target.get()).work_area(); + gfx::Screen::GetDisplayNearestWindow(target.get()).work_area(); gfx::Point position = target->bounds().origin(); // Drag further than work_area bottom. DragFromCenterBy(target.get(), 0, work_area.height()); @@ -406,7 +406,7 @@ TEST_F(ToplevelWindowEventFilterTest, DontDragToNegativeY) { TEST_F(ToplevelWindowEventFilterTest, DontGotWiderThanScreen) { scoped_ptr<aura::Window> target(CreateWindow(HTRIGHT)); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(target.get()).bounds(); + gfx::Screen::GetDisplayNearestWindow(target.get()).bounds(); DragFromCenterBy(target.get(), work_area.width() * 2, 0); // The y location and height should not have changed. EXPECT_EQ(work_area.width(), target->bounds().width()); diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index 913b694..d5d11e5 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -382,7 +382,7 @@ gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { // Assume the launcher is overflowed, zoom off to the bottom right of the // work area. gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(window).work_area(); + gfx::Screen::GetDisplayNearestWindow(window).work_area(); target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); } return target_bounds; diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index 60a9617..4217e64 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -449,7 +449,7 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) { gfx::Size size = root_window->bounds().size(); EXPECT_EQ( gfx::Rect(size).ToString(), - gfx::Screen::GetMonitorNearestPoint(gfx::Point()).bounds().ToString()); + gfx::Screen::GetDisplayNearestPoint(gfx::Point()).bounds().ToString()); // Rotate it clock-wise 90 degrees. ui::Transform transform; diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc index 2d43e8b..7e62d23 100644 --- a/ash/wm/window_resizer.cc +++ b/ash/wm/window_resizer.cc @@ -202,7 +202,7 @@ gfx::Rect WindowResizer::CalculateBoundsForDrag( if (details.window_component == HTBOTTOM || details.window_component == HTBOTTOMRIGHT || details.window_component == HTBOTTOMLEFT) { - gfx::Rect work_area = gfx::Screen::GetMonitorNearestWindow( + gfx::Rect work_area = gfx::Screen::GetDisplayNearestWindow( details.window).work_area(); if (new_bounds.bottom() > work_area.bottom()) new_bounds.Inset(0, 0, 0, @@ -294,7 +294,7 @@ int WindowResizer::GetWidthForDrag(const Details& details, // And don't let the window go bigger than the monitor. int max_width = - gfx::Screen::GetMonitorNearestWindow(details.window).bounds().width(); + gfx::Screen::GetDisplayNearestWindow(details.window).bounds().width(); if (width > max_width) { width = max_width; *delta_x = -x_multiplier * (details.initial_bounds.width() - max_width); @@ -328,7 +328,7 @@ int WindowResizer::GetHeightForDrag(const Details& details, // And don't let the window go bigger than the monitor. int max_height = - gfx::Screen::GetMonitorNearestWindow(details.window).bounds().height(); + gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); if (height > max_height) { height = max_height; *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 833e02c..17f6034 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc @@ -94,7 +94,7 @@ void RestoreWindow(aura::Window* window) { } void CenterWindow(aura::Window* window) { - const gfx::Display display = gfx::Screen::GetMonitorNearestWindow(window); + const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window); gfx::Rect center = display.work_area().Center(window->bounds().size()); window->SetBounds(center); } diff --git a/ash/wm/workspace/maximized_workspace.cc b/ash/wm/workspace/maximized_workspace.cc index 329c48c..f7e1b7a 100644 --- a/ash/wm/workspace/maximized_workspace.cc +++ b/ash/wm/workspace/maximized_workspace.cc @@ -41,7 +41,7 @@ void MaximizedWorkspace::OnWindowRemoved(aura::Window* window) { void MaximizedWorkspace::ResetWindowBounds(aura::Window* window) { if (wm::IsWindowFullscreen(window)) { SetWindowBounds(window, - gfx::Screen::GetMonitorNearestWindow(window).bounds()); + gfx::Screen::GetDisplayNearestWindow(window).bounds()); } else { SetWindowBounds(window, ScreenAsh::GetMaximizedWindowBounds(window)); } diff --git a/ash/wm/workspace/snap_sizer.cc b/ash/wm/workspace/snap_sizer.cc index 0816ff0..092ba697 100644 --- a/ash/wm/workspace/snap_sizer.cc +++ b/ash/wm/workspace/snap_sizer.cc @@ -130,7 +130,7 @@ gfx::Rect SnapSizer::GetTargetBoundsForPercent(int percent_index) const { bool SnapSizer::AlongEdge(int x) const { // TODO: need to support multi-monitor. - gfx::Rect area(gfx::Screen::GetMonitorNearestWindow(window_).bounds()); + gfx::Rect area(gfx::Screen::GetDisplayNearestWindow(window_).bounds()); return (x <= area.x()) || (x >= area.right() - 1); } diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc index 91c5c7c..863b418 100644 --- a/ash/wm/workspace/workspace_event_filter.cc +++ b/ash/wm/workspace/workspace_event_filter.cc @@ -128,7 +128,7 @@ void WorkspaceEventFilter::HandleVerticalResizeDoubleClick( int component = target->delegate()->GetNonClientComponent(event->location()); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(target).work_area(); + gfx::Screen::GetDisplayNearestWindow(target).work_area(); const gfx::Rect* restore_bounds = target->GetProperty(aura::client::kRestoreBoundsKey); if (component == HTBOTTOM || component == HTTOP) { diff --git a/ash/wm/workspace/workspace_event_filter_unittest.cc b/ash/wm/workspace/workspace_event_filter_unittest.cc index 65c69b4..00c2b44 100644 --- a/ash/wm/workspace/workspace_event_filter_unittest.cc +++ b/ash/wm/workspace/workspace_event_filter_unittest.cc @@ -7,8 +7,8 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/wm/window_util.h" -#include "ash/wm/workspace_controller.h" #include "ash/wm/workspace/workspace_manager.h" +#include "ash/wm/workspace_controller.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" @@ -52,7 +52,7 @@ TEST_F(WorkspaceEventFilterTest, DoubleClickSingleAxisResizeEdge) { scoped_ptr<aura::Window> window(CreateTestWindow(&wd, restored_bounds)); gfx::Rect work_area = - gfx::Screen::GetMonitorNearestWindow(window.get()).work_area(); + gfx::Screen::GetDisplayNearestWindow(window.get()).work_area(); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window.get()); diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc index 22e20f2..0377b7d 100644 --- a/ash/wm/workspace/workspace_manager_unittest.cc +++ b/ash/wm/workspace/workspace_manager_unittest.cc @@ -61,7 +61,7 @@ class WorkspaceManagerTest : public test::AshTestBase { } gfx::Rect GetFullscreenBounds(aura::Window* window) { - return gfx::Screen::GetMonitorNearestWindow(window).bounds(); + return gfx::Screen::GetDisplayNearestWindow(window).bounds(); } Workspace* active_workspace() { diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index 9065d8d..9b52030 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -210,7 +210,7 @@ void WorkspaceWindowResizer::LayoutAttachedWindows( const gfx::Rect& bounds, int grid_size) { gfx::Rect work_area( - gfx::Screen::GetMonitorNearestWindow(window()).work_area()); + gfx::Screen::GetDisplayNearestWindow(window()).work_area()); std::vector<int> sizes; CalculateAttachedSizes( PrimaryAxisSize(details_.initial_bounds.size()), @@ -280,7 +280,7 @@ void WorkspaceWindowResizer::AdjustBoundsForMainWindow( gfx::Rect* bounds, int grid_size) const { // Always keep kMinOnscreenHeight on the bottom. gfx::Rect work_area( - gfx::Screen::GetMonitorNearestWindow(window()).work_area()); + gfx::Screen::GetDisplayNearestWindow(window()).work_area()); int max_y = AlignToGridRoundUp(work_area.bottom() - kMinOnscreenHeight, grid_size); if (bounds->y() > max_y) @@ -334,7 +334,7 @@ void WorkspaceWindowResizer::SnapToWorkAreaEdges( bool WorkspaceWindowResizer::TouchesBottomOfScreen() const { gfx::Rect work_area( - gfx::Screen::GetMonitorNearestWindow(details_.window).work_area()); + gfx::Screen::GetDisplayNearestWindow(details_.window).work_area()); return (attached_windows_.empty() && details_.window->bounds().bottom() == work_area.bottom()) || (!attached_windows_.empty() && @@ -422,7 +422,7 @@ WorkspaceWindowResizer::SnapType WorkspaceWindowResizer::GetSnapType( // TODO: this likely only wants total monitor area, not the area of a single // monitor. gfx::Rect area( - gfx::Screen::GetMonitorNearestWindow(details_.window).bounds()); + gfx::Screen::GetDisplayNearestWindow(details_.window).bounds()); if (location.x() <= area.x()) return SNAP_LEFT_EDGE; if (location.x() >= area.right() - 1) |