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

Unified Diff: chrome/browser/browser_shutdown.cc

Issue 2225003: Implement upgrade notifications.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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/browser_prefs.cc ('k') | chrome/browser/browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_shutdown.cc
===================================================================
--- chrome/browser/browser_shutdown.cc (revision 48146)
+++ chrome/browser/browser_shutdown.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,6 +28,7 @@
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "net/dns_global.h"
@@ -128,6 +129,14 @@
shutdown_num_processes_slow_);
}
+ // Check local state for the restart flag so we can restart the session below.
+ bool restart_last_session = false;
+ if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) {
+ restart_last_session =
+ prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown);
+ prefs->ClearPref(prefs::kRestartLastSessionOnShutdown);
+ }
+
prefs->SavePersistentPrefs();
#if defined(OS_WIN)
@@ -152,7 +161,21 @@
shutdown_type_ != browser_shutdown::END_SESSION) {
Upgrade::SwapNewChromeExeIfPresent();
}
+
+ if (restart_last_session) {
+ // Make sure to relaunch the browser with the same command line and add
+ // Restore Last Session flag if session restore is not set.
+ CommandLine command_line = CommandLine::FromString(
+ CommandLine::ForCurrentProcess()->command_line_string());
+ if (!command_line.HasSwitch(switches::kRestoreLastSession))
+ command_line.AppendSwitch(switches::kRestoreLastSession);
+ Upgrade::RelaunchChromeBrowser(command_line);
Nico 2010/08/27 05:14:09 Isn't this very racy? RelaunchChromeBrowser() most
Nico 2010/08/27 05:17:15 This might be the cause for http://crbug.com/50803
+ }
#endif
+#if !defined(OS_WIN)
+ if (restart_last_session)
+ NOTIMPLEMENTED();
+#endif
if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) {
// Measure total shutdown time as late in the process as possible
« no previous file with comments | « chrome/browser/browser_prefs.cc ('k') | chrome/browser/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698