summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_data_remover_helper.h
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 16:46:42 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-15 16:46:42 +0000
commit09d81f898a0b8ec6aa2bdc0fa98310edfae80bf5 (patch)
treee5c7dc50ba9b0ab3106a54f4eed6445d62583208 /chrome/browser/plugin_data_remover_helper.h
parent1788e772859c9157bea986d5c478d07671b700a0 (diff)
downloadchromium_src-09d81f898a0b8ec6aa2bdc0fa98310edfae80bf5.zip
chromium_src-09d81f898a0b8ec6aa2bdc0fa98310edfae80bf5.tar.gz
chromium_src-09d81f898a0b8ec6aa2bdc0fa98310edfae80bf5.tar.bz2
Add a preference to clear Flash LSO data in the Clear Browsing Data dialog.
The preference defaults to false, so without UI it should do nothing. BUG=58235 TEST=none Review URL: http://codereview.chromium.org/5278001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_data_remover_helper.h')
-rw-r--r--chrome/browser/plugin_data_remover_helper.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/plugin_data_remover_helper.h b/chrome/browser/plugin_data_remover_helper.h
new file mode 100644
index 0000000..a1a6537
--- /dev/null
+++ b/chrome/browser/plugin_data_remover_helper.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
+#define CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
+#pragma once
+
+#include "base/ref_counted.h"
+#include "chrome/browser/prefs/pref_member.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
+
+class Profile;
+
+// Helper class modeled after BooleanPrefMember to (asynchronously) update
+// the preference specifying whether clearing plug-in data is supported
+// by an installed plug-in.
+// It should only be used from the UI thread. The client has to make sure that
+// the passed PrefService outlives this object.
+class PluginDataRemoverHelper : public NotificationObserver {
+ public:
+ PluginDataRemoverHelper();
+ ~PluginDataRemoverHelper();
+
+ // Binds this object to the |pref_name| preference in |prefs|, notifying
+ // |observer| if the value changes.
+ // This fires off a request to the NPAPI::PluginList (via PluginDataRemover)
+ // on the FILE thread to get the list of installed plug-ins.
+ void Init(const char* pref_name,
+ PrefService* prefs,
+ NotificationObserver* observer);
+
+ bool GetValue() const { return pref_.GetValue(); }
+
+ // NotificationObserver methods:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ class Internal;
+
+ BooleanPrefMember pref_;
+ NotificationRegistrar registrar_;
+ scoped_refptr<Internal> internal_;
+
+ DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverHelper);
+};
+
+#endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_