diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 15:33:45 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 15:33:45 +0000 |
commit | f7be2cbadb7d6f2f96ea6a836f70961640bdb5e6 (patch) | |
tree | 14a6c5f61d11697047bb0d6a08625271f314fe45 /chrome/renderer/chrome_content_renderer_client.cc | |
parent | 411f5d0bcab149cbea4c482a06bfd7c851a71c7d (diff) | |
download | chromium_src-f7be2cbadb7d6f2f96ea6a836f70961640bdb5e6.zip chromium_src-f7be2cbadb7d6f2f96ea6a836f70961640bdb5e6.tar.gz chromium_src-f7be2cbadb7d6f2f96ea6a836f70961640bdb5e6.tar.bz2 |
Reland r101269: Store plug-in enabled/disabled state in PluginPrefs instead of WebPluginInfo, to allow different sets of enabled/disabled plug-ins to be specified per profile.
The relanded version fixes GViewRequestInterceptorTest on ChromeOS and a memory leak in PluginListTest.GetPluginGroup.
Original review URL: http://codereview.chromium.org/7848025
TBR=jam@chromium.org
BUG=80794
TEST=Open two profiles, disable different plugins in them.
Review URL: http://codereview.chromium.org/7904009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/chrome_content_renderer_client.cc')
-rw-r--r-- | chrome/renderer/chrome_content_renderer_client.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index e8c6d57..5b64ee4 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -331,9 +331,8 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl( return NULL; } - const webkit::npapi::PluginGroup* group = - webkit::npapi::PluginList::Singleton()->GetPluginGroup(info); - DCHECK(group != NULL); + scoped_ptr<webkit::npapi::PluginGroup> group( + webkit::npapi::PluginList::Singleton()->GetPluginGroup(info)); ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; std::string resource; @@ -356,14 +355,14 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl( ContentSetting outdated_policy = CONTENT_SETTING_ASK; ContentSetting authorize_policy = CONTENT_SETTING_ASK; - if (group->IsVulnerable() || group->RequiresAuthorization()) { + if (group->IsVulnerable(info) || group->RequiresAuthorization(info)) { // These policies are dynamic and can changed at runtime, so they aren't // cached here. render_view->Send(new ChromeViewHostMsg_GetPluginPolicies( &outdated_policy, &authorize_policy)); } - if (group->IsVulnerable()) { + if (group->IsVulnerable(info)) { if (outdated_policy == CONTENT_SETTING_ASK || outdated_policy == CONTENT_SETTING_BLOCK) { if (outdated_policy == CONTENT_SETTING_ASK) { @@ -383,7 +382,7 @@ WebPlugin* ChromeContentRendererClient::CreatePluginImpl( ContentSetting host_setting = observer->GetContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS); - if (group->RequiresAuthorization() && + if (group->RequiresAuthorization(info) && authorize_policy == CONTENT_SETTING_ASK && (plugin_setting == CONTENT_SETTING_ALLOW || plugin_setting == CONTENT_SETTING_ASK) && |