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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 11143034: Prevent app restore from happening on restart when user is in incognito mode. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 2 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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 9e7aace570ea6f16b5ef738c7a542261564ec857..7434d9c7fff09403842d49496424ac332178f970 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -643,9 +643,13 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs(
VLOG(1) << "Pref: default";
// The only time apps get restored is when the browser process is restarted.
- if (StartupBrowserCreator::WasRestarted())
- extensions::AppRestoreServiceFactory::GetForProfile(profile_)->
- RestoreApps();
+ if (StartupBrowserCreator::WasRestarted()) {
+ extensions::AppRestoreService* service =
+ extensions::AppRestoreServiceFactory::GetForProfile(profile_);
+ // NULL in incognito mode.
+ if (service)
+ service->RestoreApps();
+ }
if (pref.type == SessionStartupPref::LAST) {
if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
« 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