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

Unified Diff: content/browser/plugin_service.cc

Issue 8493019: Refactor PluginService to take PluginList as a dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT Created 9 years, 1 month 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
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service.cc
diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc
index 5e0e910656076fa2394cec4f57f871b1f52a079b..31df32e406dbae15563f6836f70a265c488909ff 100644
--- a/content/browser/plugin_service.cc
+++ b/content/browser/plugin_service.cc
@@ -76,6 +76,14 @@ void WillLoadPluginsCallback() {
} // namespace
+// Custom Singleton traits to inject the PluginList.
+struct PluginServiceSingletonTraits :
+ public DefaultSingletonTraits<PluginService> {
+ static PluginService* New() {
+ return new PluginService(webkit::npapi::PluginList::Singleton());
Bernhard Bauer 2011/11/08 17:03:23 If you set the WillLoadPluginsCallback here, you d
Robert Sesek 2011/11/08 17:21:00 Good idea. Done.
+ }
+};
+
#if defined(OS_MACOSX)
static void NotifyPluginsOfActivation() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -109,11 +117,12 @@ class PluginDirWatcherDelegate : public FilePathWatcher::Delegate {
// static
PluginService* PluginService::GetInstance() {
- return Singleton<PluginService>::get();
+ return Singleton<PluginService, PluginServiceSingletonTraits>::get();
}
-PluginService::PluginService()
- : ui_locale_(
+PluginService::PluginService(webkit::npapi::PluginList* a_plugin_list)
+ : plugin_list_(a_plugin_list),
+ ui_locale_(
content::GetContentClient()->browser()->GetApplicationLocale()),
filter_(NULL) {
plugin_list()->set_will_load_plugins_callback(
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698