OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_prefs.h" | 5 #include "chrome/browser/plugin_prefs.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 const std::set<string16>& disabled_exception_patterns, | 473 const std::set<string16>& disabled_exception_patterns, |
474 const std::set<string16>& enabled_patterns) { | 474 const std::set<string16>& enabled_patterns) { |
475 policy_disabled_plugin_patterns_ = disabled_patterns; | 475 policy_disabled_plugin_patterns_ = disabled_patterns; |
476 policy_disabled_plugin_exception_patterns_ = disabled_exception_patterns; | 476 policy_disabled_plugin_exception_patterns_ = disabled_exception_patterns; |
477 policy_enabled_plugin_patterns_ = enabled_patterns; | 477 policy_enabled_plugin_patterns_ = enabled_patterns; |
478 } | 478 } |
479 | 479 |
480 webkit::npapi::PluginList* PluginPrefs::GetPluginList() { | 480 webkit::npapi::PluginList* PluginPrefs::GetPluginList() { |
481 if (plugin_list_) | 481 if (plugin_list_) |
482 return plugin_list_; | 482 return plugin_list_; |
483 return webkit::npapi::PluginList::Singleton(); | 483 return PluginService::GetInstance()->plugin_list(); |
484 } | 484 } |
485 | 485 |
486 void PluginPrefs::GetPreferencesDataOnFileThread() { | 486 void PluginPrefs::GetPreferencesDataOnFileThread() { |
487 std::vector<webkit::npapi::PluginGroup> groups; | 487 std::vector<webkit::npapi::PluginGroup> groups; |
488 | 488 |
489 webkit::npapi::PluginList* plugin_list = GetPluginList(); | 489 webkit::npapi::PluginList* plugin_list = GetPluginList(); |
490 plugin_list->GetPluginGroups(false, &groups); | 490 plugin_list->GetPluginGroups(false, &groups); |
491 | 491 |
492 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 492 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
493 base::Bind(&PluginPrefs::OnUpdatePreferences, this, groups)); | 493 base::Bind(&PluginPrefs::OnUpdatePreferences, this, groups)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 void PluginPrefs::NotifyPluginStatusChanged() { | 543 void PluginPrefs::NotifyPluginStatusChanged() { |
544 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 544 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
545 content::NotificationService::current()->Notify( | 545 content::NotificationService::current()->Notify( |
546 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 546 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
547 content::Source<Profile>(profile_), | 547 content::Source<Profile>(profile_), |
548 content::NotificationService::NoDetails()); | 548 content::NotificationService::NoDetails()); |
549 } | 549 } |
OLD | NEW |