| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 gfx::Rect* bounds, | 234 gfx::Rect* bounds, |
| 235 ui::WindowShowState* show_state) const { | 235 ui::WindowShowState* show_state) const { |
| 236 DCHECK(bounds); | 236 DCHECK(bounds); |
| 237 DCHECK(show_state); | 237 DCHECK(show_state); |
| 238 // Pre-populate the window state with our default. | 238 // Pre-populate the window state with our default. |
| 239 *show_state = GetWindowDefaultShowState(); | 239 *show_state = GetWindowDefaultShowState(); |
| 240 *bounds = specified_bounds; | 240 *bounds = specified_bounds; |
| 241 | 241 |
| 242 #if defined(USE_ASH) | 242 #if defined(USE_ASH) |
| 243 // See if ash should decide the window placement. | 243 // See if ash should decide the window placement. |
| 244 if (GetBrowserBoundsAsh(bounds, show_state)) | 244 if (GetBrowserBoundsAshAdjusted(bounds, show_state)) |
| 245 return; | 245 return; |
| 246 #endif | 246 #endif |
| 247 | 247 |
| 248 if (bounds->IsEmpty()) { | 248 if (bounds->IsEmpty()) { |
| 249 // See if there's last active window's placement information. | 249 // See if there's last active window's placement information. |
| 250 if (GetLastActiveWindowBounds(bounds, show_state)) | 250 if (GetLastActiveWindowBounds(bounds, show_state)) |
| 251 return; | 251 return; |
| 252 // See if there's saved placement information. | 252 // See if there's saved placement information. |
| 253 if (GetSavedWindowBounds(bounds, show_state)) | 253 if (GetSavedWindowBounds(bounds, show_state)) |
| 254 return; | 254 return; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) | 436 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) |
| 437 return ui::SHOW_STATE_MAXIMIZED; | 437 return ui::SHOW_STATE_MAXIMIZED; |
| 438 | 438 |
| 439 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 439 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
| 440 return browser_->initial_show_state(); | 440 return browser_->initial_show_state(); |
| 441 | 441 |
| 442 // Otherwise we use the default which can be overridden later on. | 442 // Otherwise we use the default which can be overridden later on. |
| 443 return ui::SHOW_STATE_DEFAULT; | 443 return ui::SHOW_STATE_DEFAULT; |
| 444 } | 444 } |
| OLD | NEW |