| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 permission == PermissionType::AUDIO_CAPTURE || | 350 permission == PermissionType::AUDIO_CAPTURE || |
| 351 permission == PermissionType::VIDEO_CAPTURE) { | 351 permission == PermissionType::VIDEO_CAPTURE) { |
| 352 // An unknown gesture type is passed in since gesture type is only | 352 // An unknown gesture type is passed in since gesture type is only |
| 353 // applicable in prompt UIs where revocations are not possible. | 353 // applicable in prompt UIs where revocations are not possible. |
| 354 RecordPermissionAction(permission, REVOKED, source_ui, | 354 RecordPermissionAction(permission, REVOKED, source_ui, |
| 355 PermissionRequestGestureType::UNKNOWN, | 355 PermissionRequestGestureType::UNKNOWN, |
| 356 revoked_origin, profile); | 356 revoked_origin, profile); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 void PermissionUmaUtil::RecordPermissionEmbargoStatus( |
| 361 PermissionEmbargoStatus embargo_status) { |
| 362 UMA_HISTOGRAM_ENUMERATION("Permissions.AutoBlocker.EmbargoStatus", |
| 363 embargo_status, |
| 364 PermissionEmbargoStatus::STATUS_NUM); |
| 365 } |
| 366 |
| 360 void PermissionUmaUtil::PermissionPromptShown( | 367 void PermissionUmaUtil::PermissionPromptShown( |
| 361 const std::vector<PermissionRequest*>& requests) { | 368 const std::vector<PermissionRequest*>& requests) { |
| 362 DCHECK(!requests.empty()); | 369 DCHECK(!requests.empty()); |
| 363 | 370 |
| 364 PermissionRequestType permission_prompt_type = | 371 PermissionRequestType permission_prompt_type = |
| 365 PermissionRequestType::MULTIPLE; | 372 PermissionRequestType::MULTIPLE; |
| 366 PermissionRequestGestureType permission_gesture_type = | 373 PermissionRequestGestureType permission_gesture_type = |
| 367 PermissionRequestGestureType::UNKNOWN; | 374 PermissionRequestGestureType::UNKNOWN; |
| 368 if (requests.size() == 1) { | 375 if (requests.size() == 1) { |
| 369 permission_prompt_type = requests[0]->GetPermissionRequestType(); | 376 permission_prompt_type = requests[0]->GetPermissionRequestType(); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 if (!deprecated_metric.empty() && rappor_service) { | 723 if (!deprecated_metric.empty() && rappor_service) { |
| 717 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, | 724 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, |
| 718 requesting_origin); | 725 requesting_origin); |
| 719 | 726 |
| 720 std::string rappor_metric = deprecated_metric + "2"; | 727 std::string rappor_metric = deprecated_metric + "2"; |
| 721 rappor_service->RecordSampleString( | 728 rappor_service->RecordSampleString( |
| 722 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, | 729 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, |
| 723 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); | 730 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); |
| 724 } | 731 } |
| 725 } | 732 } |
| OLD | NEW |