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

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: DeviceScaleFactor 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 "ui/gfx/monitor.h"
8 #include "ui/gfx/screen.h" 9 #include "ui/gfx/screen.h"
9 10
10 DisplaySettingsProvider::DisplaySettingsProvider(Observer* observer) 11 DisplaySettingsProvider::DisplaySettingsProvider(Observer* observer)
11 : observer_(observer) { 12 : observer_(observer) {
12 DCHECK(observer); 13 DCHECK(observer);
13 } 14 }
14 15
15 DisplaySettingsProvider::~DisplaySettingsProvider() { 16 DisplaySettingsProvider::~DisplaySettingsProvider() {
16 } 17 }
17 18
18 gfx::Rect DisplaySettingsProvider::GetWorkArea() { 19 gfx::Rect DisplaySettingsProvider::GetWorkArea() {
19 #if defined(OS_MACOSX) 20 #if defined(OS_MACOSX)
20 // On OSX, panels should be dropped all the way to the bottom edge of the 21 // On OSX, panels should be dropped all the way to the bottom edge of the
21 // screen (and overlap Dock). 22 // screen (and overlap Dock).
22 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorBounds(); 23 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor()->GetBounds();
23 #else 24 #else
24 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); 25 gfx::Rect work_area = gfx::Screen::GetPrimaryMonitor()->GetWorkArea();
25 #endif 26 #endif
26 27
27 if (work_area_ != work_area) { 28 if (work_area_ != work_area) {
28 work_area_ = work_area; 29 work_area_ = work_area;
29 OnWorkAreaChanged(); 30 OnWorkAreaChanged();
30 } 31 }
31 32
32 return work_area; 33 return work_area;
33 } 34 }
34 35
(...skipping 15 matching lines...) Expand all
50 DesktopBarAlignment alignment) const { 51 DesktopBarAlignment alignment) const {
51 return DESKTOP_BAR_VISIBLE; 52 return DESKTOP_BAR_VISIBLE;
52 } 53 }
53 54
54 #if !defined(OS_WIN) || defined(USE_AURA) 55 #if !defined(OS_WIN) || defined(USE_AURA)
55 // static 56 // static
56 DisplaySettingsProvider* DisplaySettingsProvider::Create(Observer* observer) { 57 DisplaySettingsProvider* DisplaySettingsProvider::Create(Observer* observer) {
57 return new DisplaySettingsProvider(observer); 58 return new DisplaySettingsProvider(observer);
58 } 59 }
59 #endif 60 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698