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

Unified Diff: chrome/browser/plugin_prefs.cc

Issue 8515021: Move PluginPrefs to use PluginService instead of PluginList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update tests Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_prefs.h ('k') | chrome/browser/plugin_prefs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_prefs.cc
diff --git a/chrome/browser/plugin_prefs.cc b/chrome/browser/plugin_prefs.cc
index 94ecb6e232cccfeedaa2eba4003474dd8ca32028..f4923f14b890d897acbe3f46d1434d3195014094 100644
--- a/chrome/browser/plugin_prefs.cc
+++ b/chrome/browser/plugin_prefs.cc
@@ -73,17 +73,15 @@ void PluginPrefs::SetPluginListForTesting(
}
void PluginPrefs::EnablePluginGroup(bool enabled, const string16& group_name) {
- if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&PluginPrefs::EnablePluginGroup, this, enabled, group_name));
- return;
- }
-
- webkit::npapi::PluginList* plugin_list = GetPluginList();
- std::vector<webkit::npapi::PluginGroup> groups;
- plugin_list->GetPluginGroups(true, &groups);
+ PluginService::GetInstance()->GetPluginGroups(
+ base::Bind(&PluginPrefs::EnablePluginGroupInternal,
+ this, enabled, group_name));
+}
+void PluginPrefs::EnablePluginGroupInternal(
+ bool enabled,
+ const string16& group_name,
+ const std::vector<webkit::npapi::PluginGroup>& groups) {
base::AutoLock auto_lock(lock_);
// Set the desired state for the group.
@@ -124,27 +122,21 @@ bool PluginPrefs::EnablePlugin(bool enabled, const FilePath& path) {
}
}
- if (BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
- EnablePluginInternal(enabled, path);
- } else {
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&PluginPrefs::EnablePluginInternal, this, enabled, path));
- }
+ PluginService::GetInstance()->GetPluginGroups(
+ base::Bind(&PluginPrefs::EnablePluginInternal, this, enabled, path));
return true;
}
-void PluginPrefs::EnablePluginInternal(bool enabled, const FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+void PluginPrefs::EnablePluginInternal(
+ bool enabled,
+ const FilePath& path,
+ const std::vector<webkit::npapi::PluginGroup>& groups) {
{
// Set the desired state for the plug-in.
base::AutoLock auto_lock(lock_);
plugin_state_[path] = enabled;
}
- std::vector<webkit::npapi::PluginGroup> groups;
- GetPluginList()->GetPluginGroups(true, &groups);
-
bool found_group = false;
for (size_t i = 0; i < groups.size(); ++i) {
bool all_disabled = true;
« no previous file with comments | « chrome/browser/plugin_prefs.h ('k') | chrome/browser/plugin_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698