Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/ui/panels/display_settings_provider.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/panels/display_settings_provider.h" 5 #include "chrome/browser/ui/panels/display_settings_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/fullscreen.h" 8 #include "chrome/browser/fullscreen.h"
9 #include "ui/gfx/screen.h" 9 #include "ui/gfx/screen.h"
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (adjusted_work_area_.IsEmpty()) 65 if (adjusted_work_area_.IsEmpty())
66 OnDisplaySettingsChanged(); 66 OnDisplaySettingsChanged();
67 67
68 return adjusted_work_area_; 68 return adjusted_work_area_;
69 } 69 }
70 70
71 gfx::Rect DisplaySettingsProvider::GetWorkArea() const { 71 gfx::Rect DisplaySettingsProvider::GetWorkArea() const {
72 #if defined(OS_MACOSX) 72 #if defined(OS_MACOSX)
73 // On OSX, panels should be dropped all the way to the bottom edge of the 73 // On OSX, panels should be dropped all the way to the bottom edge of the
74 // screen (and overlap Dock). 74 // screen (and overlap Dock).
75 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorBounds(); 75 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().bounds();
76 #else 76 #else
77 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); 77 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor().work_area();
78 #endif 78 #endif
79 return work_area; 79 return work_area;
80 } 80 }
81 81
82 void DisplaySettingsProvider::OnDisplaySettingsChanged() { 82 void DisplaySettingsProvider::OnDisplaySettingsChanged() {
83 gfx::Rect work_area = GetWorkArea(); 83 gfx::Rect work_area = GetWorkArea();
84 if (work_area == work_area_) 84 if (work_area == work_area_)
85 return; 85 return;
86 work_area_ = work_area; 86 work_area_ = work_area;
87 87
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 full_screen_observers_, 145 full_screen_observers_,
146 OnFullScreenModeChanged(is_full_screen_)); 146 OnFullScreenModeChanged(is_full_screen_));
147 } 147 }
148 148
149 #if defined(USE_AURA) 149 #if defined(USE_AURA)
150 // static 150 // static
151 DisplaySettingsProvider* DisplaySettingsProvider::Create() { 151 DisplaySettingsProvider* DisplaySettingsProvider::Create() {
152 return new DisplaySettingsProvider(); 152 return new DisplaySettingsProvider();
153 } 153 }
154 #endif 154 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698