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

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

Issue 6875001: Hide Flash storage settings link. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 8 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 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());
« no previous file with comments | « chrome/browser/ui/webui/options/core_options_handler.h ('k') | chrome/browser/ui/webui/settings_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698