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

Unified Diff: chrome/browser/ui/browser_window_state.cc

Issue 11072002: Combined window positioning and show state determiniation in the WindowSizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_window_state.cc
diff --git a/chrome/browser/ui/browser_window_state.cc b/chrome/browser/ui/browser_window_state.cc
index 9c0d48c9e74e2578da49b09171019a91a45b5633..43fd2a5c2c79d1d6465f8ebdf3b0f294e9412b3a 100644
--- a/chrome/browser/ui/browser_window_state.cc
+++ b/chrome/browser/ui/browser_window_state.cc
@@ -80,12 +80,14 @@ void SaveWindowPlacement(const Browser* browser,
session_service->SetWindowBounds(browser->session_id(), bounds, show_state);
}
-gfx::Rect GetSavedWindowBounds(const Browser* browser) {
+gfx::Rect GetSavedWindowBoundsAndShowState(const Browser* browser,
+ ui::WindowShowState& show_state) {
gfx::Rect restored_bounds = browser->override_bounds();
- WindowSizer::GetBrowserWindowBounds(browser->app_name(),
- restored_bounds,
- browser,
- &restored_bounds);
+ WindowSizer::GetBrowserWindowBoundsAndShowState(browser->app_name(),
+ restored_bounds,
+ browser,
+ &restored_bounds,
+ show_state);
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
bool record_mode = parsed_command_line.HasSwitch(switches::kRecordMode);
@@ -118,31 +120,4 @@ gfx::Rect GetSavedWindowBounds(const Browser* browser) {
return restored_bounds;
}
-ui::WindowShowState GetSavedWindowShowState(const Browser* browser) {
- // Only tabbed browsers use the command line or preference state, with the
- // exception of devtools.
- bool show_state = !browser->is_type_tabbed() && !browser->is_devtools();
-
-#if defined(USE_AURA)
- // Apps save state on aura.
- show_state &= !browser->is_app();
-#endif
-
- if (show_state)
- return browser->initial_show_state();
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized))
- return ui::SHOW_STATE_MAXIMIZED;
-
- if (browser->initial_show_state() != ui::SHOW_STATE_DEFAULT)
- return browser->initial_show_state();
-
- const DictionaryValue* window_pref = browser->profile()->GetPrefs()->
- GetDictionary(GetWindowPlacementKey(browser).c_str());
- bool maximized = false;
- window_pref->GetBoolean("maximized", &maximized);
-
- return maximized ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_DEFAULT;
-}
-
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698