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

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

Issue 7342009: Show a different banner in chrome://settings for extension-controlled settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix stuff 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 7a5e2f13b4efa8b7735303d1fae2a12a3f301322..fe81dff2fe8c19f337ef1a8981e56ff0ea3ad5ee 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -47,9 +47,18 @@ void CoreOptionsHandler::GetLocalizedValues(
localized_strings->SetString("title",
l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE));
+ string16 options_term = l10n_util::GetStringUTF16(IDS_OPTIONS_PREFS_TERM);
+
// Managed prefs
- localized_strings->SetString("managedPrefsBannerText",
- l10n_util::GetStringUTF16(IDS_OPTIONS_MANAGED_PREFS));
+ localized_strings->SetString("policyManagedPrefsBannerText",
Mattias Nissler (ping if slow) 2011/07/13 12:07:58 Not sure whether it's mandatory, but I personally
Evan Stade 2011/07/13 17:06:04 no it is not mandatory, both styles are acceptable
+ l10n_util::GetStringFUTF16(IDS_OPTIONS_POLICY_MANAGED_PREFS,
+ options_term));
+ localized_strings->SetString("extensionManagedPrefsBannerText",
+ l10n_util::GetStringFUTF16(IDS_OPTIONS_EXTENSION_MANAGED_PREFS,
+ options_term));
+ localized_strings->SetString("policyAndExtensionManagedPrefsBannerText",
+ l10n_util::GetStringFUTF16(IDS_OPTIONS_POLICY_EXTENSION_MANAGED_PREFS,
+ options_term));
// Search
RegisterTitle(localized_strings, "searchPage", IDS_OPTIONS_SEARCH_PAGE_TITLE);
@@ -141,8 +150,11 @@ Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) {
if (pref) {
DictionaryValue* dict = new DictionaryValue;
dict->Set("value", pref->GetValue()->DeepCopy());
- dict->SetBoolean("managed", pref->IsManaged());
- dict->SetBoolean("extensionControlled", pref->IsExtensionControlled());
+ if (pref->IsManaged()) {
Evan Stade 2011/07/13 17:06:04 no curlies
Bernhard Bauer 2011/07/13 22:15:12 Done.
+ dict->SetString("controlledBy", "policy");
+ } else if (pref->IsExtensionControlled()) {
+ dict->SetString("controlledBy", "extension");
+ }
Joao da Silva 2011/07/13 17:35:17 The code here that creates the DictionaryValue is
Bernhard Bauer 2011/07/13 22:15:12 Good idea. Done.
dict->SetBoolean("disabled", !pref->IsUserModifiable());
return_value = dict;
} else {
@@ -379,8 +391,11 @@ 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());
+ if (pref->IsManaged()) {
+ dict->SetString("controlledBy", "policy");
+ } else if (pref->IsExtensionControlled()) {
+ dict->SetString("controlledBy", "extension");
+ }
Joao da Silva 2011/07/13 17:35:17 See comment above.
Bernhard Bauer 2011/07/13 22:15:12 Done.
dict->SetBoolean("disabled", !pref->IsUserModifiable());
result_value.Append(dict);

Powered by Google App Engine
This is Rietveld 408576698