| 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 "Permissions.Prompt.Accepted.Persisted.AudioCapture", toggle_enabled); | 513 "Permissions.Prompt.Accepted.Persisted.AudioCapture", toggle_enabled); |
| 514 break; | 514 break; |
| 515 case PermissionType::VIDEO_CAPTURE: | 515 case PermissionType::VIDEO_CAPTURE: |
| 516 UMA_HISTOGRAM_BOOLEAN( | 516 UMA_HISTOGRAM_BOOLEAN( |
| 517 "Permissions.Prompt.Accepted.Persisted.VideoCapture", toggle_enabled); | 517 "Permissions.Prompt.Accepted.Persisted.VideoCapture", toggle_enabled); |
| 518 break; | 518 break; |
| 519 case PermissionType::FLASH: | 519 case PermissionType::FLASH: |
| 520 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Accepted.Persisted.Flash", | 520 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Accepted.Persisted.Flash", |
| 521 toggle_enabled); | 521 toggle_enabled); |
| 522 break; | 522 break; |
| 523 |
| 524 case PermissionType::SENSORS: |
| 525 // TODO(riju): when UMA is ready. |
| 526 break; |
| 523 // The user is not prompted for these permissions, thus there is no accept | 527 // The user is not prompted for these permissions, thus there is no accept |
| 524 // recorded for them. | 528 // recorded for them. |
| 525 case PermissionType::MIDI: | 529 case PermissionType::MIDI: |
| 526 case PermissionType::BACKGROUND_SYNC: | 530 case PermissionType::BACKGROUND_SYNC: |
| 527 case PermissionType::NUM: | 531 case PermissionType::NUM: |
| 528 NOTREACHED() << "PERMISSION " | 532 NOTREACHED() << "PERMISSION " |
| 529 << PermissionUtil::GetPermissionString(permission) | 533 << PermissionUtil::GetPermissionString(permission) |
| 530 << " not accounted for"; | 534 << " not accounted for"; |
| 531 } | 535 } |
| 532 } | 536 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 toggle_enabled); | 568 toggle_enabled); |
| 565 break; | 569 break; |
| 566 case PermissionType::VIDEO_CAPTURE: | 570 case PermissionType::VIDEO_CAPTURE: |
| 567 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.VideoCapture", | 571 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.VideoCapture", |
| 568 toggle_enabled); | 572 toggle_enabled); |
| 569 break; | 573 break; |
| 570 case PermissionType::FLASH: | 574 case PermissionType::FLASH: |
| 571 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.Flash", | 575 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.Flash", |
| 572 toggle_enabled); | 576 toggle_enabled); |
| 573 break; | 577 break; |
| 578 case PermissionType::SENSORS: |
| 579 // TODO(riju): when UMA is ready. |
| 580 // The user is not prompted for these permissions, thus there is no accept |
| 581 // recorded for them. |
| 582 break; |
| 574 // The user is not prompted for these permissions, thus there is no deny | 583 // The user is not prompted for these permissions, thus there is no deny |
| 575 // recorded for them. | 584 // recorded for them. |
| 576 case PermissionType::MIDI: | 585 case PermissionType::MIDI: |
| 577 case PermissionType::BACKGROUND_SYNC: | 586 case PermissionType::BACKGROUND_SYNC: |
| 578 case PermissionType::NUM: | 587 case PermissionType::NUM: |
| 579 NOTREACHED() << "PERMISSION " | 588 NOTREACHED() << "PERMISSION " |
| 580 << PermissionUtil::GetPermissionString(permission) | 589 << PermissionUtil::GetPermissionString(permission) |
| 581 << " not accounted for"; | 590 << " not accounted for"; |
| 582 } | 591 } |
| 583 } | 592 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 "Permissions.Action.SecureOrigin.Notifications", | 663 "Permissions.Action.SecureOrigin.Notifications", |
| 655 "Permissions.Action.InsecureOrigin.Notifications", | 664 "Permissions.Action.InsecureOrigin.Notifications", |
| 656 action); | 665 action); |
| 657 break; | 666 break; |
| 658 case PermissionType::MIDI_SYSEX: | 667 case PermissionType::MIDI_SYSEX: |
| 659 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.MidiSysEx", | 668 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.MidiSysEx", |
| 660 "Permissions.Action.SecureOrigin.MidiSysEx", | 669 "Permissions.Action.SecureOrigin.MidiSysEx", |
| 661 "Permissions.Action.InsecureOrigin.MidiSysEx", | 670 "Permissions.Action.InsecureOrigin.MidiSysEx", |
| 662 action); | 671 action); |
| 663 break; | 672 break; |
| 673 // TODO(riju) : when UMA is ready. |
| 674 case PermissionType::SENSORS: |
| 675 /* |
| 676 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Sensors", |
| 677 "Permissions.Action.SecureOrigin.Sensors", |
| 678 "Permissions.Action.InsecureOrigin.Sensors", |
| 679 action); |
| 680 */ |
| 681 break; |
| 664 case PermissionType::PUSH_MESSAGING: | 682 case PermissionType::PUSH_MESSAGING: |
| 665 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.PushMessaging", | 683 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.PushMessaging", |
| 666 "Permissions.Action.SecureOrigin.PushMessaging", | 684 "Permissions.Action.SecureOrigin.PushMessaging", |
| 667 "Permissions.Action.InsecureOrigin.PushMessaging", | 685 "Permissions.Action.InsecureOrigin.PushMessaging", |
| 668 action); | 686 action); |
| 669 break; | 687 break; |
| 670 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 688 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 671 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.ProtectedMedia", | 689 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.ProtectedMedia", |
| 672 "Permissions.Action.SecureOrigin.ProtectedMedia", | 690 "Permissions.Action.SecureOrigin.ProtectedMedia", |
| 673 "Permissions.Action.InsecureOrigin.ProtectedMedia", | 691 "Permissions.Action.InsecureOrigin.ProtectedMedia", |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 if (!deprecated_metric.empty() && rappor_service) { | 733 if (!deprecated_metric.empty() && rappor_service) { |
| 716 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, | 734 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, |
| 717 requesting_origin); | 735 requesting_origin); |
| 718 | 736 |
| 719 std::string rappor_metric = deprecated_metric + "2"; | 737 std::string rappor_metric = deprecated_metric + "2"; |
| 720 rappor_service->RecordSample( | 738 rappor_service->RecordSample( |
| 721 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, | 739 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, |
| 722 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); | 740 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); |
| 723 } | 741 } |
| 724 } | 742 } |
| OLD | NEW |