Chromium Code Reviews| Index: content/browser/plugin_service.h |
| diff --git a/content/browser/plugin_service.h b/content/browser/plugin_service.h |
| index 2b2c69f225f2812bdcc9a555ecc05acfe6158a6d..9087365bc2315784a4e1a23b558f476a7ae46898 100644 |
| --- a/content/browser/plugin_service.h |
| +++ b/content/browser/plugin_service.h |
| @@ -157,11 +157,11 @@ class CONTENT_EXPORT PluginService |
| // Asynchronously loads plugins if necessary and then calls back to the |
| // provided function on the calling MessageLoop on completion. |
| - void GetPlugins(const GetPluginsCallback& callback); |
| + virtual void GetPlugins(const GetPluginsCallback& callback); |
| // Asynchronously loads the list of plugin groups if necessary and then calls |
| // back to the provided function on the calling MessageLoop on completion. |
| - void GetPluginGroups(const GetPluginGroupsCallback& callback); |
| + virtual void GetPluginGroups(const GetPluginGroupsCallback& callback); |
| // Tells all the renderer processes associated with the given browser context |
| // to throw away their cache of the plugin list, and optionally also reload |
| @@ -176,14 +176,18 @@ class CONTENT_EXPORT PluginService |
| } |
| content::PluginServiceFilter* filter() { return filter_; } |
| - private: |
| - friend struct DefaultSingletonTraits<PluginService>; |
| + webkit::npapi::PluginList* plugin_list() const { return plugin_list_; } |
| - // Creates the PluginService object, but doesn't actually build the plugin |
| - // list yet. It's generated lazily. |
| - PluginService(); |
| + protected: |
| + // Creates the PluginService object, but the actual plugin list is generated |
| + // lazily. If |plugin_list| is NULL, the singleton will be used. In tests, |
| + // use MockPluginList for dependency injection. |
| + PluginService(webkit::npapi::PluginList* plugin_list = NULL); |
|
Bernhard Bauer
2011/11/07 22:37:50
Could you have a protected mutator to set the plug
Robert Sesek
2011/11/07 23:05:49
No, but I can create a custom singleton traits.
|
| virtual ~PluginService(); |
| + private: |
| + friend struct DefaultSingletonTraits<PluginService>; |
| + |
| // base::WaitableEventWatcher::Delegate implementation. |
| virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); |
| @@ -232,6 +236,9 @@ class CONTENT_EXPORT PluginService |
| base::files::FilePathWatcher::Delegate* delegate); |
| #endif |
| + // The plugin list instance. |
| + webkit::npapi::PluginList* plugin_list_; |
| + |
| // The browser's UI locale. |
| const std::string ui_locale_; |