| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return plugin; | 206 return plugin; |
| 207 } | 207 } |
| 208 | 208 |
| 209 return NULL; | 209 return NULL; |
| 210 } | 210 } |
| 211 | 211 |
| 212 PluginProcessHost* PluginService::FindOrStartPluginProcess( | 212 PluginProcessHost* PluginService::FindOrStartPluginProcess( |
| 213 const FilePath& plugin_path) { | 213 const FilePath& plugin_path) { |
| 214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 215 | 215 |
| 216 if (plugin_path.value().empty()) |
| 217 return NULL; |
| 218 |
| 216 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); | 219 PluginProcessHost* plugin_host = FindPluginProcess(plugin_path); |
| 217 if (plugin_host) | 220 if (plugin_host) |
| 218 return plugin_host; | 221 return plugin_host; |
| 219 | 222 |
| 220 WebPluginInfo info; | 223 WebPluginInfo info; |
| 221 if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( | 224 if (!NPAPI::PluginList::Singleton()->GetPluginInfoByPath( |
| 222 plugin_path, &info)) { | 225 plugin_path, &info)) { |
| 223 NOTREACHED(); | 226 NOTREACHED(); |
| 224 return NULL; | 227 return NULL; |
| 225 } | 228 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 427 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
| 425 | 428 |
| 426 // These NPAPI entry points will never be called. TODO(darin): Come up | 429 // These NPAPI entry points will never be called. TODO(darin): Come up |
| 427 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 430 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
| 428 // or perhaps refactor the PluginList to be less specific to NPAPI. | 431 // or perhaps refactor the PluginList to be less specific to NPAPI. |
| 429 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 432 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
| 430 | 433 |
| 431 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 434 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); |
| 432 } | 435 } |
| 433 } | 436 } |
| OLD | NEW |