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

Side by Side Diff: chrome/browser/ui/window_sizer.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: fix command line 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/window_sizer.h" 5 #include "chrome/browser/ui/window_sizer.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_list.h" 12 #include "chrome/browser/ui/browser_list.h"
13 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "ui/gfx/monitor.h"
15 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
16 17
17 // Minimum height of the visible part of a window. 18 // Minimum height of the visible part of a window.
18 const int kMinVisibleHeight = 30; 19 const int kMinVisibleHeight = 30;
19 // Minimum width of the visible part of a window. 20 // Minimum width of the visible part of a window.
20 const int kMinVisibleWidth = 30; 21 const int kMinVisibleWidth = 30;
21 22
22 class DefaultMonitorInfoProvider : public MonitorInfoProvider { 23 class DefaultMonitorInfoProvider : public MonitorInfoProvider {
23 public: 24 public:
24 // Overridden from MonitorInfoProvider: 25 // Overridden from MonitorInfoProvider:
25 virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE { 26 virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE {
26 return gfx::Screen::GetPrimaryMonitorWorkArea(); 27 return gfx::Screen::GetPrimaryMonitor()->GetWorkArea();
27 } 28 }
28 virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE { 29 virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE {
29 return gfx::Screen::GetPrimaryMonitorBounds(); 30 return gfx::Screen::GetPrimaryMonitor()->GetBounds();
30 } 31 }
31 virtual gfx::Rect GetMonitorWorkAreaMatching( 32 virtual gfx::Rect GetMonitorWorkAreaMatching(
32 const gfx::Rect& match_rect) const OVERRIDE { 33 const gfx::Rect& match_rect) const OVERRIDE {
33 return gfx::Screen::GetMonitorWorkAreaMatching(match_rect); 34 return gfx::Screen::GetMonitorMatching(match_rect)->GetBounds();
34 } 35 }
35 }; 36 };
36 37
37 /////////////////////////////////////////////////////////////////////////////// 38 ///////////////////////////////////////////////////////////////////////////////
38 // An implementation of WindowSizer::StateProvider that gets the last active 39 // An implementation of WindowSizer::StateProvider that gets the last active
39 // and persistent state from the browser window and the user's profile. 40 // and persistent state from the browser window and the user's profile.
40 class DefaultStateProvider : public WindowSizer::StateProvider { 41 class DefaultStateProvider : public WindowSizer::StateProvider {
41 public: 42 public:
42 DefaultStateProvider(const std::string& app_name, const Browser* browser) 43 DefaultStateProvider(const std::string& app_name, const Browser* browser)
43 : app_name_(app_name), browser_(browser) { 44 : app_name_(app_name), browser_(browser) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 #endif // defined(OS_MACOSX) 304 #endif // defined(OS_MACOSX)
304 } 305 }
305 306
306 #if !defined(USE_ASH) 307 #if !defined(USE_ASH)
307 bool WindowSizer::GetBoundsIgnoringPreviousState( 308 bool WindowSizer::GetBoundsIgnoringPreviousState(
308 const gfx::Rect& specified_bounds, 309 const gfx::Rect& specified_bounds,
309 gfx::Rect* bounds) const { 310 gfx::Rect* bounds) const {
310 return false; 311 return false;
311 } 312 }
312 #endif 313 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698