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

Unified Diff: chrome/browser/ui/browser_list.cc

Issue 8533013: SessionRestore: Store session cookies and restore them if chrome crashes or auto-restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years 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/profiles/profile_impl_io_data.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_list.cc
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index 6827139aa6d59fae377489df8bef507e8bfd65df..3ce3e514977fe7c12975d2d54f620dfebc2dfbf1 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/browser_list.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
@@ -14,10 +15,12 @@
#include "chrome/browser/metrics/thread_watcher.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/background_printing_manager.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_details.h"
#include "content/public/browser/browser_shutdown.h"
@@ -508,6 +511,13 @@ void BrowserList::AttemptUserExit() {
// static
void BrowserList::AttemptRestart() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableRestoreSessionState)) {
+ BrowserVector::const_iterator it;
+ for (it = begin(); it != end(); ++it)
+ (*it)->profile()->SaveSessionState();
+ }
+
#if defined(OS_CHROMEOS)
// For CrOS instead of browser restart (which is not supported) perform a full
// sign out. Session will be only restored if user has that setting set.
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698