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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Loading... | |
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(); | |
jam
2011/01/19 20:22:09
I think we want to avoid reloading the plugins fro
pastarmovj
2011/01/19 23:39:17
If we don't do that here policy changes during the
jam
2011/01/20 00:24:25
I see, I didn't know that the UI always marks it f
| |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 #if defined(OS_LINUX) | 482 #if defined(OS_LINUX) |
482 // static | 483 // static |
483 void PluginService::RegisterFilePathWatcher( | 484 void PluginService::RegisterFilePathWatcher( |
484 FilePathWatcher *watcher, | 485 FilePathWatcher *watcher, |
485 const FilePath& path, | 486 const FilePath& path, |
486 FilePathWatcher::Delegate* delegate) { | 487 FilePathWatcher::Delegate* delegate) { |
487 bool result = watcher->Watch(path, delegate); | 488 bool result = watcher->Watch(path, delegate); |
488 DCHECK(result); | 489 DCHECK(result); |
489 } | 490 } |
490 #endif | 491 #endif |
OLD | NEW |