Chromium Code Reviews| 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 c23abd42ebf2d0fe1e7300a2cc7f2b35912b22c0..b4839b2e3a351b55ab3746d467e7aa5c3a1dfa04 100644 |
| --- a/chrome/browser/ui/webui/options/core_options_handler.cc |
| +++ b/chrome/browser/ui/webui/options/core_options_handler.cc |
| @@ -10,10 +10,12 @@ |
| #include "base/string_number_conversions.h" |
| #include "base/utf_string_conversions.h" |
| #include "base/values.h" |
| +#include "chrome/browser/browser_process.h" |
| #include "chrome/browser/google/google_util.h" |
| #include "chrome/browser/metrics/user_metrics.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| #include "content/common/notification_details.h" |
| #include "content/common/notification_type.h" |
| @@ -30,6 +32,13 @@ CoreOptionsHandler::CoreOptionsHandler() |
| CoreOptionsHandler::~CoreOptionsHandler() {} |
| +void CoreOptionsHandler::Initialize() { |
| + clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, |
| + g_browser_process->local_state(), |
| + this); |
| + UpdateClearPluginLSOData(); |
| +} |
| + |
| void CoreOptionsHandler::GetLocalizedValues( |
| DictionaryValue* localized_strings) { |
| DCHECK(localized_strings); |
| @@ -341,7 +350,17 @@ void CoreOptionsHandler::HandleUserMetricsAction(const ListValue* args) { |
| UserMetricsRecordAction(UserMetricsAction(metric.c_str())); |
| } |
| +void CoreOptionsHandler::UpdateClearPluginLSOData() { |
| + scoped_ptr<Value> enabled( |
| + Value::CreateBooleanValue(clear_plugin_lso_data_enabled_.GetValue())); |
| + web_ui_->CallJavascriptFunction( |
| + "OptionsPage.setClearPluginLSODataEnabled", *enabled); |
| +} |
| + |
| void CoreOptionsHandler::NotifyPrefChanged(const std::string* pref_name) { |
| + if (*pref_name == prefs::kClearPluginLSODataEnabled) |
|
Evan Stade
2011/04/18 17:43:05
can you comment that this is part of local_state a
|
| + UpdateClearPluginLSOData(); |
|
Evan Stade
2011/04/18 17:43:05
early return
|
| + |
| PrefService* pref_service = web_ui_->GetProfile()->GetPrefs(); |
| const PrefService::Preference* pref = |
| pref_service->FindPreference(pref_name->c_str()); |