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

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

Issue 7790010: Revert 98679 - Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.h ('k') | chrome/browser/ui/views/frame/browser_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_views_delegate.cc
===================================================================
--- chrome/browser/ui/views/chrome_views_delegate.cc (revision 98696)
+++ chrome/browser/ui/views/chrome_views_delegate.cc (working copy)
@@ -61,7 +61,7 @@
void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window,
const std::wstring& window_name,
const gfx::Rect& bounds,
- ui::WindowShowState show_state) {
+ bool maximized) {
PrefService* prefs = GetPrefsForWindow(window);
if (!prefs)
return;
@@ -73,8 +73,7 @@
window_preferences->SetInteger("top", bounds.y());
window_preferences->SetInteger("right", bounds.right());
window_preferences->SetInteger("bottom", bounds.bottom());
- window_preferences->SetBoolean("maximized",
- show_state == ui::SHOW_STATE_MAXIMIZED);
+ window_preferences->SetBoolean("maximized", maximized);
scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_info_provider(
WindowSizer::CreateDefaultMonitorInfoProvider());
@@ -86,10 +85,8 @@
window_preferences->SetInteger("work_area_bottom", work_area.bottom());
}
-bool ChromeViewsDelegate::GetSavedWindowPlacement(
- const std::wstring& window_name,
- gfx::Rect* bounds,
- ui::WindowShowState* show_state) const {
+bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name,
+ gfx::Rect* bounds) const {
PrefService* prefs = g_browser_process->local_state();
if (!prefs)
return false;
@@ -105,13 +102,22 @@
return false;
bounds->SetRect(left, top, right - left, bottom - top);
+ return true;
+}
- bool maximized = false;
- if (dictionary)
- dictionary->GetBoolean("maximized", &maximized);
- *show_state = maximized ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL;
+bool ChromeViewsDelegate::GetSavedMaximizedState(
+ const std::wstring& window_name,
+ bool* maximized) const {
+ PrefService* prefs = g_browser_process->local_state();
+ if (!prefs)
+ return false;
- return true;
+ DCHECK(prefs->FindPreference(WideToUTF8(window_name).c_str()));
+ const DictionaryValue* dictionary =
+ prefs->GetDictionary(WideToUTF8(window_name).c_str());
+
+ return dictionary && dictionary->GetBoolean("maximized", maximized) &&
+ maximized;
}
void ChromeViewsDelegate::NotifyAccessibilityEvent(
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.h ('k') | chrome/browser/ui/views/frame/browser_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698