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

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

Issue 2124703002: Record metrics for permission prompt acceptance vs. user gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add histograms Created 4 years, 5 months 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_bubble_request_impl.h" 5 #include "chrome/browser/permissions/permission_bubble_request_impl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/permissions/permission_context_base.h" 8 #include "chrome/browser/permissions/permission_context_base.h"
9 #include "chrome/browser/permissions/permission_uma_util.h" 9 #include "chrome/browser/permissions/permission_uma_util.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
11 #include "components/url_formatter/elide_url.h" 11 #include "components/url_formatter/elide_url.h"
12 #include "grit/theme_resources.h" 12 #include "grit/theme_resources.h"
13 #include "net/base/escape.h" 13 #include "net/base/escape.h"
14 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/gfx/vector_icons_public.h" 15 #include "ui/gfx/vector_icons_public.h"
16 16
17 PermissionBubbleRequestImpl::PermissionBubbleRequestImpl( 17 PermissionBubbleRequestImpl::PermissionBubbleRequestImpl(
18 const GURL& request_origin, 18 const GURL& request_origin,
19 content::PermissionType permission_type, 19 content::PermissionType permission_type,
20 bool has_gesture,
20 const PermissionDecidedCallback& permission_decided_callback, 21 const PermissionDecidedCallback& permission_decided_callback,
21 const base::Closure delete_callback) 22 const base::Closure delete_callback)
22 : request_origin_(request_origin), 23 : request_origin_(request_origin),
23 permission_type_(permission_type), 24 permission_type_(permission_type),
tsergeant 2016/07/06 00:28:47 Shouldn't has_gesture_ be initialized in here?
benwells 2016/07/06 01:14:01 Yes, indeed it should! Done.
24 permission_decided_callback_(permission_decided_callback), 25 permission_decided_callback_(permission_decided_callback),
25 delete_callback_(delete_callback), 26 delete_callback_(delete_callback),
26 is_finished_(false), 27 is_finished_(false),
27 action_taken_(false) {} 28 action_taken_(false) {}
28 29
29 PermissionBubbleRequestImpl::~PermissionBubbleRequestImpl() { 30 PermissionBubbleRequestImpl::~PermissionBubbleRequestImpl() {
30 DCHECK(is_finished_); 31 DCHECK(is_finished_);
31 if (!action_taken_) 32 if (!action_taken_)
32 PermissionUmaUtil::PermissionIgnored(permission_type_, request_origin_); 33 PermissionUmaUtil::PermissionIgnored(permission_type_, request_origin_);
33 } 34 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return PermissionBubbleType::PERMISSION_PUSH_MESSAGING; 148 return PermissionBubbleType::PERMISSION_PUSH_MESSAGING;
148 #if defined(OS_CHROMEOS) 149 #if defined(OS_CHROMEOS)
149 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: 150 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
150 return PermissionBubbleType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; 151 return PermissionBubbleType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER;
151 #endif 152 #endif
152 default: 153 default:
153 NOTREACHED(); 154 NOTREACHED();
154 return PermissionBubbleType::UNKNOWN; 155 return PermissionBubbleType::UNKNOWN;
155 } 156 }
156 } 157 }
158
159 PermissionBubbleGestureType PermissionBubbleRequestImpl::GetGestureType()
160 const {
161 return has_gesture_ ? PermissionBubbleGestureType::GESTURE
162 : PermissionBubbleGestureType::NO_GESTURE;
163 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_bubble_request_impl.h ('k') | chrome/browser/permissions/permission_context_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698