OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/plugin_service.h" | 7 #include "chrome/browser/plugin_service.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #ifndef DISABLE_NACL | 36 #ifndef DISABLE_NACL |
37 #include "native_client/src/trusted/plugin/nacl_entry_points.h" | 37 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
38 #endif | 38 #endif |
39 #include "webkit/glue/plugins/plugin_constants_win.h" | 39 #include "webkit/glue/plugins/plugin_constants_win.h" |
40 #include "webkit/glue/plugins/plugin_list.h" | 40 #include "webkit/glue/plugins/plugin_list.h" |
41 | 41 |
42 #if defined(OS_MACOSX) | 42 #if defined(OS_MACOSX) |
43 static void NotifyPluginsOfActivation() { | 43 static void NotifyPluginsOfActivation() { |
44 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 44 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
45 | 45 |
46 for (ChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); | 46 for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); |
47 !iter.Done(); ++iter) { | 47 !iter.Done(); ++iter) { |
48 PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); | 48 PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); |
49 plugin->OnAppActivation(); | 49 plugin->OnAppActivation(); |
50 } | 50 } |
51 } | 51 } |
52 #endif | 52 #endif |
53 | 53 |
54 // static | 54 // static |
55 bool PluginService::enable_chrome_plugins_ = true; | 55 bool PluginService::enable_chrome_plugins_ = true; |
56 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 PluginProcessHost* PluginService::FindPluginProcess( | 258 PluginProcessHost* PluginService::FindPluginProcess( |
259 const FilePath& plugin_path) { | 259 const FilePath& plugin_path) { |
260 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 260 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
261 | 261 |
262 if (plugin_path.value().empty()) { | 262 if (plugin_path.value().empty()) { |
263 NOTREACHED() << "should only be called if we have a plugin to load"; | 263 NOTREACHED() << "should only be called if we have a plugin to load"; |
264 return NULL; | 264 return NULL; |
265 } | 265 } |
266 | 266 |
267 for (ChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); | 267 for (BrowserChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS); |
268 !iter.Done(); ++iter) { | 268 !iter.Done(); ++iter) { |
269 PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); | 269 PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); |
270 if (plugin->info().path == plugin_path) | 270 if (plugin->info().path == plugin_path) |
271 return plugin; | 271 return plugin; |
272 } | 272 } |
273 | 273 |
274 return NULL; | 274 return NULL; |
275 } | 275 } |
276 | 276 |
277 PluginProcessHost* PluginService::FindOrStartPluginProcess( | 277 PluginProcessHost* PluginService::FindOrStartPluginProcess( |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 441 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
442 | 442 |
443 // These NPAPI entry points will never be called. TODO(darin): Come up | 443 // These NPAPI entry points will never be called. TODO(darin): Come up |
444 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 444 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
445 // or perhaps refactor the PluginList to be less specific to NPAPI. | 445 // or perhaps refactor the PluginList to be less specific to NPAPI. |
446 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 446 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
447 | 447 |
448 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 448 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); |
449 } | 449 } |
450 } | 450 } |
OLD | NEW |