From a027e512621b7aa1ec09a28864d67e24f99b5ef3 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 21 Jun 2011 03:57:05 +0000 Subject: Plugins: Force enable the internal PDF plugin if there is no saved plugin list. BUG=86256 TEST=Run chrome with a new profile; immediately close chrome; launch chrome and visit about:plugins and make sure there's only 1 PDF plugin enabled. Review URL: http://codereview.chromium.org/7189077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89790 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/plugin_updater.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index 6033c73..afe399d 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -157,7 +157,7 @@ void PluginUpdater::SetProfile(Profile* profile) { { // Scoped update of prefs::kPluginsPluginsList. ListPrefUpdate update(profile->GetPrefs(), prefs::kPluginsPluginsList); ListValue* saved_plugins_list = update.Get(); - if (saved_plugins_list) { + if (saved_plugins_list && !saved_plugins_list->empty()) { for (ListValue::const_iterator it = saved_plugins_list->begin(); it != saved_plugins_list->end(); ++it) { @@ -208,6 +208,11 @@ void PluginUpdater::SetProfile(Profile* profile) { EnablePluginGroup(false, group_name); } } + } 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 PDF plugin again. + force_enable_internal_pdf = true; } } // Scoped update of prefs::kPluginsPluginsList. -- cgit v1.1