| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 | 286 |
| 287 void PermissionContextBase::UpdateContentSetting( | 287 void PermissionContextBase::UpdateContentSetting( |
| 288 const GURL& requesting_origin, | 288 const GURL& requesting_origin, |
| 289 const GURL& embedding_origin, | 289 const GURL& embedding_origin, |
| 290 ContentSetting content_setting) { | 290 ContentSetting content_setting) { |
| 291 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin()); | 291 DCHECK_EQ(requesting_origin, requesting_origin.GetOrigin()); |
| 292 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin()); | 292 DCHECK_EQ(embedding_origin, embedding_origin.GetOrigin()); |
| 293 DCHECK(content_setting == CONTENT_SETTING_ALLOW || | 293 DCHECK(content_setting == CONTENT_SETTING_ALLOW || |
| 294 content_setting == CONTENT_SETTING_BLOCK); | 294 content_setting == CONTENT_SETTING_BLOCK); |
| 295 DCHECK(!requesting_origin.SchemeIsFile()); |
| 296 DCHECK(!embedding_origin.SchemeIsFile()); |
| 295 | 297 |
| 296 HostContentSettingsMapFactory::GetForProfile(profile_) | 298 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 297 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, | 299 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, |
| 298 content_settings_type_, std::string(), | 300 content_settings_type_, std::string(), |
| 299 content_setting); | 301 content_setting); |
| 300 } | 302 } |
| 301 | 303 |
| 302 bool PermissionContextBase::IsPermissionKillSwitchOn() const { | 304 bool PermissionContextBase::IsPermissionKillSwitchOn() const { |
| 303 const std::string param = variations::GetVariationParamValue( | 305 const std::string param = variations::GetVariationParamValue( |
| 304 kPermissionsKillSwitchFieldStudy, | 306 kPermissionsKillSwitchFieldStudy, |
| 305 PermissionUtil::GetPermissionString(permission_type_)); | 307 PermissionUtil::GetPermissionString(permission_type_)); |
| 306 | 308 |
| 307 return param == kPermissionsKillSwitchBlockedValue; | 309 return param == kPermissionsKillSwitchBlockedValue; |
| 308 } | 310 } |
| OLD | NEW |