| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 const BrowserPermissionCallback& callback, | 209 const BrowserPermissionCallback& callback, |
| 210 bool persist, | 210 bool persist, |
| 211 ContentSetting content_setting) { | 211 ContentSetting content_setting) { |
| 212 #if !defined(OS_ANDROID) | 212 #if !defined(OS_ANDROID) |
| 213 // Infobar persistence and its related UMA is tracked on the infobar | 213 // Infobar persistence and its related UMA is tracked on the infobar |
| 214 // controller directly. | 214 // controller directly. |
| 215 if (persist) { | 215 if (persist) { |
| 216 DCHECK(content_setting == CONTENT_SETTING_ALLOW || | 216 DCHECK(content_setting == CONTENT_SETTING_ALLOW || |
| 217 content_setting == CONTENT_SETTING_BLOCK); | 217 content_setting == CONTENT_SETTING_BLOCK); |
| 218 if (content_setting == CONTENT_SETTING_ALLOW) | 218 if (content_setting == CONTENT_SETTING_ALLOW) |
| 219 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin, | 219 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin); |
| 220 profile_); | |
| 221 else | 220 else |
| 222 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin, | 221 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin); |
| 223 profile_); | |
| 224 } else { | 222 } else { |
| 225 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); | 223 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); |
| 226 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin, | 224 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin); |
| 227 profile_); | |
| 228 } | 225 } |
| 229 #endif | 226 #endif |
| 230 | 227 |
| 231 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 228 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 232 persist, content_setting); | 229 persist, content_setting); |
| 233 } | 230 } |
| 234 | 231 |
| 235 #if defined(OS_ANDROID) | 232 #if defined(OS_ANDROID) |
| 236 PermissionQueueController* PermissionContextBase::GetQueueController() { | 233 PermissionQueueController* PermissionContextBase::GetQueueController() { |
| 237 return permission_queue_controller_.get(); | 234 return permission_queue_controller_.get(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 content_setting); | 284 content_setting); |
| 288 } | 285 } |
| 289 | 286 |
| 290 bool PermissionContextBase::IsPermissionKillSwitchOn() const { | 287 bool PermissionContextBase::IsPermissionKillSwitchOn() const { |
| 291 const std::string param = variations::GetVariationParamValue( | 288 const std::string param = variations::GetVariationParamValue( |
| 292 kPermissionsKillSwitchFieldStudy, | 289 kPermissionsKillSwitchFieldStudy, |
| 293 PermissionUtil::GetPermissionString(permission_type_)); | 290 PermissionUtil::GetPermissionString(permission_type_)); |
| 294 | 291 |
| 295 return param == kPermissionsKillSwitchBlockedValue; | 292 return param == kPermissionsKillSwitchBlockedValue; |
| 296 } | 293 } |
| OLD | NEW |