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

Unified Diff: chrome/browser/ui/webui/options2/core_options_handler2.cc

Issue 10387161: Pepper Flash settings integration: add UI for "deauthorize content licenses". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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/options2/core_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/core_options_handler2.cc b/chrome/browser/ui/webui/options2/core_options_handler2.cc
index db4a720fc24919882aaba17db533e4c35dcf521e..42091da16bcf8ca933e9703570a7e2207ec0ac5e 100644
--- a/chrome/browser/ui/webui/options2/core_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/core_options_handler2.cc
@@ -34,19 +34,23 @@ using content::UserMetricsAction;
namespace options2 {
CoreOptionsHandler::CoreOptionsHandler()
- : handlers_host_(NULL) {
+ : handlers_host_(NULL),
+ clear_plugin_lso_data_enabled_(prefs::kClearPluginLSODataEnabled),
+ pepper_flash_settings_enabled_(prefs::kPepperFlashSettingsEnabled) {
}
CoreOptionsHandler::~CoreOptionsHandler() {}
void CoreOptionsHandler::InitializeHandler() {
- clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled,
- Profile::FromWebUI(web_ui()),
- this);
+ std::vector<PluginStatusPrefSetter::Client*> clients;
+ clients.push_back(&clear_plugin_lso_data_enabled_);
+ clients.push_back(&pepper_flash_settings_enabled_);
+ plugin_status_pref_setter_.Init(clients, Profile::FromWebUI(web_ui()), this);
}
void CoreOptionsHandler::InitializePage() {
UpdateClearPluginLSOData();
+ UpdatePepperFlashSettingsEnabled();
}
void CoreOptionsHandler::GetLocalizedValues(
@@ -127,6 +131,10 @@ void CoreOptionsHandler::Observe(int type,
UpdateClearPluginLSOData();
return;
}
+ if (*pref_name == prefs::kPepperFlashSettingsEnabled) {
+ UpdatePepperFlashSettingsEnabled();
+ return;
+ }
NotifyPrefChanged(*pref_name, std::string());
}
}
@@ -469,4 +477,12 @@ void CoreOptionsHandler::UpdateClearPluginLSOData() {
"OptionsPage.setClearPluginLSODataEnabled", *enabled);
}
+void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() {
+ scoped_ptr<base::Value> enabled(
+ base::Value::CreateBooleanValue(
+ pepper_flash_settings_enabled_.GetValue()));
+ web_ui()->CallJavascriptFunction(
+ "OptionsPage.setPepperFlashSettingsEnabled", *enabled);
+}
+
} // namespace options2

Powered by Google App Engine
This is Rietveld 408576698