Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: chrome/browser/permissions/permission_uma_util.cc

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Move permissions stuff to SensorProxy, remove aw related stuff Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 "Permissions.Prompt.Accepted.Persisted.AudioCapture", toggle_enabled); 498 "Permissions.Prompt.Accepted.Persisted.AudioCapture", toggle_enabled);
499 break; 499 break;
500 case PermissionType::VIDEO_CAPTURE: 500 case PermissionType::VIDEO_CAPTURE:
501 UMA_HISTOGRAM_BOOLEAN( 501 UMA_HISTOGRAM_BOOLEAN(
502 "Permissions.Prompt.Accepted.Persisted.VideoCapture", toggle_enabled); 502 "Permissions.Prompt.Accepted.Persisted.VideoCapture", toggle_enabled);
503 break; 503 break;
504 case PermissionType::FLASH: 504 case PermissionType::FLASH:
505 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Accepted.Persisted.Flash", 505 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Accepted.Persisted.Flash",
506 toggle_enabled); 506 toggle_enabled);
507 break; 507 break;
508
509 case PermissionType::SENSORS:
510 // TODO(riju): when UMA is ready.
511 break;
508 // The user is not prompted for these permissions, thus there is no accept 512 // The user is not prompted for these permissions, thus there is no accept
509 // recorded for them. 513 // recorded for them.
510 case PermissionType::MIDI: 514 case PermissionType::MIDI:
511 case PermissionType::BACKGROUND_SYNC: 515 case PermissionType::BACKGROUND_SYNC:
512 case PermissionType::NUM: 516 case PermissionType::NUM:
513 NOTREACHED() << "PERMISSION " 517 NOTREACHED() << "PERMISSION "
514 << PermissionUtil::GetPermissionString(permission) 518 << PermissionUtil::GetPermissionString(permission)
515 << " not accounted for"; 519 << " not accounted for";
516 } 520 }
517 } 521 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 toggle_enabled); 553 toggle_enabled);
550 break; 554 break;
551 case PermissionType::VIDEO_CAPTURE: 555 case PermissionType::VIDEO_CAPTURE:
552 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.VideoCapture", 556 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.VideoCapture",
553 toggle_enabled); 557 toggle_enabled);
554 break; 558 break;
555 case PermissionType::FLASH: 559 case PermissionType::FLASH:
556 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.Flash", 560 UMA_HISTOGRAM_BOOLEAN("Permissions.Prompt.Denied.Persisted.Flash",
557 toggle_enabled); 561 toggle_enabled);
558 break; 562 break;
563 case PermissionType::SENSORS:
564 // TODO(riju): when UMA is ready.
565 // The user is not prompted for these permissions, thus there is no accept
566 // recorded for them.
567 break;
559 // The user is not prompted for these permissions, thus there is no deny 568 // The user is not prompted for these permissions, thus there is no deny
560 // recorded for them. 569 // recorded for them.
561 case PermissionType::MIDI: 570 case PermissionType::MIDI:
562 case PermissionType::BACKGROUND_SYNC: 571 case PermissionType::BACKGROUND_SYNC:
563 case PermissionType::NUM: 572 case PermissionType::NUM:
564 NOTREACHED() << "PERMISSION " 573 NOTREACHED() << "PERMISSION "
565 << PermissionUtil::GetPermissionString(permission) 574 << PermissionUtil::GetPermissionString(permission)
566 << " not accounted for"; 575 << " not accounted for";
567 } 576 }
568 } 577 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 "Permissions.Action.SecureOrigin.Notifications", 648 "Permissions.Action.SecureOrigin.Notifications",
640 "Permissions.Action.InsecureOrigin.Notifications", 649 "Permissions.Action.InsecureOrigin.Notifications",
641 action); 650 action);
642 break; 651 break;
643 case PermissionType::MIDI_SYSEX: 652 case PermissionType::MIDI_SYSEX:
644 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.MidiSysEx", 653 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.MidiSysEx",
645 "Permissions.Action.SecureOrigin.MidiSysEx", 654 "Permissions.Action.SecureOrigin.MidiSysEx",
646 "Permissions.Action.InsecureOrigin.MidiSysEx", 655 "Permissions.Action.InsecureOrigin.MidiSysEx",
647 action); 656 action);
648 break; 657 break;
658 // TODO(riju) : when UMA is ready.
659 case PermissionType::SENSORS:
660 /*
661 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Sensors",
662 "Permissions.Action.SecureOrigin.Sensors",
663 "Permissions.Action.InsecureOrigin.Sensors",
664 action);
665 */
666 break;
649 case PermissionType::PUSH_MESSAGING: 667 case PermissionType::PUSH_MESSAGING:
650 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.PushMessaging", 668 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.PushMessaging",
651 "Permissions.Action.SecureOrigin.PushMessaging", 669 "Permissions.Action.SecureOrigin.PushMessaging",
652 "Permissions.Action.InsecureOrigin.PushMessaging", 670 "Permissions.Action.InsecureOrigin.PushMessaging",
653 action); 671 action);
654 break; 672 break;
655 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: 673 case PermissionType::PROTECTED_MEDIA_IDENTIFIER:
656 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.ProtectedMedia", 674 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.ProtectedMedia",
657 "Permissions.Action.SecureOrigin.ProtectedMedia", 675 "Permissions.Action.SecureOrigin.ProtectedMedia",
658 "Permissions.Action.InsecureOrigin.ProtectedMedia", 676 "Permissions.Action.InsecureOrigin.ProtectedMedia",
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 if (!deprecated_metric.empty() && rappor_service) { 718 if (!deprecated_metric.empty() && rappor_service) {
701 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, 719 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric,
702 requesting_origin); 720 requesting_origin);
703 721
704 std::string rappor_metric = deprecated_metric + "2"; 722 std::string rappor_metric = deprecated_metric + "2";
705 rappor_service->RecordSample( 723 rappor_service->RecordSample(
706 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, 724 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE,
707 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); 725 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin));
708 } 726 }
709 } 727 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698