From 74b8d3e4e52a6419a98ecc40b6f6710f7911726d Mon Sep 17 00:00:00 2001 From: "bauerb@chromium.org" Date: Tue, 21 Sep 2010 15:00:34 +0000 Subject: Add a unique identifier for plugin groups and use it to identify blocked plugins. Currently we use the plugin path as identifier for per-plugin content settings, which is not stable across Chrome updates or plugin moves. The new identifier is either hardcoded (for predefined plugin groups), or the filename without path. BUG=39252 TEST=none Review URL: http://codereview.chromium.org/3384014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60054 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_view.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'chrome/renderer') diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 9e33f83..17e5a34 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2373,7 +2373,7 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, if (!found) return NULL; - scoped_ptr group(PluginGroup::FindHardcodedPluginGroup(info)); + scoped_ptr group(PluginGroup::CopyOrCreatePluginGroup(info)); group->AddPlugin(info, 0); if (!info.enabled) { @@ -2389,13 +2389,8 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, if (info.path.value() != kDefaultPluginLibraryName) { std::string resource; - if (cmd->HasSwitch(switches::kEnableResourceContentSettings)) { -#if defined(OS_POSIX) - resource = info.path.value(); -#elif defined(OS_WIN) - resource = base::SysWideToUTF8(info.path.value()); -#endif - } + if (cmd->HasSwitch(switches::kEnableResourceContentSettings)) + resource = group->identifier(); if (setting == CONTENT_SETTING_BLOCK) { DCHECK(!cmd->HasSwitch(switches::kDisableClickToPlay)); DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, resource); -- cgit v1.1