OLD | NEW |
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/window_sizer.h" | 5 #include "chrome/browser/ui/window_sizer/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" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // If set, is used as the reference browser for GetLastActiveWindowState. | 121 // If set, is used as the reference browser for GetLastActiveWindowState. |
122 const Browser* browser_; | 122 const Browser* browser_; |
123 DISALLOW_COPY_AND_ASSIGN(DefaultStateProvider); | 123 DISALLOW_COPY_AND_ASSIGN(DefaultStateProvider); |
124 }; | 124 }; |
125 | 125 |
126 /////////////////////////////////////////////////////////////////////////////// | 126 /////////////////////////////////////////////////////////////////////////////// |
127 // WindowSizer, public: | 127 // WindowSizer, public: |
128 | 128 |
129 // The number of pixels which are kept free top, left and right when a window | 129 // The number of pixels which are kept free top, left and right when a window |
130 // gets positioned to its default location. | 130 // gets positioned to its default location. |
| 131 // static |
131 const int WindowSizer::kDesktopBorderSize = 16; | 132 const int WindowSizer::kDesktopBorderSize = 16; |
| 133 |
132 // Maximum width of a window even if there is more room on the desktop. | 134 // Maximum width of a window even if there is more room on the desktop. |
| 135 // static |
133 const int WindowSizer::kMaximumWindowWidth = 1100; | 136 const int WindowSizer::kMaximumWindowWidth = 1100; |
134 | 137 |
135 WindowSizer::WindowSizer(StateProvider* state_provider, const Browser* browser) | 138 WindowSizer::WindowSizer(StateProvider* state_provider, const Browser* browser) |
136 : state_provider_(state_provider), | 139 : state_provider_(state_provider), |
137 monitor_info_provider_(new DefaultMonitorInfoProvider), | 140 monitor_info_provider_(new DefaultMonitorInfoProvider), |
138 browser_(browser) { | 141 browser_(browser) { |
139 } | 142 } |
140 | 143 |
141 WindowSizer::WindowSizer(StateProvider* state_provider, | 144 WindowSizer::WindowSizer(StateProvider* state_provider, |
142 MonitorInfoProvider* monitor_info_provider, | 145 MonitorInfoProvider* monitor_info_provider, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 bool WindowSizer::GetBoundsIgnoringPreviousState( | 333 bool WindowSizer::GetBoundsIgnoringPreviousState( |
331 const gfx::Rect& specified_bounds, | 334 const gfx::Rect& specified_bounds, |
332 gfx::Rect* bounds) const { | 335 gfx::Rect* bounds) const { |
333 #if defined(USE_ASH) | 336 #if defined(USE_ASH) |
334 // TODO(beng): insufficient but currently necessary. http://crbug.com/133312 | 337 // TODO(beng): insufficient but currently necessary. http://crbug.com/133312 |
335 if (chrome::ShouldOpenAshOnStartup()) | 338 if (chrome::ShouldOpenAshOnStartup()) |
336 return GetBoundsIgnoringPreviousStateAsh(specified_bounds, bounds); | 339 return GetBoundsIgnoringPreviousStateAsh(specified_bounds, bounds); |
337 #endif | 340 #endif |
338 return false; | 341 return false; |
339 } | 342 } |
OLD | NEW |