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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return plugin_host; | 239 return plugin_host; |
240 } | 240 } |
241 | 241 |
242 void PluginService::OpenChannelToPlugin( | 242 void PluginService::OpenChannelToPlugin( |
243 ResourceMessageFilter* renderer_msg_filter, | 243 ResourceMessageFilter* renderer_msg_filter, |
244 const GURL& url, | 244 const GURL& url, |
245 const std::string& mime_type, | 245 const std::string& mime_type, |
246 const std::string& locale, | 246 const std::string& locale, |
247 IPC::Message* reply_msg) { | 247 IPC::Message* reply_msg) { |
248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 249 |
249 bool allow_wildcard = true; | 250 bool allow_wildcard = true; |
250 WebPluginInfo info; | 251 WebPluginInfo info; |
251 FilePath plugin_path; | 252 FilePath plugin_path; |
252 if (NPAPI::PluginList::Singleton()->GetPluginInfo( | 253 if (NPAPI::PluginList::Singleton()->GetPluginInfo( |
253 url, mime_type, allow_wildcard, &info, NULL) && info.enabled) { | 254 url, mime_type, allow_wildcard, &info, NULL) && info.enabled) { |
254 plugin_path = info.path; | 255 plugin_path = info.path; |
255 } | 256 } |
| 257 |
256 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); | 258 PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path); |
257 if (plugin_host) { | 259 if (plugin_host) { |
258 plugin_host->OpenChannelToPlugin(renderer_msg_filter, mime_type, reply_msg); | 260 plugin_host->OpenChannelToPlugin(renderer_msg_filter, mime_type, reply_msg); |
259 } else { | 261 } else { |
260 PluginProcessHost::ReplyToRenderer( | 262 PluginProcessHost::ReplyToRenderer( |
261 renderer_msg_filter, IPC::ChannelHandle(), WebPluginInfo(), reply_msg); | 263 renderer_msg_filter, IPC::ChannelHandle(), WebPluginInfo(), reply_msg); |
262 } | 264 } |
263 } | 265 } |
264 | 266 |
265 static void PurgePluginListCache(bool reload_pages) { | 267 static void PurgePluginListCache(bool reload_pages) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 379 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
378 | 380 |
379 // These NPAPI entry points will never be called. TODO(darin): Come up | 381 // These NPAPI entry points will never be called. TODO(darin): Come up |
380 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 382 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
381 // or perhaps refactor the PluginList to be less specific to NPAPI. | 383 // or perhaps refactor the PluginList to be less specific to NPAPI. |
382 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 384 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
383 | 385 |
384 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 386 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); |
385 } | 387 } |
386 } | 388 } |
OLD | NEW |