diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 22:47:27 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 22:47:27 +0000 |
commit | 388dd3a1688b3af37e804966fadfe83e6d46abc9 (patch) | |
tree | 35ece93cfa05154f7e3d542db2f4a0e03b4c804e /chrome/browser/dom_ui/plugins_ui.cc | |
parent | 018cf36471451716c1fa14b99d7b2bbf780c883d (diff) | |
download | chromium_src-388dd3a1688b3af37e804966fadfe83e6d46abc9.zip chromium_src-388dd3a1688b3af37e804966fadfe83e6d46abc9.tar.gz chromium_src-388dd3a1688b3af37e804966fadfe83e6d46abc9.tar.bz2 |
Make disabled internal plugins stay disabled even when the version of Chrome changes.
This change is a bit hacky, but the proper change is to re-factor the plugins
stuff (and such a change wouldn't be M5-able).
BUG=42393
TEST=On Chrome with this CL, disable internal Flash. Update Chrome to a newer version (also with this CL). Check that internal Flash remains disabled. (Or hack the prefs file to test manually....)
Review URL: http://codereview.chromium.org/1969007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/plugins_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/plugins_ui.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/plugins_ui.cc b/chrome/browser/dom_ui/plugins_ui.cc index fcaf606..77cb0d4 100644 --- a/chrome/browser/dom_ui/plugins_ui.cc +++ b/chrome/browser/dom_ui/plugins_ui.cc @@ -11,6 +11,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/message_loop.h" +#include "base/path_service.h" #include "base/singleton.h" #include "base/values.h" #include "chrome/browser/browser.h" @@ -19,6 +20,7 @@ #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -258,9 +260,16 @@ DictionaryValue* PluginsDOMHandler::CreatePluginSummaryValue( return plugin_data; } +// TODO(viettrungluu): move this (and the registration of the prefs into the +// plugins service. void PluginsDOMHandler::UpdatePreferences() { - ListValue* plugins_list = dom_ui_->GetProfile()->GetPrefs()->GetMutableList( - prefs::kPluginsPluginsList); + PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); + + FilePath internal_dir; + if (PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir)) + prefs->SetFilePath(prefs::kPluginsLastInternalDirectory, internal_dir); + + ListValue* plugins_list = prefs->GetMutableList(prefs::kPluginsPluginsList); plugins_list->Clear(); std::vector<WebPluginInfo> plugins; @@ -303,5 +312,10 @@ RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { // static void PluginsUI::RegisterUserPrefs(PrefService* prefs) { + FilePath internal_dir; + PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); + prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, + internal_dir); + prefs->RegisterListPref(prefs::kPluginsPluginsList); } |