summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugins/plugin_prefs.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 19:01:47 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 19:01:47 +0000
commitfb476a2653613edf0ce08654b67df3df8dcd5bda (patch)
tree88123b9bf3f105d672abfd79c27794cbde5226cd /chrome/browser/plugins/plugin_prefs.cc
parenta47fa686c1a9464a97a348455a51268e002290e8 (diff)
downloadchromium_src-fb476a2653613edf0ce08654b67df3df8dcd5bda.zip
chromium_src-fb476a2653613edf0ce08654b67df3df8dcd5bda.tar.gz
chromium_src-fb476a2653613edf0ce08654b67df3df8dcd5bda.tar.bz2
Remove the two years old code to enable the nacl plugin once if it's disabled. This was added to deal with old profiles when we had the plugin disabled by default. There have been 15 releases in the meantime, which is enough chances to update this pref.
This is in preparation for moving webkit/plugins to content/. BUG=237249 R=bauerb@chromium.org Review URL: https://codereview.chromium.org/19518006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugins/plugin_prefs.cc')
-rw-r--r--chrome/browser/plugins/plugin_prefs.cc74
1 files changed, 3 insertions, 71 deletions
diff --git a/chrome/browser/plugins/plugin_prefs.cc b/chrome/browser/plugins/plugin_prefs.cc
index 7776592..555c3fe 100644
--- a/chrome/browser/plugins/plugin_prefs.cc
+++ b/chrome/browser/plugins/plugin_prefs.cc
@@ -31,7 +31,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
-#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/webplugininfo.h"
using content::BrowserThread;
@@ -39,10 +38,6 @@ using content::PluginService;
namespace {
-// How long to wait to save the plugin enabled information, which might need to
-// go to disk.
-const int64 kPluginUpdateDelayMs = 60 * 1000;
-
bool IsComponentUpdatedPepperFlash(const base::FilePath& plugin) {
if (plugin.BaseName().value() == chrome::kPepperFlashPluginFilename) {
base::FilePath component_updated_pepper_flash_dir;
@@ -106,11 +101,6 @@ scoped_refptr<PluginPrefs> PluginPrefs::GetForTestingProfile(
profile, &PluginPrefsFactory::CreateForTestingProfile).get());
}
-void PluginPrefs::SetPluginListForTesting(
- webkit::npapi::PluginList* plugin_list) {
- plugin_list_ = plugin_list;
-}
-
void PluginPrefs::EnablePluginGroup(bool enabled, const string16& group_name) {
PluginService::GetInstance()->GetPlugins(
base::Bind(&PluginPrefs::EnablePluginGroupInternal,
@@ -326,24 +316,6 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
prefs::kPluginsLastInternalDirectory, cur_internal_dir);
}
- bool force_enable_nacl = false;
- string16 nacl_group_name =
- ASCIIToUTF16(chrome::ChromeContentClient::kNaClPluginName);
- // Since the NaCl Plugin changed names between Chrome 13 and 14, we need to
- // check for both because either could be stored as the plugin group name.
- string16 old_nacl_group_name =
- ASCIIToUTF16(chrome::ChromeContentClient::kNaClOldPluginName);
- base::FilePath nacl_path;
- PathService::Get(chrome::FILE_NACL_PLUGIN, &nacl_path);
- base::FilePath::StringType nacl_path_str = nacl_path.value();
- if (!prefs_->GetBoolean(prefs::kPluginsEnabledNaCl)) {
- // We switched to the nacl plugin being on by default, and so we need to
- // force it to be enabled. We only want to do it this once though, i.e.
- // we don't want to enable it again if the user disables it afterwards.
- prefs_->SetBoolean(prefs::kPluginsEnabledNaCl, true);
- force_enable_nacl = true;
- }
-
bool migrate_to_pepper_flash = false;
#if defined(OS_WIN) || defined(OS_MACOSX)
// If bundled NPAPI Flash is enabled while Pepper Flash is disabled, we
@@ -449,12 +421,7 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
}
}
- if (base::FilePath::CompareIgnoreCase(path, nacl_path_str) == 0) {
- if (!enabled && force_enable_nacl) {
- enabled = true;
- plugin->SetBoolean("enabled", true);
- }
- } else if (migrate_to_pepper_flash &&
+ if (migrate_to_pepper_flash &&
base::FilePath::CompareEqualIgnoreCase(
path, npapi_flash.value())) {
npapi_flash_enabled = enabled;
@@ -474,12 +441,6 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
plugin_state_.Set(plugin_path, enabled);
} else if (!enabled && plugin->GetString("name", &group_name)) {
- // Don't disable this group if it's for the nacl plugin and we just
- // forced it on.
- if (force_enable_nacl && (nacl_group_name == group_name ||
- old_nacl_group_name == group_name))
- continue;
-
// Otherwise this is a list of groups.
plugin_group_state_[group_name] = false;
}
@@ -498,9 +459,7 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
} else {
// If the saved plugin list is empty, then the call to UpdatePreferences()
// below failed in an earlier run, possibly because the user closed the
- // browser too quickly. Try to force enable the internal nacl plugin
- // again.
- force_enable_nacl = true;
+ // browser too quickly.
// Only want one PDF plugin enabled at a time. See http://crbug.com/50105
// for background.
@@ -538,17 +497,6 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
base::Unretained(this),
&policy_enabled_plugin_patterns_));
- if (force_enable_nacl) {
- // We want to save this, but doing so requires loading the list of plugins,
- // so do it after a minute as to not impact startup performance. Note that
- // plugins are loaded after 30s by the metrics service.
- BrowserThread::PostDelayedTask(
- BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&PluginPrefs::GetPreferencesDataOnFileThread, this),
- base::TimeDelta::FromMilliseconds(kPluginUpdateDelayMs));
- }
-
NotifyPluginStatusChanged();
}
@@ -558,8 +506,7 @@ void PluginPrefs::ShutdownOnUIThread() {
}
PluginPrefs::PluginPrefs() : profile_(NULL),
- prefs_(NULL),
- plugin_list_(NULL) {
+ prefs_(NULL) {
}
PluginPrefs::~PluginPrefs() {
@@ -574,21 +521,6 @@ void PluginPrefs::SetPolicyEnforcedPluginPatterns(
policy_enabled_plugin_patterns_ = enabled_patterns;
}
-webkit::npapi::PluginList* PluginPrefs::GetPluginList() const {
- if (plugin_list_)
- return plugin_list_;
- return PluginService::GetInstance()->GetPluginList();
-}
-
-void PluginPrefs::GetPreferencesDataOnFileThread() {
- std::vector<webkit::WebPluginInfo> plugins;
- webkit::npapi::PluginList* plugin_list = GetPluginList();
- plugin_list->GetPluginsNoRefresh(&plugins);
-
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&PluginPrefs::OnUpdatePreferences, this, plugins));
-}
-
void PluginPrefs::OnUpdatePreferences(
const std::vector<webkit::WebPluginInfo>& plugins) {
if (!prefs_)