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

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/screen.h" 15 #include "ui/gfx/screen.h"
16 16
17 // Minimum height of the visible part of a window. 17 // Minimum height of the visible part of a window.
18 const int kMinVisibleHeight = 30; 18 const int kMinVisibleHeight = 30;
19 // Minimum width of the visible part of a window. 19 // Minimum width of the visible part of a window.
20 const int kMinVisibleWidth = 30; 20 const int kMinVisibleWidth = 30;
21 21
22 class DefaultMonitorInfoProvider : public MonitorInfoProvider { 22 class DefaultMonitorInfoProvider : public MonitorInfoProvider {
23 public: 23 public:
24 // Overridden from MonitorInfoProvider: 24 // Overridden from MonitorInfoProvider:
25 virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE { 25 virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE {
26 return gfx::Screen::GetPrimaryMonitorWorkArea(); 26 return gfx::Screen::GetPrimaryMonitor().work_area();
27 } 27 }
28 virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE { 28 virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE {
29 return gfx::Screen::GetPrimaryMonitorBounds(); 29 return gfx::Screen::GetPrimaryMonitor().bounds();
30 } 30 }
31 virtual gfx::Rect GetMonitorWorkAreaMatching( 31 virtual gfx::Rect GetMonitorWorkAreaMatching(
32 const gfx::Rect& match_rect) const OVERRIDE { 32 const gfx::Rect& match_rect) const OVERRIDE {
33 return gfx::Screen::GetMonitorWorkAreaMatching(match_rect); 33 return gfx::Screen::GetMonitorMatching(match_rect).work_area();
34 } 34 }
35 }; 35 };
36 36
37 /////////////////////////////////////////////////////////////////////////////// 37 ///////////////////////////////////////////////////////////////////////////////
38 // An implementation of WindowSizer::StateProvider that gets the last active 38 // An implementation of WindowSizer::StateProvider that gets the last active
39 // and persistent state from the browser window and the user's profile. 39 // and persistent state from the browser window and the user's profile.
40 class DefaultStateProvider : public WindowSizer::StateProvider { 40 class DefaultStateProvider : public WindowSizer::StateProvider {
41 public: 41 public:
42 DefaultStateProvider(const std::string& app_name, const Browser* browser) 42 DefaultStateProvider(const std::string& app_name, const Browser* browser)
43 : app_name_(app_name), browser_(browser) { 43 : app_name_(app_name), browser_(browser) {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 #endif // defined(OS_MACOSX) 318 #endif // defined(OS_MACOSX)
319 } 319 }
320 320
321 #if !defined(USE_ASH) 321 #if !defined(USE_ASH)
322 bool WindowSizer::GetBoundsIgnoringPreviousState( 322 bool WindowSizer::GetBoundsIgnoringPreviousState(
323 const gfx::Rect& specified_bounds, 323 const gfx::Rect& specified_bounds,
324 gfx::Rect* bounds) const { 324 gfx::Rect* bounds) const {
325 return false; 325 return false;
326 } 326 }
327 #endif 327 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc ('k') | chrome/browser/ui/window_sizer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698