Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Side by Side Diff: chrome/browser/plugin_service.cc

Issue 3530017: This changes GetPluginInfo so that we can request a list of plugins (Closed)
Patch Set: Fixing indents Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698