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

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: Make win and mac compilers happy. 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 297
298 void PluginService::GetAllowedPluginForOpenChannelToPlugin( 298 void PluginService::GetAllowedPluginForOpenChannelToPlugin(
299 const GURL& url, 299 const GURL& url,
300 const std::string& mime_type, 300 const std::string& mime_type,
301 PluginProcessHost::Client* client) { 301 PluginProcessHost::Client* client) {
302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
303 webkit::npapi::WebPluginInfo info; 303 webkit::npapi::WebPluginInfo info;
304 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL); 304 bool found = GetFirstAllowedPluginInfo(url, mime_type, &info, NULL);
305 FilePath plugin_path; 305 FilePath plugin_path;
306 if (found && info.enabled) 306 if (found && webkit::npapi::IsPluginEnabled(info))
307 plugin_path = FilePath(info.path); 307 plugin_path = FilePath(info.path);
308 308
309 // Now we jump back to the IO thread to finish opening the channel. 309 // Now we jump back to the IO thread to finish opening the channel.
310 BrowserThread::PostTask( 310 BrowserThread::PostTask(
311 BrowserThread::IO, FROM_HERE, 311 BrowserThread::IO, FROM_HERE,
312 NewRunnableMethod( 312 NewRunnableMethod(
313 this, &PluginService::FinishOpenChannelToPlugin, 313 this, &PluginService::FinishOpenChannelToPlugin,
314 plugin_path, client)); 314 plugin_path, client));
315 } 315 }
316 316
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 #if defined(OS_MACOSX) 425 #if defined(OS_MACOSX)
426 case NotificationType::APP_ACTIVATED: { 426 case NotificationType::APP_ACTIVATED: {
427 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 427 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
428 NewRunnableFunction(&NotifyPluginsOfActivation)); 428 NewRunnableFunction(&NotifyPluginsOfActivation));
429 break; 429 break;
430 } 430 }
431 #endif 431 #endif
432 432
433 case NotificationType::PLUGIN_ENABLE_STATUS_CHANGED: { 433 case NotificationType::PLUGIN_ENABLE_STATUS_CHANGED: {
434 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
434 PurgePluginListCache(false); 435 PurgePluginListCache(false);
435 break; 436 break;
436 } 437 }
437 default: 438 default:
438 NOTREACHED(); 439 NOTREACHED();
439 } 440 }
440 } 441 }
441 442
442 bool PluginService::PrivatePluginAllowedForURL(const FilePath& plugin_path, 443 bool PluginService::PrivatePluginAllowedForURL(const FilePath& plugin_path,
443 const GURL& url) { 444 const GURL& url) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 #if defined(OS_LINUX) 487 #if defined(OS_LINUX)
487 // static 488 // static
488 void PluginService::RegisterFilePathWatcher( 489 void PluginService::RegisterFilePathWatcher(
489 FilePathWatcher *watcher, 490 FilePathWatcher *watcher,
490 const FilePath& path, 491 const FilePath& path,
491 FilePathWatcher::Delegate* delegate) { 492 FilePathWatcher::Delegate* delegate) {
492 bool result = watcher->Watch(path, delegate); 493 bool result = watcher->Watch(path, delegate);
493 DCHECK(result); 494 DCHECK(result);
494 } 495 }
495 #endif 496 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698