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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 467363003: Guest mode causes certain settings to be hidden. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 0b29dc17fb48497bddfc57a6e26850de9d58b941..7328a616511cfd644d7016eda61ede3b08bb7a3e 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -532,11 +532,6 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
// Pass along sync status early so it will be available during page init.
values->Set("syncData", GetSyncStateDictionary().release());
- // The Reset Profile Settings feature makes no sense for an off-the-record
- // profile (e.g. in Guest mode on Chrome OS), so hide it.
- values->SetBoolean("enableResetProfileSettings",
- !Profile::FromWebUI(web_ui())->IsOffTheRecord());
-
values->SetString("privacyLearnMoreURL", chrome::kPrivacyLearnMoreURL);
values->SetString("doNotTrackLearnMoreURL", chrome::kDoNotTrackLearnMoreURL);
@@ -592,6 +587,9 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
if (ShouldShowMultiProfilesUserList())
values->Set("profilesInfo", GetProfilesInfoList().release());
+ values->SetBoolean("profileIsGuest",
+ Profile::FromWebUI(web_ui())->IsOffTheRecord());
+
values->SetBoolean("profileIsSupervised",
Profile::FromWebUI(web_ui())->IsSupervised());
@@ -834,6 +832,10 @@ void BrowserOptionsHandler::InitializeHandler() {
}
#endif
+ // No preferences below this point may be modified by guest profiles.
+ if (Profile::FromWebUI(web_ui())->IsGuestSession())
+ return;
+
auto_open_files_.Init(
prefs::kDownloadExtensionsToOpen, prefs,
base::Bind(&BrowserOptionsHandler::SetupAutoOpenFileTypes,

Powered by Google App Engine
This is Rietveld 408576698