| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 DCHECK(show_state); | 103 DCHECK(show_state); |
| 104 // Applications are always restored with the same position. | 104 // Applications are always restored with the same position. |
| 105 if (!app_name_.empty()) | 105 if (!app_name_.empty()) |
| 106 return false; | 106 return false; |
| 107 | 107 |
| 108 // If a reference browser is set, use its window. Otherwise find last | 108 // If a reference browser is set, use its window. Otherwise find last |
| 109 // active. Panels are never used as reference browsers as panels are | 109 // active. Panels are never used as reference browsers as panels are |
| 110 // specially positioned. | 110 // specially positioned. |
| 111 BrowserWindow* window = NULL; | 111 BrowserWindow* window = NULL; |
| 112 // Window may be null if browser is just starting up. | 112 // Window may be null if browser is just starting up. |
| 113 if (browser_ && browser_->window() && !browser_->window()->IsPanel()) { | 113 if (browser_ && browser_->window()) { |
| 114 window = browser_->window(); | 114 window = browser_->window(); |
| 115 } else { | 115 } else { |
| 116 // This code is only ran on the native desktop (on the ash desktop, | 116 // This code is only ran on the native desktop (on the ash desktop, |
| 117 // GetBoundsOverrideAsh should take over below before this is reached). | 117 // GetBoundsOverrideAsh should take over below before this is reached). |
| 118 // TODO(gab): This code should go in a native desktop specific window | 118 // TODO(gab): This code should go in a native desktop specific window |
| 119 // sizer as part of fixing crbug.com/175812. | 119 // sizer as part of fixing crbug.com/175812. |
| 120 const BrowserList* native_browser_list = | 120 const BrowserList* native_browser_list = |
| 121 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); | 121 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 122 for (BrowserList::const_reverse_iterator it = | 122 for (BrowserList::const_reverse_iterator it = |
| 123 native_browser_list->begin_last_active(); | 123 native_browser_list->begin_last_active(); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) | 400 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) |
| 401 return ui::SHOW_STATE_MAXIMIZED; | 401 return ui::SHOW_STATE_MAXIMIZED; |
| 402 | 402 |
| 403 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 403 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
| 404 return browser_->initial_show_state(); | 404 return browser_->initial_show_state(); |
| 405 | 405 |
| 406 // Otherwise we use the default which can be overridden later on. | 406 // Otherwise we use the default which can be overridden later on. |
| 407 return ui::SHOW_STATE_DEFAULT; | 407 return ui::SHOW_STATE_DEFAULT; |
| 408 } | 408 } |
| OLD | NEW |