| 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_uma_util.h" | 5 #include "chrome/browser/permissions/permission_uma_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 "Permissions.Action.SecureOrigin.DurableStorage", | 138 "Permissions.Action.SecureOrigin.DurableStorage", |
| 139 "Permissions.Action.InsecureOrigin.DurableStorage", | 139 "Permissions.Action.InsecureOrigin.DurableStorage", |
| 140 action); | 140 action); |
| 141 break; | 141 break; |
| 142 case PermissionType::AUDIO_CAPTURE: | 142 case PermissionType::AUDIO_CAPTURE: |
| 143 // Media permissions are disabled on insecure origins, so there's no | 143 // Media permissions are disabled on insecure origins, so there's no |
| 144 // need to record metrics for secure/insecue. | 144 // need to record metrics for secure/insecue. |
| 145 UMA_HISTOGRAM_ENUMERATION("Permissions.Action.AudioCapture", action, | 145 UMA_HISTOGRAM_ENUMERATION("Permissions.Action.AudioCapture", action, |
| 146 PERMISSION_ACTION_NUM); | 146 PERMISSION_ACTION_NUM); |
| 147 break; | 147 break; |
| 148 case PermissionType::BLUETOOTH_GUARD: |
| 149 // Bluetooth is disabled on insecure origins, so there's no |
| 150 // need to record metrics for secure/insecure. |
| 151 DCHECK(secure_origin); |
| 152 UMA_HISTOGRAM_ENUMERATION("Permissions.Action.BluetoothGuard", action, |
| 153 PERMISSION_ACTION_NUM); |
| 154 break; |
| 148 case PermissionType::VIDEO_CAPTURE: | 155 case PermissionType::VIDEO_CAPTURE: |
| 149 UMA_HISTOGRAM_ENUMERATION("Permissions.Action.VideoCapture", action, | 156 UMA_HISTOGRAM_ENUMERATION("Permissions.Action.VideoCapture", action, |
| 150 PERMISSION_ACTION_NUM); | 157 PERMISSION_ACTION_NUM); |
| 151 break; | 158 break; |
| 152 case PermissionType::MIDI: | 159 case PermissionType::MIDI: |
| 153 case PermissionType::NUM: | 160 case PermissionType::NUM: |
| 154 NOTREACHED() << "PERMISSION " | 161 NOTREACHED() << "PERMISSION " |
| 155 << PermissionUtil::GetPermissionString(permission) | 162 << PermissionUtil::GetPermissionString(permission) |
| 156 << " not accounted for"; | 163 << " not accounted for"; |
| 157 } | 164 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 const GURL& revoked_origin) { | 288 const GURL& revoked_origin) { |
| 282 // TODO(tsergeant): Expand metrics definitions for revocation to include all | 289 // TODO(tsergeant): Expand metrics definitions for revocation to include all |
| 283 // permissions. | 290 // permissions. |
| 284 if (permission == PermissionType::NOTIFICATIONS || | 291 if (permission == PermissionType::NOTIFICATIONS || |
| 285 permission == PermissionType::GEOLOCATION || | 292 permission == PermissionType::GEOLOCATION || |
| 286 permission == PermissionType::AUDIO_CAPTURE || | 293 permission == PermissionType::AUDIO_CAPTURE || |
| 287 permission == PermissionType::VIDEO_CAPTURE) { | 294 permission == PermissionType::VIDEO_CAPTURE) { |
| 288 RecordPermissionAction(permission, REVOKED, revoked_origin); | 295 RecordPermissionAction(permission, REVOKED, revoked_origin); |
| 289 } | 296 } |
| 290 } | 297 } |
| OLD | NEW |