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

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
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b2812df3be18b36d891222f90cf2557452e29f86 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -141,6 +141,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 +379,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),
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698