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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 /////////////////////////////////////////////////////////////////////////////// | 191 /////////////////////////////////////////////////////////////////////////////// |
192 // WindowSizer, public: | 192 // WindowSizer, public: |
193 | 193 |
194 WindowSizer::WindowSizer( | 194 WindowSizer::WindowSizer( |
195 scoped_ptr<StateProvider> state_provider, | 195 scoped_ptr<StateProvider> state_provider, |
196 scoped_ptr<TargetDisplayProvider> target_display_provider, | 196 scoped_ptr<TargetDisplayProvider> target_display_provider, |
197 const Browser* browser) | 197 const Browser* browser) |
198 : state_provider_(std::move(state_provider)), | 198 : state_provider_(std::move(state_provider)), |
199 target_display_provider_(std::move(target_display_provider)), | 199 target_display_provider_(std::move(target_display_provider)), |
200 // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 | 200 screen_(gfx::Screen::GetScreen()), |
201 screen_(gfx::Screen::GetNativeScreen()), | |
202 browser_(browser) {} | 201 browser_(browser) {} |
203 | 202 |
204 WindowSizer::WindowSizer( | 203 WindowSizer::WindowSizer( |
205 scoped_ptr<StateProvider> state_provider, | 204 scoped_ptr<StateProvider> state_provider, |
206 scoped_ptr<TargetDisplayProvider> target_display_provider, | 205 scoped_ptr<TargetDisplayProvider> target_display_provider, |
207 gfx::Screen* screen, | 206 gfx::Screen* screen, |
208 const Browser* browser) | 207 const Browser* browser) |
209 : state_provider_(std::move(state_provider)), | 208 : state_provider_(std::move(state_provider)), |
210 target_display_provider_(std::move(target_display_provider)), | 209 target_display_provider_(std::move(target_display_provider)), |
211 screen_(screen), | 210 screen_(screen), |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 443 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
445 switches::kStartMaximized)) | 444 switches::kStartMaximized)) |
446 return ui::SHOW_STATE_MAXIMIZED; | 445 return ui::SHOW_STATE_MAXIMIZED; |
447 | 446 |
448 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 447 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
449 return browser_->initial_show_state(); | 448 return browser_->initial_show_state(); |
450 | 449 |
451 // Otherwise we use the default which can be overridden later on. | 450 // Otherwise we use the default which can be overridden later on. |
452 return ui::SHOW_STATE_DEFAULT; | 451 return ui::SHOW_STATE_DEFAULT; |
453 } | 452 } |
OLD | NEW |