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

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: Change visibility to CSS controlled 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 50289d3b1b62d28035859569b14ddf0acfdef3a8..26a8cb215332693c2b96c9f7b308ca56eead860d 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -540,11 +540,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);
@@ -600,6 +595,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());
@@ -844,6 +842,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,
« no previous file with comments | « chrome/browser/resources/options/search_page.js ('k') | chrome/browser/ui/webui/options/startup_pages_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698