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 "chrome/browser/plugin_service.h" | 5 #include "chrome/browser/plugin_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 this, &PluginService::FinishOpenChannelToPlugin, | 259 this, &PluginService::FinishOpenChannelToPlugin, |
260 plugin_path, client)); | 260 plugin_path, client)); |
261 } | 261 } |
262 | 262 |
263 void PluginService::FinishOpenChannelToPlugin( | 263 void PluginService::FinishOpenChannelToPlugin( |
264 const FilePath& plugin_path, | 264 const FilePath& plugin_path, |
265 PluginProcessHost::Client* client) { | 265 PluginProcessHost::Client* client) { |
266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
267 | 267 |
268 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); | 268 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); |
269 if (plugin_host) | 269 if (plugin_host) { |
| 270 client->OnPluginProcessFound(plugin_host); |
270 plugin_host->OpenChannelToPlugin(client); | 271 plugin_host->OpenChannelToPlugin(client); |
271 else | 272 } else { |
272 client->OnError(); | 273 client->OnError(); |
| 274 } |
273 } | 275 } |
274 | 276 |
275 bool PluginService::GetFirstAllowedPluginInfo( | 277 bool PluginService::GetFirstAllowedPluginInfo( |
276 const GURL& url, | 278 const GURL& url, |
277 const std::string& mime_type, | 279 const std::string& mime_type, |
278 webkit::npapi::WebPluginInfo* info, | 280 webkit::npapi::WebPluginInfo* info, |
279 std::string* actual_mime_type) { | 281 std::string* actual_mime_type) { |
280 // GetPluginInfoArray may need to load the plugins, so we need to be | 282 // GetPluginInfoArray may need to load the plugins, so we need to be |
281 // on the FILE thread. | 283 // on the FILE thread. |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 284 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 422 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
421 | 423 |
422 // These NPAPI entry points will never be called. TODO(darin): Come up | 424 // These NPAPI entry points will never be called. TODO(darin): Come up |
423 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 425 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
424 // or perhaps refactor the PluginList to be less specific to NPAPI. | 426 // or perhaps refactor the PluginList to be less specific to NPAPI. |
425 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 427 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
426 | 428 |
427 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); | 429 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); |
428 } | 430 } |
429 } | 431 } |
OLD | NEW |