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

Unified Diff: chrome/browser/plugin_service.cc

Issue 1991005: (1) Group plugins with the same name together. (2) Show a download link for p... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 7 months 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/dom_ui/plugins_ui.cc ('k') | chrome/browser/plugin_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_service.cc
===================================================================
--- chrome/browser/plugin_service.cc (revision 46737)
+++ chrome/browser/plugin_service.cc (working copy)
@@ -17,6 +17,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/plugin_process_host.h"
+#include "chrome/browser/plugin_updater.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
@@ -56,43 +57,9 @@
void PluginService::InitGlobalInstance(Profile* profile) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- bool update_internal_dir = false;
- FilePath last_internal_dir =
- profile->GetPrefs()->GetFilePath(prefs::kPluginsLastInternalDirectory);
- FilePath cur_internal_dir;
- if (PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &cur_internal_dir))
- update_internal_dir = (cur_internal_dir != last_internal_dir);
+ // We first group the plugins and then figure out which groups to disable.
+ PluginUpdater::GetInstance()->DisablePluginGroupsFromPrefs(profile);
- // Disable plugins listed as disabled in prefs.
- if (const ListValue* saved_plugins_list =
- profile->GetPrefs()->GetList(prefs::kPluginsPluginsList)) {
- for (ListValue::const_iterator it = saved_plugins_list->begin();
- it != saved_plugins_list->end();
- ++it) {
- if (!(*it)->IsType(Value::TYPE_DICTIONARY)) {
- LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList;
- continue; // Oops, don't know what to do with this item.
- }
-
- DictionaryValue* plugin = static_cast<DictionaryValue*>(*it);
- FilePath::StringType path;
- bool enabled = true;
- plugin->GetBoolean(L"enabled", &enabled);
- if (!enabled && plugin->GetString(L"path", &path)) {
- FilePath plugin_path(path);
- NPAPI::PluginList::Singleton()->DisablePlugin(plugin_path);
-
- // If the internal plugin directory has changed and if the plugin looks
- // internal, also disable it in the current internal plugins directory.
- if (update_internal_dir &&
- plugin_path.DirName() == last_internal_dir) {
- NPAPI::PluginList::Singleton()->DisablePlugin(
- cur_internal_dir.Append(plugin_path.BaseName()));
- }
- }
- }
- }
-
// Have Chrome plugins write their data to the profile directory.
GetInstance()->SetChromePluginDataDir(profile->GetPath());
}
« no previous file with comments | « chrome/browser/dom_ui/plugins_ui.cc ('k') | chrome/browser/plugin_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698