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

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

Issue 2927853002: Force guest profiles to return default startup prefs. (Closed)
Patch Set: Force guest profiles to return default startup prefs. 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..d8beaeda6a5d01fb31201891558e14b0ea9dbd84 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -99,7 +99,18 @@ void SessionStartupPref::SetStartupPref(PrefService* prefs,
// static
SessionStartupPref SessionStartupPref::GetStartupPref(Profile* profile) {
DCHECK(profile);
- return GetStartupPref(profile->GetPrefs());
+
+ PrefService* prefs = profile->GetPrefs();
+
+ // If a guest profile, force a return of the DEFAULT startup prefs. See
sky 2017/06/20 16:45:27 When writing comments strive for comments that cla
shrike 2017/06/20 18:01:17 Acknowledged.
+ // https://crbug.com/723414 .
+ if (profile->IsGuestSession()) {
+ DCHECK(prefs);
+ prefs->SetInteger(prefs::kRestoreOnStartup,
sky 2017/06/20 16:45:27 Is it really necessary to modify the prefs here? I
shrike 2017/06/20 18:01:17 I was concerned about not changing the original co
+ TypeToPrefValue(SessionStartupPref::DEFAULT));
+ }
+
+ return GetStartupPref(prefs);
}
// 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