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

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: 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/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 #endif // defined(OS_MACOSX) 308 #endif // defined(OS_MACOSX)
308 } 309 }
309 310
310 #if !defined(USE_ASH) 311 #if !defined(USE_ASH)
311 bool WindowSizer::GetBoundsIgnoringPreviousState( 312 bool WindowSizer::GetBoundsIgnoringPreviousState(
312 const gfx::Rect& specified_bounds, 313 const gfx::Rect& specified_bounds,
313 gfx::Rect* bounds) const { 314 gfx::Rect* bounds) const {
314 return false; 315 return false;
315 } 316 }
316 #endif 317 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698