Index: chrome/browser/plugin_finder.h |
diff --git a/chrome/browser/plugin_finder.h b/chrome/browser/plugin_finder.h |
index 1667411e84156dc0dc699455e805ad6c7be76100..2b1bd491ef747340c998d326da8a77579d048a94 100644 |
--- a/chrome/browser/plugin_finder.h |
+++ b/chrome/browser/plugin_finder.h |
@@ -16,6 +16,7 @@ |
namespace base { |
class DictionaryValue; |
+class ListValue; |
} |
class GURL; |
@@ -23,36 +24,39 @@ class PluginInstaller; |
class PluginFinder { |
public: |
- static void Get(const base::Callback<void(PluginFinder*)>& cb); |
+ typedef base::Callback<void(PluginInstaller*)> FindPluginCallback; |
+ |
+ static PluginFinder* GetInstance(); |
// Loads the plug-in information from the browser resources and parses it. |
// Returns NULL if the plug-in list couldn't be parsed. |
- static scoped_ptr<base::DictionaryValue> LoadPluginList(); |
+ static scoped_ptr<base::ListValue> LoadPluginList(); |
// Finds a plug-in for the given MIME type and language (specified as an IETF |
- // language tag, i.e. en-US) and returns the PluginInstaller for the plug-in, |
- // or NULL if no plug-in is found. |
- PluginInstaller* FindPlugin(const std::string& mime_type, |
- const std::string& language); |
+ // language tag, i.e. en-US) and calls the callback with the PluginInstaller |
+ // for the plug-in, or NULL if no plug-in is found. |
+ void FindPlugin(const std::string& mime_type, |
+ const std::string& language, |
+ const FindPluginCallback& callback); |
- // Returns the plug-in with the given identifier. |
- PluginInstaller* FindPluginWithIdentifier(const std::string& identifier); |
+ // Finds the plug-in with the given identifier and calls the callback. |
+ void FindPluginWithIdentifier(const std::string& identifier, |
+ const FindPluginCallback& callback); |
private: |
friend struct DefaultSingletonTraits<PluginFinder>; |
- friend class Singleton<PluginFinder>; |
- |
- static PluginFinder* GetInstance(); |
PluginFinder(); |
~PluginFinder(); |
- static base::DictionaryValue* LoadPluginListInternal(); |
+ static base::ListValue* LoadPluginListInternal(); |
PluginInstaller* CreateInstaller(const std::string& identifier, |
const base::DictionaryValue* plugin_dict); |
+ PluginInstaller* FindPluginInternal(const std::string& mime_type, |
+ const std::string& language); |
- scoped_ptr<base::DictionaryValue> plugin_list_; |
+ scoped_ptr<base::ListValue> plugin_list_; |
std::map<std::string, PluginInstaller*> installers_; |
DISALLOW_COPY_AND_ASSIGN(PluginFinder); |