diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 19:51:17 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 19:51:17 +0000 |
commit | ffabb1ea75e662308da91e916a0ffc922525aa18 (patch) | |
tree | 788b1ac84169a936b02d10feda6c94efaee129ea /chrome/browser/ui/panels/display_settings_provider.cc | |
parent | c856e976800426511cd1a0f74d38c1fa7c883018 (diff) | |
download | chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.zip chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.tar.gz chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.tar.bz2 |
Makes gfx::Screen an instance, rather than a collection of static methods.
This is in support of supporting separate Screen implementations on Aura for desktop and metro on Windows.
Some callsites are not yet correct, and noted with a reference to the http://crbug.com/133312. As-is those sites will behave the same as before this patch, but may not be correct once desktop/metro can run simultaneously.
BUG=133312
Review URL: https://chromiumcodereview.appspot.com/11030017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/panels/display_settings_provider.cc')
-rw-r--r-- | chrome/browser/ui/panels/display_settings_provider.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/ui/panels/display_settings_provider.cc b/chrome/browser/ui/panels/display_settings_provider.cc index d27ed9d..b086880 100644 --- a/chrome/browser/ui/panels/display_settings_provider.cc +++ b/chrome/browser/ui/panels/display_settings_provider.cc @@ -68,8 +68,10 @@ gfx::Rect DisplaySettingsProvider::GetDisplayArea() { return adjusted_work_area_; } +// TODO(scottmg): This should be moved to ui/. gfx::Rect DisplaySettingsProvider::GetPrimaryScreenArea() const { - return gfx::Screen::GetPrimaryDisplay().bounds(); + // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 + return gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds(); } gfx::Rect DisplaySettingsProvider::GetWorkArea() const { @@ -78,7 +80,8 @@ gfx::Rect DisplaySettingsProvider::GetWorkArea() const { // screen (and overlap Dock). And we also want to exclude the system menu // area. Note that the rect returned from gfx::Screen util functions is in // platform-independent screen coordinates with (0, 0) as the top-left corner. - gfx::Display display = gfx::Screen::GetPrimaryDisplay(); + // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 + gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); gfx::Rect display_area = display.bounds(); gfx::Rect work_area = display.work_area(); int system_menu_height = work_area.y() - display_area.y(); @@ -88,9 +91,11 @@ gfx::Rect DisplaySettingsProvider::GetWorkArea() const { } return display_area; #else - gfx::Rect work_area = gfx::Screen::GetPrimaryDisplay().work_area(); -#endif + // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 + gfx::Rect work_area = + gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); return work_area; +#endif } void DisplaySettingsProvider::OnDisplaySettingsChanged() { |