| 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;
|
|
|