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

Unified Diff: chrome/browser/sessions/session_restore.cc

Issue 1366313003: Fix incorrect window show state after session restore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove change from other cl. Created 5 years, 3 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 | « 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/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index aca211c8d7bfe979dff23c9fc44f7a8ff4296d36..3f464e59877ffed85d94f4933519a8baa2371ebb 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -382,11 +382,15 @@ class SessionRestoreImpl : public content::NotificationObserver {
// windows has the same id as specified in active_window_id.
Browser* browser_to_activate = nullptr;
- // Determine if there is a visible window.
+ // Determine if there is a visible window, or if the active window exists.
+ // Even if all windows are ui::SHOW_STATE_MINIMIZED, if one of them is the
+ // active window it will be made visible by the call to
+ // browser_to_activate->window()->Activate() later on in this method.
bool has_visible_browser = false;
for (std::vector<sessions::SessionWindow*>::iterator i = windows->begin();
i != windows->end(); ++i) {
- if ((*i)->show_state != ui::SHOW_STATE_MINIMIZED)
+ if ((*i)->show_state != ui::SHOW_STATE_MINIMIZED ||
+ (*i)->window_id.id() == active_window_id)
sky 2015/09/28 14:54:05 How is that the active window is in a minimized st
shrike 2015/09/28 17:53:41 As browser windows become active, SessionService::
sky 2015/09/28 19:04:01 Ok, makes sense.
has_visible_browser = true;
}
« 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