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

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

Issue 7748036: Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
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(
« 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