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

Unified Diff: chrome/browser/plugin_data_remover_helper.h

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/plugin_data_remover_helper.h
diff --git a/chrome/browser/plugin_data_remover_helper.h b/chrome/browser/plugin_data_remover_helper.h
index 938b17c9dd153e14017572d6cb360814a34dbbda..7b226f521d0013b772b6d22ab73d539f2fbf3067 100644
--- a/chrome/browser/plugin_data_remover_helper.h
+++ b/chrome/browser/plugin_data_remover_helper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -6,60 +6,31 @@
#define CHROME_BROWSER_PLUGIN_DATA_REMOVER_HELPER_H_
#pragma once
-#include <vector>
+#include <string>
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "chrome/browser/prefs/pref_member.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/plugin_status_pref_setter.h"
class PluginPrefs;
-class Profile;
-namespace webkit {
-struct WebPluginInfo;
-}
-
-// 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 profile outlives this object.
-class PluginDataRemoverHelper : public content::NotificationObserver {
+// Helper class to (asynchronously) update the preference specifying whether
+// clearing plug-in data is supported by an installed plug-in.
+class PluginDataRemoverHelper : public PluginStatusPrefSetter::Client {
public:
- PluginDataRemoverHelper();
+ explicit PluginDataRemoverHelper(const char* pref_name);
virtual ~PluginDataRemoverHelper();
- // Binds this object to the |pref_name| preference in the profile's
- // PrefService, notifying |observer| if the value changes.
- // This asynchronously calls the PluginService to get the list of installed
- // plug-ins.
- void Init(const char* pref_name,
- Profile* profile,
- content::NotificationObserver* observer);
-
- bool GetValue() const { return pref_.GetValue(); }
-
// Like PluginDataRemover::IsSupported, but checks that the returned plugin
- // is enabled by PluginPrefs
+ // is enabled by PluginPrefs.
static bool IsSupported(PluginPrefs* plugin_prefs);
- // content::NotificationObserver methods:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // PluginStatusPrefSetter::Client implementation.
+ virtual const char* GetPrefName() const OVERRIDE;
+ virtual bool CalculatePrefValue(PluginPrefs* plugin_prefs) OVERRIDE;
private:
- void StartUpdate();
- void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs,
- const std::vector<webkit::WebPluginInfo>& plugins);
-
- BooleanPrefMember pref_;
- content::NotificationRegistrar registrar_;
- // Weak pointer.
- Profile* profile_;
- base::WeakPtrFactory<PluginDataRemoverHelper> factory_;
+ std::string pref_name_;
DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverHelper);
};

Powered by Google App Engine
This is Rietveld 408576698