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

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

Issue 8573026: Simplify how we obtain the maximized state without having to go through WindowSizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ea1fec702a7ee7a54544f99aac6fff97ffe28d58..a03ec4df622569aadf69db67b449391e5d0f4afe 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -908,8 +908,6 @@ gfx::Rect Browser::GetSavedWindowBounds() const {
return restored_bounds;
}
-// TODO(beng): obtain maximized state some other way so we don't need to go
-// through all this hassle.
ui::WindowShowState Browser::GetSavedWindowShowState() const {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized))
return ui::SHOW_STATE_MAXIMIZED;
@@ -917,11 +915,11 @@ ui::WindowShowState Browser::GetSavedWindowShowState() const {
if (show_state_ != ui::SHOW_STATE_DEFAULT)
return show_state_;
- // An explicit maximized state was not set. Query the window sizer.
- gfx::Rect restored_bounds;
+ const DictionaryValue* window_pref =
+ profile()->GetPrefs()->GetDictionary(GetWindowPlacementKey().c_str());
bool maximized = false;
- WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
- &restored_bounds, &maximized);
+ window_pref->GetBoolean("maximized", &maximized);
+
return maximized ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698