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

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

Issue 2714483003: cros: Fix restoring session windows after crash inconsistent minimized window counts (Closed)
Patch Set: Created 3 years, 10 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 | chrome/browser/sessions/session_restore_browsertest.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 eeafc2d4fed5bd8ac73abeea509a04cf4f662b5f..fd3c6d877a6bf1c786eec43758ee07a8b5accf7e 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -558,8 +558,9 @@ class SessionRestoreImpl : public content::NotificationObserver {
if (!is_selected_tab)
continue;
- ShowBrowser(browser, browser->tab_strip_model()->GetIndexOfWebContents(
- contents));
+ ShowBrowser(browser,
+ browser->tab_strip_model()->GetIndexOfWebContents(contents),
+ window.show_state);
// TODO(sky): remove. For debugging 368236.
CHECK_EQ(browser->tab_strip_model()->GetActiveWebContents(), contents);
}
@@ -643,15 +644,15 @@ class SessionRestoreImpl : public content::NotificationObserver {
return new Browser(params);
}
- void ShowBrowser(Browser* browser, int selected_tab_index) {
+ void ShowBrowser(Browser* browser,
+ int selected_tab_index,
+ ui::WindowShowState show_state) {
DCHECK(browser);
DCHECK(browser->tab_strip_model()->count());
browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true);
- if (browser_ == browser)
- return;
-
- browser->window()->Show();
+ show_state == ui::SHOW_STATE_MINIMIZED ? browser->window()->Minimize()
+ : browser->window()->Show();
browser->set_is_session_restore(false);
// TODO(jcampan): http://crbug.com/8123 we should not need to set the
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698