OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/plugin_manager.h" | 10 #include "chrome/browser/extensions/plugin_manager.h" |
11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
14 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 14 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
15 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
16 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
17 #include "content/public/browser/plugin_service.h" | 17 #include "content/public/browser/plugin_service.h" |
18 #include "content/public/common/pepper_plugin_info.h" | 18 #include "content/public/common/pepper_plugin_info.h" |
19 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
22 using content::PluginService; | 22 using content::PluginService; |
23 | 23 |
24 static const char* kNaClPluginMimeType = "application/x-nacl"; | 24 static const char* kNaClPluginMimeType = "application/x-nacl"; |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 | 27 |
28 PluginManager::PluginManager(Profile* profile) : profile_(profile) { | 28 PluginManager::PluginManager(content::BrowserContext* context) |
29 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 29 : profile_(Profile::FromBrowserContext(context)) { |
30 content::Source<Profile>(profile)); | 30 registrar_.Add(this, |
31 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 31 chrome::NOTIFICATION_EXTENSION_LOADED, |
32 content::Source<Profile>(profile)); | 32 content::Source<Profile>(profile_)); |
| 33 registrar_.Add(this, |
| 34 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 35 content::Source<Profile>(profile_)); |
33 } | 36 } |
34 | 37 |
35 PluginManager::~PluginManager() { | 38 PluginManager::~PluginManager() { |
36 } | 39 } |
37 | 40 |
38 static base::LazyInstance<ProfileKeyedAPIFactory<PluginManager> > | 41 static base::LazyInstance<ProfileKeyedAPIFactory<PluginManager> > |
39 g_factory = LAZY_INSTANCE_INITIALIZER; | 42 g_factory = LAZY_INSTANCE_INITIALIZER; |
40 | 43 |
41 // static | 44 // static |
42 ProfileKeyedAPIFactory<PluginManager>* PluginManager::GetFactoryInstance() { | 45 ProfileKeyedAPIFactory<PluginManager>* PluginManager::GetFactoryInstance() { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 NaClModuleInfo::List::iterator PluginManager::FindNaClModule(const GURL& url) { | 189 NaClModuleInfo::List::iterator PluginManager::FindNaClModule(const GURL& url) { |
187 for (NaClModuleInfo::List::iterator iter = nacl_module_list_.begin(); | 190 for (NaClModuleInfo::List::iterator iter = nacl_module_list_.begin(); |
188 iter != nacl_module_list_.end(); ++iter) { | 191 iter != nacl_module_list_.end(); ++iter) { |
189 if (iter->url == url) | 192 if (iter->url == url) |
190 return iter; | 193 return iter; |
191 } | 194 } |
192 return nacl_module_list_.end(); | 195 return nacl_module_list_.end(); |
193 } | 196 } |
194 | 197 |
195 } // namespace extensions | 198 } // namespace extensions |
OLD | NEW |