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

Unified Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 2927853002: Force guest profiles to return default startup prefs. (Closed)
Patch Set: Fix error. Created 3 years, 6 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/prefs/session_startup_pref.cc
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index 9126203deeba9a3b95501a654cc9d16baccc036e..1b569b08b765c9629e086e124c4b9281a83634a5 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -99,7 +99,12 @@ void SessionStartupPref::SetStartupPref(PrefService* prefs,
// static
SessionStartupPref SessionStartupPref::GetStartupPref(Profile* profile) {
DCHECK(profile);
- return GetStartupPref(profile->GetPrefs());
+
+ // Guest sessions should not store any state, therefore they should never
+ // trigger a restore during startup.
+ return profile->IsGuestSession()
+ ? SessionStartupPref(SessionStartupPref::DEFAULT)
+ : GetStartupPref(profile->GetPrefs());
}
// static
« 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