| 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> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // useful to have separate UMA to a few reasons: | 58 // useful to have separate UMA to a few reasons: |
| 59 // - to account for, and get data on coalesced permission bubbles | 59 // - to account for, and get data on coalesced permission bubbles |
| 60 // - there are other types of permissions prompts (e.g. download limiting) | 60 // - there are other types of permissions prompts (e.g. download limiting) |
| 61 // which don't go through PermissionContext | 61 // which don't go through PermissionContext |
| 62 // - the above metrics don't always add up (e.g. sum of | 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 | 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. | 64 // unclear from those metrics alone how many prompts are seen by users. |
| 65 static void PermissionPromptShown( | 65 static void PermissionPromptShown( |
| 66 const std::vector<PermissionBubbleRequest*>& requests); | 66 const std::vector<PermissionBubbleRequest*>& requests); |
| 67 | 67 |
| 68 // The following two functions can be combined with the PermissionPromptShown |
| 69 // metrics to calculate accept, deny and ignore rates. |
| 70 // Note that for coalesced permission bubbles, PermissionPromptAccepted will |
| 71 // always be called, with |accept_states| containing whether each request was |
| 72 // accepted or denied. |
| 73 static void PermissionPromptAccepted( |
| 74 const std::vector<PermissionBubbleRequest*>& requests, |
| 75 const std::vector<bool>& accept_states); |
| 76 |
| 77 static void PermissionPromptDenied( |
| 78 const std::vector<PermissionBubbleRequest*>& requests); |
| 79 |
| 68 private: | 80 private: |
| 69 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 81 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 70 }; | 82 }; |
| 71 | 83 |
| 72 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 84 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |