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

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

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit tests. Created 9 years, 11 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 | Annotate | Revision Log
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 "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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 void PluginService::GetAllowedPluginForOpenChannelToPlugin( 244 void PluginService::GetAllowedPluginForOpenChannelToPlugin(
245 const GURL& url, 245 const GURL& url,
246 const std::string& mime_type, 246 const std::string& mime_type,
247 PluginProcessHost::Client* client) { 247 PluginProcessHost::Client* client) {
248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
249 webkit::npapi::WebPluginInfo info; 249 webkit::npapi::WebPluginInfo info;
250 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL); 250 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL);
251 FilePath plugin_path; 251 FilePath plugin_path;
252 if (found && info.enabled) 252 if (found && webkit::npapi::IsPluginEnabled(info))
253 plugin_path = FilePath(info.path); 253 plugin_path = FilePath(info.path);
254 254
255 // Now we jump back to the IO thread to finish opening the channel. 255 // Now we jump back to the IO thread to finish opening the channel.
256 BrowserThread::PostTask( 256 BrowserThread::PostTask(
257 BrowserThread::IO, FROM_HERE, 257 BrowserThread::IO, FROM_HERE,
258 NewRunnableMethod( 258 NewRunnableMethod(
259 this, &PluginService::FinishOpenChannelToPlugin, 259 this, &PluginService::FinishOpenChannelToPlugin,
260 plugin_path, client)); 260 plugin_path, client));
261 } 261 }
262 262
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 #if defined(OS_MACOSX) 375 #if defined(OS_MACOSX)
376 case NotificationType::APP_ACTIVATED: { 376 case NotificationType::APP_ACTIVATED: {
377 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 377 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
378 NewRunnableFunction(&NotifyPluginsOfActivation)); 378 NewRunnableFunction(&NotifyPluginsOfActivation));
379 break; 379 break;
380 } 380 }
381 #endif 381 #endif
382 382
383 case NotificationType::PLUGIN_ENABLE_STATUS_CHANGED: { 383 case NotificationType::PLUGIN_ENABLE_STATUS_CHANGED: {
384 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
384 PurgePluginListCache(false); 385 PurgePluginListCache(false);
385 break; 386 break;
386 } 387 }
387 default: 388 default:
388 DCHECK(false); 389 DCHECK(false);
389 } 390 }
390 } 391 }
391 392
392 bool PluginService::PrivatePluginAllowedForURL(const FilePath& plugin_path, 393 bool PluginService::PrivatePluginAllowedForURL(const FilePath& plugin_path,
393 const GURL& url) { 394 const GURL& url) {
(...skipping 26 matching lines...) Expand all
420 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); 421 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|'));
421 422
422 // These NPAPI entry points will never be called. TODO(darin): Come up 423 // 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, 424 // with a cleaner way to register pepper plugins with the NPAPI PluginList,
424 // or perhaps refactor the PluginList to be less specific to NPAPI. 425 // or perhaps refactor the PluginList to be less specific to NPAPI.
425 memset(&info.entry_points, 0, sizeof(info.entry_points)); 426 memset(&info.entry_points, 0, sizeof(info.entry_points));
426 427
427 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); 428 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info);
428 } 429 }
429 } 430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698