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

Unified Diff: chrome/browser/plugin_prefs.h

Issue 10872034: Changing PluginPrefs to use PluginFinder's async interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@test_async
Patch Set: Converted PluginPref#CanEnablePlugin to use PluginFinder's async interface. Created 8 years, 4 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_prefs.h
diff --git a/chrome/browser/plugin_prefs.h b/chrome/browser/plugin_prefs.h
index eddb0250f3a120aaa234aa65cf9e9c663e8b4d06..15350a0c40f36de2bb3e95a7928eaf2269a2b85e 100644
--- a/chrome/browser/plugin_prefs.h
+++ b/chrome/browser/plugin_prefs.h
@@ -13,6 +13,7 @@
#include "base/file_path.h"
#include "base/synchronization/lock.h"
#include "chrome/browser/api/prefs/pref_change_registrar.h"
+#include "chrome/browser/plugin_finder.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/refcounted_profile_keyed_service.h"
#include "content/public/browser/notification_observer.h"
@@ -65,9 +66,10 @@ class PluginPrefs : public RefcountedProfileKeyedService,
// Enable or disable a plugin group.
void EnablePluginGroup(bool enable, const string16& group_name);
- // Returns true if the plug-in state can be enabled or disabled according to
- // |enable|, false if the plug-in state cannot be changed because of a policy.
- bool CanEnablePlugin(bool enable, const FilePath& file_path);
+ // Checks if the plug-in state can be enabled or disabled according to
+ // |enable| or if the plug-in state cannot be changed because of a policy.
+ void CanEnablePlugin(bool enable, const FilePath& file_path,
Bernhard Bauer 2012/08/24 08:15:34 I think we could combine these methods. There are
ibraaaa 2012/08/24 15:51:29 I wanted to leave this in another CL with modifyin
+ const base::Callback<void(bool)>& cb);
// Enables or disables a specific plugin file, and calls |callback|
// afterwards.
@@ -150,6 +152,12 @@ class PluginPrefs : public RefcountedProfileKeyedService,
static bool IsStringMatchedInSet(const string16& name,
const std::set<string16>& pattern_set);
+ // Callback method called by 'CanEnablePlugin' method.
+ // It performs the actual logic to check if a plug-in can be enabled.
+ void CanEnablePluginCallback(bool enabled, const FilePath& path,
+ const base::Callback<void(bool)>& cb,
+ PluginFinder* finder);
+
// Guards access to the following data structures.
mutable base::Lock lock_;

Powered by Google App Engine
This is Rietveld 408576698