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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 permission == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 356 permission == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
357 permission == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { | 357 permission == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { |
358 // An unknown gesture type is passed in since gesture type is only | 358 // An unknown gesture type is passed in since gesture type is only |
359 // applicable in prompt UIs where revocations are not possible. | 359 // applicable in prompt UIs where revocations are not possible. |
360 RecordPermissionAction(permission, REVOKED, source_ui, | 360 RecordPermissionAction(permission, REVOKED, source_ui, |
361 PermissionRequestGestureType::UNKNOWN, | 361 PermissionRequestGestureType::UNKNOWN, |
362 revoked_origin, profile); | 362 revoked_origin, profile); |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
366 void PermissionUmaUtil::RecordPermissionEmbargoStatus( | 366 void PermissionUmaUtil::RecordEmbargoPromptSuppression( |
| 367 PermissionEmbargoStatus embargo_status) { |
| 368 UMA_HISTOGRAM_ENUMERATION("Permissions.AutoBlocker.EmbargoPromptSuppression", |
| 369 embargo_status, |
| 370 PermissionEmbargoStatus::STATUS_NUM); |
| 371 } |
| 372 |
| 373 void PermissionUmaUtil::RecordEmbargoPromptSuppressionFromSource( |
| 374 PermissionStatusSource source) { |
| 375 // Explicitly switch to ensure that any new PermissionStatusSource values are |
| 376 // dealt with appropriately. |
| 377 switch (source) { |
| 378 case PermissionStatusSource::MULTIPLE_DISMISSALS: |
| 379 PermissionUmaUtil::RecordEmbargoPromptSuppression( |
| 380 PermissionEmbargoStatus::REPEATED_DISMISSALS); |
| 381 break; |
| 382 case PermissionStatusSource::SAFE_BROWSING_BLACKLIST: |
| 383 PermissionUmaUtil::RecordEmbargoPromptSuppression( |
| 384 PermissionEmbargoStatus::PERMISSIONS_BLACKLISTING); |
| 385 break; |
| 386 case PermissionStatusSource::UNSPECIFIED: |
| 387 case PermissionStatusSource::KILL_SWITCH: |
| 388 // The permission wasn't under embargo, so don't record anything. We may |
| 389 // embargo it later. |
| 390 break; |
| 391 } |
| 392 } |
| 393 |
| 394 void PermissionUmaUtil::RecordEmbargoStatus( |
367 PermissionEmbargoStatus embargo_status) { | 395 PermissionEmbargoStatus embargo_status) { |
368 UMA_HISTOGRAM_ENUMERATION("Permissions.AutoBlocker.EmbargoStatus", | 396 UMA_HISTOGRAM_ENUMERATION("Permissions.AutoBlocker.EmbargoStatus", |
369 embargo_status, | 397 embargo_status, |
370 PermissionEmbargoStatus::STATUS_NUM); | 398 PermissionEmbargoStatus::STATUS_NUM); |
371 } | 399 } |
372 | 400 |
373 void PermissionUmaUtil::RecordSafeBrowsingResponse( | 401 void PermissionUmaUtil::RecordSafeBrowsingResponse( |
374 base::TimeDelta response_time, | 402 base::TimeDelta response_time, |
375 SafeBrowsingResponse response) { | 403 SafeBrowsingResponse response) { |
376 UMA_HISTOGRAM_TIMES("Permissions.AutoBlocker.SafeBrowsingResponseTime", | 404 UMA_HISTOGRAM_TIMES("Permissions.AutoBlocker.SafeBrowsingResponseTime", |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 if (!deprecated_metric.empty() && rappor_service) { | 758 if (!deprecated_metric.empty() && rappor_service) { |
731 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, | 759 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, |
732 requesting_origin); | 760 requesting_origin); |
733 | 761 |
734 std::string rappor_metric = deprecated_metric + "2"; | 762 std::string rappor_metric = deprecated_metric + "2"; |
735 rappor_service->RecordSampleString( | 763 rappor_service->RecordSampleString( |
736 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, | 764 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, |
737 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); | 765 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); |
738 } | 766 } |
739 } | 767 } |
OLD | NEW |