| OLD | NEW |
| 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/flash_temporary_permission_tracker.h" | 9 #include "chrome/browser/plugins/flash_temporary_permission_tracker.h" |
| 10 #include "chrome/browser/plugins/plugin_utils.h" | 10 #include "chrome/browser/plugins/plugin_utils.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 FlashPermissionContext::FlashPermissionContext(Profile* profile) | 33 FlashPermissionContext::FlashPermissionContext(Profile* profile) |
| 34 : PermissionContextBase(profile, | 34 : PermissionContextBase(profile, |
| 35 content::PermissionType::FLASH, | 35 content::PermissionType::FLASH, |
| 36 CONTENT_SETTINGS_TYPE_PLUGINS) {} | 36 CONTENT_SETTINGS_TYPE_PLUGINS) {} |
| 37 | 37 |
| 38 FlashPermissionContext::~FlashPermissionContext() {} | 38 FlashPermissionContext::~FlashPermissionContext() {} |
| 39 | 39 |
| 40 ContentSetting FlashPermissionContext::GetPermissionStatus( | 40 ContentSetting FlashPermissionContext::GetPermissionStatusInternal( |
| 41 const GURL& requesting_origin, | 41 const GURL& requesting_origin, |
| 42 const GURL& embedding_origin) const { | 42 const GURL& embedding_origin) const { |
| 43 HostContentSettingsMap* host_content_settings_map = | 43 HostContentSettingsMap* host_content_settings_map = |
| 44 HostContentSettingsMapFactory::GetForProfile(profile()); | 44 HostContentSettingsMapFactory::GetForProfile(profile()); |
| 45 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( | 45 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( |
| 46 host_content_settings_map, url::Origin(embedding_origin), | 46 host_content_settings_map, url::Origin(embedding_origin), |
| 47 requesting_origin, nullptr); | 47 requesting_origin, nullptr); |
| 48 flash_setting = PluginsFieldTrial::EffectiveContentSetting( | 48 flash_setting = PluginsFieldTrial::EffectiveContentSetting( |
| 49 host_content_settings_map, content_settings_type(), flash_setting); | 49 host_content_settings_map, content_settings_type(), flash_setting); |
| 50 if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) | 50 if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 else | 97 else |
| 98 pattern = ContentSettingsPattern::FromURLNoWildcard(embedding_origin); | 98 pattern = ContentSettingsPattern::FromURLNoWildcard(embedding_origin); |
| 99 host_content_settings_map->SetContentSettingCustomScope( | 99 host_content_settings_map->SetContentSettingCustomScope( |
| 100 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(), | 100 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(), |
| 101 std::string(), content_setting); | 101 std::string(), content_setting); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const { | 104 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const { |
| 105 return false; | 105 return false; |
| 106 } | 106 } |
| OLD | NEW |