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

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

Issue 7310003: Disable chrome://options UI elements if the corresponding preference is not user-modifiable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 5 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/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index 83cdafa169140d591d45b0edcfcb4be46c0c9d1b..754d99d0dbe910fecde571466502b9f3adab765f 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -49,6 +49,8 @@ void CoreOptionsHandler::GetLocalizedValues(
// Managed prefs
localized_strings->SetString("managedPrefsBannerText",
l10n_util::GetStringUTF16(IDS_OPTIONS_MANAGED_PREFS));
+ localized_strings->SetString("extensionManagedPrefsTitle",
+ l10n_util::GetStringUTF16(IDS_OPTIONS_EXTENSION_MANAGED_PREFS));
// Search
RegisterTitle(localized_strings, "searchPage", IDS_OPTIONS_SEARCH_PAGE_TITLE);
@@ -141,6 +143,8 @@ Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) {
DictionaryValue* dict = new DictionaryValue;
dict->Set("value", pref->GetValue()->DeepCopy());
dict->SetBoolean("managed", pref->IsManaged());
+ dict->SetBoolean("extensionControlled", pref->IsExtensionControlled());
+ dict->SetBoolean("disabled", !pref->IsUserModifiable());
return_value = dict;
} else {
return_value = Value::CreateNullValue();
@@ -377,6 +381,8 @@ void CoreOptionsHandler::NotifyPrefChanged(const std::string* pref_name) {
DictionaryValue* dict = new DictionaryValue;
dict->Set("value", pref->GetValue()->DeepCopy());
dict->SetBoolean("managed", pref->IsManaged());
+ dict->SetBoolean("extensionControlled", pref->IsExtensionControlled());
+ dict->SetBoolean("disabled", !pref->IsUserModifiable());
result_value.Append(dict);
web_ui_->CallJavascriptFunction(WideToASCII(callback_function),

Powered by Google App Engine
This is Rietveld 408576698