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

Side by Side Diff: chrome/browser/plugins/flash_permission_context.cc

Issue 2408613002: Replace kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… (Closed)
Patch Set: Replace remaining kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/plugins/flash_permission_context.h" 5 #include "chrome/browser/plugins/flash_permission_context.h"
6 6
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/permissions/permission_request_id.h" 8 #include "chrome/browser/permissions/permission_request_id.h"
9 #include "chrome/browser/plugins/plugin_utils.h" 9 #include "chrome/browser/plugins/plugin_utils.h"
10 #include "chrome/browser/plugins/plugins_field_trial.h" 10 #include "chrome/browser/plugins/plugins_field_trial.h"
11 #include "components/content_settings/core/browser/host_content_settings_map.h" 11 #include "components/content_settings/core/browser/host_content_settings_map.h"
12 #include "components/content_settings/core/common/content_settings_pattern.h" 12 #include "components/content_settings/core/common/content_settings_pattern.h"
13 #include "content/public/browser/navigation_controller.h" 13 #include "content/public/browser/navigation_controller.h"
14 #include "content/public/browser/render_frame_host.h" 14 #include "content/public/browser/render_frame_host.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 #include "url/origin.h" 16 #include "url/origin.h"
17 17
18 FlashPermissionContext::FlashPermissionContext(Profile* profile) 18 FlashPermissionContext::FlashPermissionContext(Profile* profile)
19 : PermissionContextBase(profile, 19 : PermissionContextBase(profile,
20 content::PermissionType::FLASH, 20 content::PermissionType::FLASH,
21 CONTENT_SETTINGS_TYPE_PLUGINS) {} 21 CONTENT_SETTINGS_TYPE_PLUGINS) {}
22 22
23 FlashPermissionContext::~FlashPermissionContext() {} 23 FlashPermissionContext::~FlashPermissionContext() {}
24 24
25 ContentSetting FlashPermissionContext::GetPermissionStatus( 25 ContentSetting FlashPermissionContext::GetPermissionStatus(
26 const GURL& requesting_origin, 26 const GURL& requesting_origin,
27 const GURL& embedding_origin) const { 27 const GURL& embedding_origin) const {
28 HostContentSettingsMap* host_content_settings_map =
29 HostContentSettingsMapFactory::GetForProfile(profile());
28 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( 30 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
29 HostContentSettingsMapFactory::GetForProfile(profile()), 31 host_content_settings_map, url::Origin(embedding_origin),
30 url::Origin(embedding_origin), requesting_origin, nullptr); 32 requesting_origin, nullptr);
31 flash_setting = PluginsFieldTrial::EffectiveContentSetting( 33 flash_setting = PluginsFieldTrial::EffectiveContentSetting(
32 CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting); 34 host_content_settings_map, CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting);
33 if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) 35 if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT)
34 return CONTENT_SETTING_ASK; 36 return CONTENT_SETTING_ASK;
35 return flash_setting; 37 return flash_setting;
36 } 38 }
37 39
38 void FlashPermissionContext::UpdateTabContext(const PermissionRequestID& id, 40 void FlashPermissionContext::UpdateTabContext(const PermissionRequestID& id,
39 const GURL& requesting_origin, 41 const GURL& requesting_origin,
40 bool allowed) { 42 bool allowed) {
41 if (!allowed) 43 if (!allowed)
42 return; 44 return;
(...skipping 23 matching lines...) Expand all
66 68
67 HostContentSettingsMapFactory::GetForProfile(profile()) 69 HostContentSettingsMapFactory::GetForProfile(profile())
68 ->SetContentSettingCustomScope( 70 ->SetContentSettingCustomScope(
69 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(), 71 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(),
70 std::string(), content_setting); 72 std::string(), content_setting);
71 } 73 }
72 74
73 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const { 75 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const {
74 return false; 76 return false;
75 } 77 }
OLDNEW
« no previous file with comments | « chrome/browser/plugins/flash_download_interception.cc ('k') | chrome/browser/plugins/plugin_info_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698