Chromium Code Reviews| 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 #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> | |
| 9 | |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 | 12 |
| 11 class GURL; | 13 class GURL; |
| 12 class Profile; | 14 class Profile; |
| 13 | 15 |
| 14 namespace content { | 16 namespace content { |
| 15 enum class PermissionType; | 17 enum class PermissionType; |
| 16 } // namespace content | 18 } // namespace content |
| 17 | 19 |
| 20 class PermissionBubbleRequest; | |
| 21 | |
| 18 // Enum for UMA purposes, make sure you update histograms.xml if you add new | 22 // Enum for UMA purposes, make sure you update histograms.xml if you add new |
| 19 // permission actions. Never delete or reorder an entry; only add new entries | 23 // permission actions. Never delete or reorder an entry; only add new entries |
| 20 // immediately before PERMISSION_NUM | 24 // immediately before PERMISSION_NUM |
| 21 enum PermissionAction { | 25 enum PermissionAction { |
| 22 GRANTED = 0, | 26 GRANTED = 0, |
| 23 DENIED = 1, | 27 DENIED = 1, |
| 24 DISMISSED = 2, | 28 DISMISSED = 2, |
| 25 IGNORED = 3, | 29 IGNORED = 3, |
| 26 REVOKED = 4, | 30 REVOKED = 4, |
| 27 REENABLED = 5, | 31 REENABLED = 5, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 42 const GURL& requesting_origin); | 46 const GURL& requesting_origin); |
| 43 static void PermissionDenied(content::PermissionType permission, | 47 static void PermissionDenied(content::PermissionType permission, |
| 44 const GURL& requesting_origin); | 48 const GURL& requesting_origin); |
| 45 static void PermissionDismissed(content::PermissionType permission, | 49 static void PermissionDismissed(content::PermissionType permission, |
| 46 const GURL& requesting_origin); | 50 const GURL& requesting_origin); |
| 47 static void PermissionIgnored(content::PermissionType permission, | 51 static void PermissionIgnored(content::PermissionType permission, |
| 48 const GURL& requesting_origin); | 52 const GURL& requesting_origin); |
| 49 static void PermissionRevoked(content::PermissionType permission, | 53 static void PermissionRevoked(content::PermissionType permission, |
| 50 const GURL& revoked_origin); | 54 const GURL& revoked_origin); |
| 51 | 55 |
| 56 // UMA specifically for when permission prompts are shown. This should be | |
| 57 // roughly equivalent to the metrics above, however it is | |
| 58 // useful to have separate UMA to a few reasons: | |
| 59 // - to account for, and get data on coalesced permission bubbles | |
| 60 // - there are other types of permissions prompts (e.g. download limiting) | |
| 61 // which don't go through PermissionContext | |
| 62 // - the above metrics don't always add up (e.g. sum of | |
| 63 // granted+denied+dismissed+ignored is not equal to requested), so it is | |
| 64 // unclear from those metrics alone how many prompts are seen by users. | |
| 65 static void PermissionPromptShown( | |
| 66 const std::vector<PermissionBubbleRequest*> requests); | |
|
Lei Zhang
2016/04/19 01:46:05
Pass by const-ref?
benwells
2016/04/20 01:32:10
Done.
| |
| 67 | |
| 52 private: | 68 private: |
| 53 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 69 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 54 }; | 70 }; |
| 55 | 71 |
| 56 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 72 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |