| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/permissions/permission_context_base.h" | 5 #include "chrome/browser/permissions/permission_context_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 10 #include "chrome/browser/permissions/permission_context_uma_util.h" | 10 #include "chrome/browser/permissions/permission_context_uma_util.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 if (IsRestrictedToSecureOrigins() && | 147 if (IsRestrictedToSecureOrigins() && |
| 148 !content::IsOriginSecure(requesting_origin)) { | 148 !content::IsOriginSecure(requesting_origin)) { |
| 149 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 149 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 150 false /* persist */, CONTENT_SETTING_BLOCK); | 150 false /* persist */, CONTENT_SETTING_BLOCK); |
| 151 return; | 151 return; |
| 152 } | 152 } |
| 153 | 153 |
| 154 ContentSetting content_setting = | 154 ContentSetting content_setting = |
| 155 HostContentSettingsMapFactory::GetForProfile(profile_) | 155 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 156 ->GetContentSettingAndMaybeUpdateLastUsage( | 156 ->GetContentSetting( |
| 157 requesting_origin, embedding_origin, permission_type_, | 157 requesting_origin, embedding_origin, permission_type_, |
| 158 std::string()); | 158 std::string()); |
| 159 | 159 |
| 160 if (content_setting == CONTENT_SETTING_ALLOW || | 160 if (content_setting == CONTENT_SETTING_ALLOW || |
| 161 content_setting == CONTENT_SETTING_BLOCK) { | 161 content_setting == CONTENT_SETTING_BLOCK) { |
| 162 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 162 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 163 false /* persist */, content_setting); | 163 false /* persist */, content_setting); |
| 164 return; | 164 return; |
| 165 } | 165 } |
| 166 | 166 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 permission_type_, std::string(), content_setting); | 286 permission_type_, std::string(), content_setting); |
| 287 } | 287 } |
| 288 | 288 |
| 289 bool PermissionContextBase::IsPermissionKillSwitchOn() const { | 289 bool PermissionContextBase::IsPermissionKillSwitchOn() const { |
| 290 const std::string param = | 290 const std::string param = |
| 291 variations::GetVariationParamValue(kPermissionsKillSwitchFieldStudy, | 291 variations::GetVariationParamValue(kPermissionsKillSwitchFieldStudy, |
| 292 PermissionUtil::GetPermissionString(permission_type_)); | 292 PermissionUtil::GetPermissionString(permission_type_)); |
| 293 | 293 |
| 294 return param == kPermissionsKillSwitchBlockedValue; | 294 return param == kPermissionsKillSwitchBlockedValue; |
| 295 } | 295 } |
| OLD | NEW |