Index: chrome/browser/ui/views/chrome_views_delegate.cc |
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc |
index a471e6f06e4cdacd996f65c2b3f529b8bc624013..a6b7eef88c2165a93c00ccdb78d6f954df91a1ea 100644 |
--- a/chrome/browser/ui/views/chrome_views_delegate.cc |
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc |
@@ -61,7 +61,7 @@ views::View* ChromeViewsDelegate::GetDefaultParentView() { |
void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, |
const std::wstring& window_name, |
const gfx::Rect& bounds, |
- bool maximized) { |
+ ui::WindowShowState show_state) { |
PrefService* prefs = GetPrefsForWindow(window); |
if (!prefs) |
return; |
@@ -73,7 +73,8 @@ void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, |
window_preferences->SetInteger("top", bounds.y()); |
window_preferences->SetInteger("right", bounds.right()); |
window_preferences->SetInteger("bottom", bounds.bottom()); |
- window_preferences->SetBoolean("maximized", maximized); |
+ window_preferences->SetBoolean("maximized", |
+ show_state == ui::SHOW_STATE_MAXIMIZED); |
scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_info_provider( |
WindowSizer::CreateDefaultMonitorInfoProvider()); |
@@ -85,8 +86,10 @@ void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, |
window_preferences->SetInteger("work_area_bottom", work_area.bottom()); |
} |
-bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name, |
- gfx::Rect* bounds) const { |
+bool ChromeViewsDelegate::GetSavedWindowPlacement( |
+ const std::wstring& window_name, |
+ gfx::Rect* bounds, |
+ ui::WindowShowState* show_state) const { |
PrefService* prefs = g_browser_process->local_state(); |
if (!prefs) |
return false; |
@@ -102,22 +105,13 @@ bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name, |
return false; |
bounds->SetRect(left, top, right - left, bottom - top); |
- return true; |
-} |
- |
-bool ChromeViewsDelegate::GetSavedMaximizedState( |
- const std::wstring& window_name, |
- bool* maximized) const { |
- PrefService* prefs = g_browser_process->local_state(); |
- if (!prefs) |
- return false; |
- DCHECK(prefs->FindPreference(WideToUTF8(window_name).c_str())); |
- const DictionaryValue* dictionary = |
- prefs->GetDictionary(WideToUTF8(window_name).c_str()); |
+ bool maximized = false; |
+ if (dictionary) |
+ dictionary->GetBoolean("maximized", &maximized); |
+ *show_state = maximized ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL; |
- return dictionary && dictionary->GetBoolean("maximized", maximized) && |
- maximized; |
+ return true; |
} |
void ChromeViewsDelegate::NotifyAccessibilityEvent( |