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

Unified Diff: chrome/browser/sessions/session_restore.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/chromeos/frame/panel_browser_view.cc ('k') | chrome/browser/sessions/session_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index c4c5b2945f89d62e639b6608070fb1dd0c829922..a7fe09868c188fb62ae15c2d449192c7c3d5b0eb 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -598,6 +598,15 @@ class SessionRestoreImpl : public NotificationObserver {
// tabbed browsers exist.
Browser* last_browser = NULL;
bool has_tabbed_browser = false;
+
+ // Determine if there is a visible window.
+ bool has_visible_browser = false;
+ for (std::vector<SessionWindow*>::iterator i = windows->begin();
+ i != windows->end(); ++i) {
+ if ((*i)->show_state != ui::SHOW_STATE_MINIMIZED)
+ has_visible_browser = true;
+ }
+
for (std::vector<SessionWindow*>::iterator i = windows->begin();
i != windows->end(); ++i) {
Browser* browser = NULL;
@@ -613,10 +622,15 @@ class SessionRestoreImpl : public NotificationObserver {
chromeos::BootTimesLoader::Get()->AddLoginTimeMarker(
"SessionRestore-CreateRestoredBrowser-Start", false);
#endif
+ // Show the first window if none are visible.
+ ui::WindowShowState show_state = (*i)->show_state;
+ if (!has_visible_browser) {
+ show_state = ui::SHOW_STATE_NORMAL;
+ has_visible_browser = true;
+ }
+
browser = CreateRestoredBrowser(
- static_cast<Browser::Type>((*i)->type),
- (*i)->bounds,
- (*i)->show_state);
+ static_cast<Browser::Type>((*i)->type), (*i)->bounds, show_state);
#if defined(OS_CHROMEOS)
chromeos::BootTimesLoader::Get()->AddLoginTimeMarker(
"SessionRestore-CreateRestoredBrowser-End", false);
« no previous file with comments | « chrome/browser/chromeos/frame/panel_browser_view.cc ('k') | chrome/browser/sessions/session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698