diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 20:03:41 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 20:03:41 +0000 |
commit | b82c42c45ee1b113377a2800b36d6e5e05b8b8e1 (patch) | |
tree | 6034126ffc720a18cabc0bdb211de7ca10233670 /chrome/browser | |
parent | ce8d264d556f06a4b46b58b95bc82a884bb315d0 (diff) | |
download | chromium_src-b82c42c45ee1b113377a2800b36d6e5e05b8b8e1.zip chromium_src-b82c42c45ee1b113377a2800b36d6e5e05b8b8e1.tar.gz chromium_src-b82c42c45ee1b113377a2800b36d6e5e05b8b8e1.tar.bz2 |
* Separated implementation class from gfx::Screen
* Moved Monitor class to gfx/.
* Converted all use of gfx::Screen to match new API
BUG=115347,111990
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9960042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
28 files changed, 47 insertions, 46 deletions
diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc index bfff28e..b6ae0cb 100644 --- a/chrome/browser/chromeos/input_method/candidate_window.cc +++ b/chrome/browser/chromeos/input_method/candidate_window.cc @@ -1205,8 +1205,8 @@ void CandidateWindowView::ResizeAndMoveParentFrame() { const int horizontal_offset = GetHorizontalOffset(); gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); - gfx::Rect screen_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( - parent_frame_->GetNativeView()); + gfx::Rect screen_bounds = gfx::Screen::GetMonitorNearestWindow( + parent_frame_->GetNativeView()).work_area(); // The size. gfx::Rect frame_bounds = old_bounds; frame_bounds.set_size(GetPreferredSize()); @@ -1478,8 +1478,8 @@ void InfolistWindowView::UpdateCandidates( void InfolistWindowView::ResizeAndMoveParentFrame() { int x, y; gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); - gfx::Rect screen_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( - parent_frame_->GetNativeView()); + gfx::Rect screen_bounds = gfx::Screen::GetMonitorNearestWindow( + parent_frame_->GetNativeView()).work_area(); // The size. gfx::Rect frame_bounds = old_bounds; frame_bounds.set_size(GetPreferredSize()); diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index b435243..439ccbb 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -54,7 +54,7 @@ views::Throbber* CreateDefaultThrobber() { } gfx::Rect CalculateScreenBounds(const gfx::Size& size) { - gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(NULL)); + gfx::Rect bounds(gfx::Screen::GetPrimaryMonitor().bounds()); if (!size.IsEmpty()) { int horizontal_diff = bounds.width() - size.width(); int vertical_diff = bounds.height() - size.height(); diff --git a/chrome/browser/chromeos/login/webui_screen_locker.cc b/chrome/browser/chromeos/login/webui_screen_locker.cc index 08f6b3d..7774ea5 100644 --- a/chrome/browser/chromeos/login/webui_screen_locker.cc +++ b/chrome/browser/chromeos/login/webui_screen_locker.cc @@ -44,7 +44,7 @@ WebUIScreenLocker::WebUIScreenLocker(ScreenLocker* screen_locker) } void WebUIScreenLocker::LockScreen(bool unlock_on_input) { - gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(NULL)); + gfx::Rect bounds(gfx::Screen::GetPrimaryMonitor().bounds()); LockWindow* lock_window = LockWindow::Create(); lock_window->set_observer(this); diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc index 98ad62b..49447d0 100644 --- a/chrome/browser/chromeos/media/media_player.cc +++ b/chrome/browser/chromeos/media/media_player.cc @@ -124,7 +124,7 @@ void MediaPlayer::PopupMediaPlayer() { return; } - const gfx::Size screen = gfx::Screen::GetPrimaryMonitorSize(); + const gfx::Size screen = gfx::Screen::GetPrimaryMonitor().size(); const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, screen.height() - kPopupBottom - kPopupHeight, kPopupWidth, diff --git a/chrome/browser/chromeos/ui/setting_level_bubble.cc b/chrome/browser/chromeos/ui/setting_level_bubble.cc index 8635bcc..a673f47 100644 --- a/chrome/browser/chromeos/ui/setting_level_bubble.cc +++ b/chrome/browser/chromeos/ui/setting_level_bubble.cc @@ -82,7 +82,7 @@ gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() { // Calculate the position in screen coordinates that the bubble should // "point" at (since we use BubbleBorder::FLOAT, this position actually // specifies the center of the bubble). - gfx::Rect monitor_area = gfx::Screen::GetMonitorAreaNearestWindow(NULL); + gfx::Rect monitor_area = gfx::Screen::GetPrimaryMonitor().bounds(); return (gfx::Rect( monitor_area.x() + kBubbleXRatio * monitor_area.width(), monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0)); diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index 58cdfa1..775787c 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -264,7 +264,7 @@ PrefService* MetricsLog::GetPrefService() { } gfx::Size MetricsLog::GetScreenSize() const { - return gfx::Screen::GetPrimaryMonitorSize(); + return gfx::Screen::GetPrimaryMonitor().size(); } int MetricsLog::GetScreenCount() const { diff --git a/chrome/browser/notifications/balloon_collection_impl.cc b/chrome/browser/notifications/balloon_collection_impl.cc index 01780c0..565aba4 100644 --- a/chrome/browser/notifications/balloon_collection_impl.cc +++ b/chrome/browser/notifications/balloon_collection_impl.cc @@ -486,7 +486,7 @@ bool BalloonCollectionImpl::Layout::RefreshSystemMetrics() { #if defined(OS_MACOSX) gfx::Rect new_work_area = GetMacWorkArea(); #else - gfx::Rect new_work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + gfx::Rect new_work_area = gfx::Screen::GetPrimaryMonitor().work_area(); #endif if (!work_area_.Equals(new_work_area)) { work_area_.SetRect(new_work_area.x(), new_work_area.y(), diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 6782e27..c30674c 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -2095,7 +2095,7 @@ void BrowserWindowGtk::SaveWindowPosition() { window_preferences->SetBoolean("maximized", IsMaximized()); gfx::Rect work_area( - gfx::Screen::GetMonitorWorkAreaMatching(restored_bounds_)); + gfx::Screen::GetMonitorMatching(restored_bounds_).work_area()); window_preferences->SetInteger("work_area_left", work_area.x()); window_preferences->SetInteger("work_area_top", work_area.y()); window_preferences->SetInteger("work_area_right", work_area.right()); diff --git a/chrome/browser/ui/panels/display_settings_provider.cc b/chrome/browser/ui/panels/display_settings_provider.cc index b2fed3f..61f7709 100644 --- a/chrome/browser/ui/panels/display_settings_provider.cc +++ b/chrome/browser/ui/panels/display_settings_provider.cc @@ -72,9 +72,9 @@ gfx::Rect DisplaySettingsProvider::GetWorkArea() const { #if defined(OS_MACOSX) // On OSX, panels should be dropped all the way to the bottom edge of the // screen (and overlap Dock). - gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorBounds(); + gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().bounds(); #else - gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area(); #endif return work_area; } diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc index 9306b53..137eb15 100644 --- a/chrome/browser/ui/panels/panel_browsertest.cc +++ b/chrome/browser/ui/panels/panel_browsertest.cc @@ -1634,7 +1634,7 @@ class PanelAndNotificationTest : public PanelBrowserTest { // The position returned by the notification balloon is based on Mac's // vertically inverted orientation. We need to flip it so that it can // be compared against the position returned by the panel. - gfx::Size screen_size = gfx::Screen::GetPrimaryMonitorSize(); + gfx::Size screen_size = gfx::Screen::GetPrimaryMonitor().size(); return screen_size.height() - balloon->GetPosition().y(); #else return balloon->GetPosition().y() + balloon->GetViewSize().height(); diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index 1a1cbcf..bbeed83 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -69,7 +69,7 @@ class PDFBrowserTest : public InProcessBrowserTest, // to a smaller window and then expanding leads to slight anti-aliasing // differences of the text and the pixel comparison fails. gfx::Rect bounds(gfx::Rect(0, 0, kBrowserWidth, kBrowserHeight)); - gfx::Rect screen_bounds = gfx::Screen::GetPrimaryMonitorBounds(); + gfx::Rect screen_bounds = gfx::Screen::GetPrimaryMonitor().bounds(); ASSERT_GT(screen_bounds.width(), kBrowserWidth); ASSERT_GT(screen_bounds.height(), kBrowserHeight); browser()->window()->SetBounds(bounds); diff --git a/chrome/browser/ui/tabs/dock_info_win.cc b/chrome/browser/ui/tabs/dock_info_win.cc index d243842..5afa6f6 100644 --- a/chrome/browser/ui/tabs/dock_info_win.cc +++ b/chrome/browser/ui/tabs/dock_info_win.cc @@ -242,8 +242,8 @@ class DockToWindowFinder : public BaseWindowFinder { const std::set<HWND>& ignore) : BaseWindowFinder(ignore), screen_loc_(screen_loc) { - gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint( - screen_loc); + gfx::Rect work_area = gfx::Screen::GetMonitorNearestPoint( + screen_loc).bounds(); if (!work_area.IsEmpty()) { result_.set_monitor_bounds(work_area); EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, as_lparam()); diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc index 9b01b46..981db9b 100644 --- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc +++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc @@ -31,6 +31,7 @@ #include "ui/aura/single_monitor_manager.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_stacking_client.h" +#include "ui/gfx/screen.h" #endif #if defined(TOOLKIT_VIEWS) @@ -138,7 +139,7 @@ class AccessibilityEventRouterViewsTest aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager); root_window_.reset( aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); -#if defined(USE_ASH) +#if defined(USE_AURA) gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); #endif // USE_ASH test_stacking_client_.reset( diff --git a/chrome/browser/ui/views/ash/window_positioner.cc b/chrome/browser/ui/views/ash/window_positioner.cc index 2780060..46d4c2b 100644 --- a/chrome/browser/ui/views/ash/window_positioner.cc +++ b/chrome/browser/ui/views/ash/window_positioner.cc @@ -48,8 +48,8 @@ gfx::Rect WindowPositioner::GetPopupPosition(const gfx::Rect& old_pos) { // work area. aura::Window* window = ash::wm::GetActiveWindow(); const gfx::Rect work_area = window && window->IsVisible() ? - gfx::Screen::GetMonitorWorkAreaNearestWindow(window) : - gfx::Screen::GetPrimaryMonitorWorkArea(); + gfx::Screen::GetMonitorNearestWindow(window).work_area() : + gfx::Screen::GetPrimaryMonitor().work_area(); // Only try to reposition the popup when it is not spanning the entire // screen. if ((old_pos.width() + popup_position_offset_from_screen_corner_x >= diff --git a/chrome/browser/ui/views/ash/window_positioner_unittest.cc b/chrome/browser/ui/views/ash/window_positioner_unittest.cc index 3e1b18c..f877069 100644 --- a/chrome/browser/ui/views/ash/window_positioner_unittest.cc +++ b/chrome/browser/ui/views/ash/window_positioner_unittest.cc @@ -194,7 +194,7 @@ void WindowPositionerTest::TearDown() { } // namespace TEST_F(WindowPositionerTest, cascading) { - const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area(); // First see that the window will cascade down when there is no space. window()->SetBounds(work_area); @@ -254,7 +254,7 @@ TEST_F(WindowPositionerTest, cascading) { } TEST_F(WindowPositionerTest, filling) { - const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area(); int grid = ash::Shell::GetInstance()->GetGridSize(); gfx::Rect popup_position(0, 0, 256, 128); // Leave space on the left and the right and see if we fill top to bottom. @@ -309,7 +309,7 @@ TEST_F(WindowPositionerTest, filling) { } TEST_F(WindowPositionerTest, blockedByPanel) { - const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area(); gfx::Rect pop_position(0, 0, 200, 200); // Let the panel cover everything. @@ -324,7 +324,7 @@ TEST_F(WindowPositionerTest, blockedByPanel) { } TEST_F(WindowPositionerTest, biggerThenBorder) { - const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); + const gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area(); gfx::Rect pop_position(0, 0, work_area.width(), work_area.height()); diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index 8813ef0..51c573e 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc @@ -74,8 +74,8 @@ void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, window_preferences->SetInteger("bottom", bounds.bottom()); window_preferences->SetBoolean("maximized", show_state == ui::SHOW_STATE_MAXIMIZED); - - gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaMatching(bounds)); + gfx::Rect work_area( + gfx::Screen::GetMonitorMatching(bounds).work_area()); window_preferences->SetInteger("work_area_left", work_area.x()); window_preferences->SetInteger("work_area_top", work_area.y()); window_preferences->SetInteger("work_area_right", work_area.right()); diff --git a/chrome/browser/ui/views/extensions/extension_dialog.cc b/chrome/browser/ui/views/extensions/extension_dialog.cc index 7985dbb..94cea11 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog.cc @@ -134,7 +134,7 @@ ExtensionHost* ExtensionDialog::CreateExtensionHost(const GURL& url, void ExtensionDialog::InitWindowFullscreen() { aura::RootWindow* root_window = ash::Shell::GetRootWindow(); gfx::Rect screen_rect = - gfx::Screen::GetMonitorAreaNearestWindow(root_window); + gfx::Screen::GetMonitorNearestWindow(root_window).bounds(); // We want to be the fullscreen topmost child of the root window. window_ = browser::CreateFramelessViewsWindow(root_window, this); diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index ee91a9e..3f232fd 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1321,7 +1321,7 @@ gfx::Rect BrowserView::GetInstantBounds() { WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( const gfx::Rect& bounds) { #if defined(USE_AURA) - gfx::Size window_size = gfx::Screen::GetMonitorAreaNearestWindow( + gfx::Size window_size = gfx::Screen::GetMonitorNearestWindow( GetWidget()->GetNativeView()).size(); return browser::DispositionForPopupBounds( bounds, window_size.width(), window_size.height()); diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc b/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc index 7263f8f..75c2fe0 100644 --- a/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc +++ b/chrome/browser/ui/views/fullscreen_exit_bubble_views.cc @@ -340,8 +340,8 @@ gfx::Rect FullscreenExitBubbleViews::GetPopupRect( gfx::Size size(view_->GetPreferredSize()); // NOTE: don't use the bounds of the root_view_. On linux changing window // size is async. Instead we use the size of the screen. - gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow( - root_view_->GetWidget()->GetNativeView()); + gfx::Rect screen_bounds = gfx::Screen::GetMonitorNearestWindow( + root_view_->GetWidget()->GetNativeView()).bounds(); gfx::Point origin(screen_bounds.x() + (screen_bounds.width() - size.width()) / 2, kPopupTopPx + screen_bounds.y()); diff --git a/chrome/browser/ui/views/keyboard_overlay_delegate.cc b/chrome/browser/ui/views/keyboard_overlay_delegate.cc index e40749e..e2fac02 100644 --- a/chrome/browser/ui/views/keyboard_overlay_delegate.cc +++ b/chrome/browser/ui/views/keyboard_overlay_delegate.cc @@ -57,8 +57,8 @@ void KeyboardOverlayDelegate::GetDialogSize( gfx::Size* size) const { using std::min; DCHECK(view_); - gfx::Rect rect = gfx::Screen::GetMonitorAreaNearestWindow( - view_->GetWidget()->GetNativeView()); + gfx::Rect rect = gfx::Screen::GetMonitorNearestWindow( + view_->GetWidget()->GetNativeView()).bounds(); const int width = min(kBaseWidth, rect.width() - kHorizontalMargin); const int height = width * kBaseHeight / kBaseWidth; size->SetSize(width, height); diff --git a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc index b1f9103..1328fad 100644 --- a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc +++ b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc @@ -97,8 +97,8 @@ void KeyboardOverlayDialogView::ShowDialog( // Show the widget at the bottom of the work area. gfx::Size size; delegate->GetDialogSize(&size); - gfx::Rect rect = gfx::Screen::GetMonitorWorkAreaNearestWindow( - html_view->GetWidget()->GetNativeView()); + gfx::Rect rect = gfx::Screen::GetMonitorNearestWindow( + html_view->GetWidget()->GetNativeView()).work_area(); gfx::Rect bounds((rect.width() - size.width()) / 2, rect.height() - size.height(), size.width(), diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index 7f36dea..8648f11 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -768,7 +768,7 @@ void StatusBubbleViews::AvoidMouse(const gfx::Point& location) { // download shelf. gfx::NativeView widget = base_view_->GetWidget()->GetNativeView(); gfx::Rect monitor_rect = - gfx::Screen::GetMonitorWorkAreaNearestWindow(widget); + gfx::Screen::GetMonitorNearestWindow(widget).work_area(); const int bubble_bottom_y = top_left.y() + position_.y() + size_.height(); if (bubble_bottom_y + offset > monitor_rect.height() || diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc index 4681c9f..9ee3bb7 100644 --- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc @@ -564,8 +564,8 @@ gfx::Point DefaultTabDragController::GetWindowCreatePoint() const { } // If the cursor is outside the monitor area, move it inside. For example, // dropping a tab onto the task bar on Windows produces this situation. - gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint( - cursor_point); + gfx::Rect work_area = gfx::Screen::GetMonitorNearestPoint( + cursor_point).work_area(); if (!work_area.IsEmpty()) { if (cursor_point.x() < work_area.x()) cursor_point.set_x(work_area.x()); diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc index a664f83..05bb2d2 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc @@ -502,8 +502,8 @@ gfx::Point TabDragController2::GetWindowCreatePoint() const { } // If the cursor is outside the monitor area, move it inside. For example, // dropping a tab onto the task bar on Windows produces this situation. - gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint( - cursor_point); + gfx::Rect work_area = gfx::Screen::GetMonitorNearestPoint( + cursor_point).work_area(); if (!work_area.IsEmpty()) { if (cursor_point.x() < work_area.x()) cursor_point.set_x(work_area.x()); diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc index 1daa5a6..3e0390a 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc @@ -130,8 +130,8 @@ class TabDragController2Test : public InProcessBrowserTest { ResetIDs(browser2->tabstrip_model(), 100); // Resize the two windows so they're right next to each other. - gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow( - browser()->window()->GetNativeHandle()); + gfx::Rect work_area = gfx::Screen::GetMonitorNearestWindow( + browser()->window()->GetNativeHandle()).work_area(); gfx::Size half_size = gfx::Size(work_area.width() / 3 - 10, work_area.height() / 2 - 10); browser()->window()->SetBounds(gfx::Rect(work_area.origin(), half_size)); diff --git a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc index 4d125be..abb69ea 100644 --- a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc +++ b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc @@ -56,7 +56,7 @@ const char kOnTextInputTypeChanged[] = // The default position of the keyboard widget should be at the bottom, // spanning the entire width of the root window. gfx::Rect GetKeyboardPosition(int height) { - gfx::Rect area = gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()); + gfx::Rect area = gfx::Screen::GetPrimaryMonitor().bounds(); return gfx::Rect(area.x(), area.y() + area.height() - height, area.width(), height); } diff --git a/chrome/browser/ui/window_sizer.cc b/chrome/browser/ui/window_sizer.cc index 5c2da7f..0dffea6 100644 --- a/chrome/browser/ui/window_sizer.cc +++ b/chrome/browser/ui/window_sizer.cc @@ -23,14 +23,14 @@ class DefaultMonitorInfoProvider : public MonitorInfoProvider { public: // Overridden from MonitorInfoProvider: virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE { - return gfx::Screen::GetPrimaryMonitorWorkArea(); + return gfx::Screen::GetPrimaryMonitor().work_area(); } virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE { - return gfx::Screen::GetPrimaryMonitorBounds(); + return gfx::Screen::GetPrimaryMonitor().bounds(); } virtual gfx::Rect GetMonitorWorkAreaMatching( const gfx::Rect& match_rect) const OVERRIDE { - return gfx::Screen::GetMonitorWorkAreaMatching(match_rect); + return gfx::Screen::GetMonitorMatching(match_rect).work_area(); } }; diff --git a/chrome/browser/ui/window_sizer_gtk.cc b/chrome/browser/ui/window_sizer_gtk.cc index 133fb0c..0b0a5a0 100644 --- a/chrome/browser/ui/window_sizer_gtk.cc +++ b/chrome/browser/ui/window_sizer_gtk.cc @@ -20,7 +20,7 @@ const int WindowSizer::kWindowTilePixels = 10; // static gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size) { - gfx::Rect monitor_bounds = gfx::Screen::GetPrimaryMonitorWorkArea(); + gfx::Rect monitor_bounds = gfx::Screen::GetPrimaryMonitor().work_area(); gfx::Point corner(monitor_bounds.x(), monitor_bounds.y()); if (Browser* browser = BrowserList::GetLastActive()) { GtkWindow* window = |