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 14 matching lines...) Expand all Loading... |
25 std::string provider_id; | 25 std::string provider_id; |
26 host_content_settings_map->GetDefaultContentSetting( | 26 host_content_settings_map->GetDefaultContentSetting( |
27 CONTENT_SETTINGS_TYPE_PLUGINS, &provider_id); | 27 CONTENT_SETTINGS_TYPE_PLUGINS, &provider_id); |
28 return provider_id == site_settings::kPolicyProviderId; | 28 return provider_id == site_settings::kPolicyProviderId; |
29 } | 29 } |
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, | |
36 CONTENT_SETTINGS_TYPE_PLUGINS) {} | 35 CONTENT_SETTINGS_TYPE_PLUGINS) {} |
37 | 36 |
38 FlashPermissionContext::~FlashPermissionContext() {} | 37 FlashPermissionContext::~FlashPermissionContext() {} |
39 | 38 |
40 ContentSetting FlashPermissionContext::GetPermissionStatusInternal( | 39 ContentSetting FlashPermissionContext::GetPermissionStatusInternal( |
41 const GURL& requesting_origin, | 40 const GURL& requesting_origin, |
42 const GURL& embedding_origin) const { | 41 const GURL& embedding_origin) const { |
43 HostContentSettingsMap* host_content_settings_map = | 42 HostContentSettingsMap* host_content_settings_map = |
44 HostContentSettingsMapFactory::GetForProfile(profile()); | 43 HostContentSettingsMapFactory::GetForProfile(profile()); |
45 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( | 44 ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 else | 96 else |
98 pattern = ContentSettingsPattern::FromURLNoWildcard(embedding_origin); | 97 pattern = ContentSettingsPattern::FromURLNoWildcard(embedding_origin); |
99 host_content_settings_map->SetContentSettingCustomScope( | 98 host_content_settings_map->SetContentSettingCustomScope( |
100 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(), | 99 pattern, ContentSettingsPattern::Wildcard(), content_settings_type(), |
101 std::string(), content_setting); | 100 std::string(), content_setting); |
102 } | 101 } |
103 | 102 |
104 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const { | 103 bool FlashPermissionContext::IsRestrictedToSecureOrigins() const { |
105 return false; | 104 return false; |
106 } | 105 } |
OLD | NEW |