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

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

Issue 2145373002: Revert of Add hooks to permission layer for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-reporter-implementation
Patch Set: 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 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 static const char kPermissionsPromptRequestsPerPrompt[]; 44 static const char kPermissionsPromptRequestsPerPrompt[];
45 static const char kPermissionsPromptMergedBubbleTypes[]; 45 static const char kPermissionsPromptMergedBubbleTypes[];
46 static const char kPermissionsPromptMergedBubbleAccepted[]; 46 static const char kPermissionsPromptMergedBubbleAccepted[];
47 static const char kPermissionsPromptMergedBubbleDenied[]; 47 static const char kPermissionsPromptMergedBubbleDenied[];
48 48
49 static void PermissionRequested(content::PermissionType permission, 49 static void PermissionRequested(content::PermissionType permission,
50 const GURL& requesting_origin, 50 const GURL& requesting_origin,
51 const GURL& embedding_origin, 51 const GURL& embedding_origin,
52 Profile* profile); 52 Profile* profile);
53 static void PermissionGranted(content::PermissionType permission, 53 static void PermissionGranted(content::PermissionType permission,
54 const GURL& requesting_origin, 54 const GURL& requesting_origin);
55 Profile* profile);
56 static void PermissionDenied(content::PermissionType permission, 55 static void PermissionDenied(content::PermissionType permission,
57 const GURL& requesting_origin, 56 const GURL& requesting_origin);
58 Profile* profile);
59 static void PermissionDismissed(content::PermissionType permission, 57 static void PermissionDismissed(content::PermissionType permission,
60 const GURL& requesting_origin, 58 const GURL& requesting_origin);
61 Profile* profile);
62 static void PermissionIgnored(content::PermissionType permission, 59 static void PermissionIgnored(content::PermissionType permission,
63 const GURL& requesting_origin, 60 const GURL& requesting_origin);
64 Profile* profile);
65 static void PermissionRevoked(content::PermissionType permission, 61 static void PermissionRevoked(content::PermissionType permission,
66 const GURL& revoked_origin, 62 const GURL& revoked_origin);
67 Profile* profile);
68 63
69 // UMA specifically for when permission prompts are shown. This should be 64 // UMA specifically for when permission prompts are shown. This should be
70 // roughly equivalent to the metrics above, however it is 65 // roughly equivalent to the metrics above, however it is
71 // useful to have separate UMA to a few reasons: 66 // useful to have separate UMA to a few reasons:
72 // - to account for, and get data on coalesced permission bubbles 67 // - to account for, and get data on coalesced permission bubbles
73 // - there are other types of permissions prompts (e.g. download limiting) 68 // - there are other types of permissions prompts (e.g. download limiting)
74 // which don't go through PermissionContext 69 // which don't go through PermissionContext
75 // - the above metrics don't always add up (e.g. sum of 70 // - the above metrics don't always add up (e.g. sum of
76 // granted+denied+dismissed+ignored is not equal to requested), so it is 71 // granted+denied+dismissed+ignored is not equal to requested), so it is
77 // unclear from those metrics alone how many prompts are seen by users. 72 // unclear from those metrics alone how many prompts are seen by users.
78 static void PermissionPromptShown( 73 static void PermissionPromptShown(
79 const std::vector<PermissionBubbleRequest*>& requests); 74 const std::vector<PermissionBubbleRequest*>& requests);
80 75
81 // The following two functions can be combined with the PermissionPromptShown 76 // The following two functions can be combined with the PermissionPromptShown
82 // metrics to calculate accept, deny and ignore rates. 77 // metrics to calculate accept, deny and ignore rates.
83 // Note that for coalesced permission bubbles, PermissionPromptAccepted will 78 // Note that for coalesced permission bubbles, PermissionPromptAccepted will
84 // always be called, with |accept_states| containing whether each request was 79 // always be called, with |accept_states| containing whether each request was
85 // accepted or denied. 80 // accepted or denied.
86 static void PermissionPromptAccepted( 81 static void PermissionPromptAccepted(
87 const std::vector<PermissionBubbleRequest*>& requests, 82 const std::vector<PermissionBubbleRequest*>& requests,
88 const std::vector<bool>& accept_states); 83 const std::vector<bool>& accept_states);
89 84
90 static void PermissionPromptDenied( 85 static void PermissionPromptDenied(
91 const std::vector<PermissionBubbleRequest*>& requests); 86 const std::vector<PermissionBubbleRequest*>& requests);
92 87
93 private: 88 private:
94 friend class PermissionUmaUtilTest;
95
96 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); 89 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil);
97
98 static bool IsOptedIntoPermissionActionReporting(Profile* profile);
99
100 static void RecordPermissionAction(content::PermissionType permission,
101 PermissionAction action,
102 const GURL& requesting_origin,
103 Profile* profile);
104 }; 90 };
105 91
106 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ 92 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_queue_controller.cc ('k') | chrome/browser/permissions/permission_uma_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698