| Index: chrome/browser/permissions/permission_queue_controller.cc
|
| diff --git a/chrome/browser/permissions/permission_queue_controller.cc b/chrome/browser/permissions/permission_queue_controller.cc
|
| index 13410430ec3ba5835de1ed94017b57d53c5e79ef..5627c0627275e0754c3cdbb3d89ab3131de626f7 100644
|
| --- a/chrome/browser/permissions/permission_queue_controller.cc
|
| +++ b/chrome/browser/permissions/permission_queue_controller.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/permissions/permission_queue_controller.h"
|
|
|
| +#include "build/build_config.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
| #include "chrome/browser/infobars/infobar_service.h"
|
| @@ -64,6 +65,30 @@ class PermissionQueueController::PendingInfobarRequest {
|
| bool IsForPair(const GURL& requesting_frame,
|
| const GURL& embedder) const;
|
|
|
| + PermissionRequestType request_type() const {
|
| + switch (type_) {
|
| + case content::PermissionType::GEOLOCATION:
|
| + return PermissionRequestType::PERMISSION_GEOLOCATION;
|
| +#if defined(ENABLE_NOTIFICATIONS)
|
| + case content::PermissionType::NOTIFICATIONS:
|
| + return PermissionRequestType::PERMISSION_NOTIFICATIONS;
|
| +#endif
|
| + case content::PermissionType::MIDI_SYSEX:
|
| + return PermissionRequestType::PERMISSION_MIDI_SYSEX;
|
| + case content::PermissionType::PUSH_MESSAGING:
|
| + return PermissionRequestType::PERMISSION_PUSH_MESSAGING;
|
| + case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
|
| + return PermissionRequestType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER;
|
| + default:
|
| + NOTREACHED();
|
| + return PermissionRequestType::UNKNOWN;
|
| + }
|
| + }
|
| +
|
| + PermissionRequestGestureType gesture_type() const {
|
| + return PermissionUtil::GetGestureType(user_gesture_);
|
| + }
|
| +
|
| const PermissionRequestID& id() const { return id_; }
|
| const GURL& requesting_frame() const { return requesting_frame_; }
|
| bool has_gesture() const { return user_gesture_; }
|
| @@ -212,8 +237,7 @@ void PermissionQueueController::OnPermissionSet(const PermissionRequestID& id,
|
| // TODO(miguelg): move the permission persistence to
|
| // PermissionContextBase once all the types are moved there.
|
| PermissionRequestGestureType gesture_type =
|
| - user_gesture ? PermissionRequestGestureType::GESTURE
|
| - : PermissionRequestGestureType::NO_GESTURE;
|
| + PermissionUtil::GetGestureType(user_gesture);
|
| switch (decision) {
|
| case GRANTED:
|
| PermissionUmaUtil::PermissionGranted(permission_type_, gesture_type,
|
| @@ -361,6 +385,8 @@ void PermissionQueueController::ShowQueuedInfoBarForTab(
|
| if (!show_dialog)
|
| RegisterForInfoBarNotifications(infobar_service);
|
|
|
| + PermissionUmaUtil::RecordPermissionPromptTypeAndGesture(
|
| + i->request_type(), i->gesture_type());
|
| i->CreatePrompt(this, show_dialog);
|
| return;
|
| }
|
|
|