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

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

Issue 2715643002: Replace all enums with enum classes in permissions code. (Closed)
Patch Set: Rebase Created 3 years, 10 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"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "chrome/browser/permissions/permission_request.h" 13 #include "chrome/browser/permissions/permission_request.h"
14 #include "chrome/browser/permissions/permission_util.h" 14 #include "chrome/browser/permissions/permission_util.h"
15 15
16 enum class PermissionRequestGestureType; 16 enum class PermissionRequestGestureType;
17 class GURL; 17 class GURL;
18 class PermissionRequest; 18 class PermissionRequest;
19 class Profile; 19 class Profile;
20 20
21 // This should stay in sync with the SourceUI enum in the permission report 21 // This should stay in sync with the SourceUI enum in the permission report
22 // protobuf (src/chrome/common/safe_browsing/permission_report.proto). 22 // protobuf (src/chrome/common/safe_browsing/permission_report.proto).
23 enum class PermissionSourceUI { 23 enum class PermissionSourceUI {
24 PROMPT = 0, 24 PROMPT = 0,
25 OIB = 1, 25 OIB = 1,
26 SITE_SETTINGS = 2, 26 SITE_SETTINGS = 2,
27 PAGE_ACTION = 3, 27 PAGE_ACTION = 3,
28 28
29 // Always keep this at the end. 29 // Always keep this at the end.
30 SOURCE_UI_NUM, 30 NUM,
31 }; 31 };
32 32
33 // This should stay in sync with the PersistDecision enum in the permission 33 // This should stay in sync with the PersistDecision enum in the permission
34 // report message (src/chrome/common/safe_browsing/permission_report.proto). 34 // report message (src/chrome/common/safe_browsing/permission_report.proto).
35 enum class PermissionPersistDecision { 35 enum class PermissionPersistDecision {
36 UNSPECIFIED = 0, 36 UNSPECIFIED = 0,
37 PERSISTED = 1, 37 PERSISTED = 1,
38 NOT_PERSISTED = 2, 38 NOT_PERSISTED = 2,
39 }; 39 };
40 40
41 // Any new values should be inserted immediately prior to RESPONSE_NUM. 41 // Any new values should be inserted immediately prior to NUM.
42 enum SafeBrowsingResponse { 42 enum class SafeBrowsingResponse {
43 NOT_BLACKLISTED = 0, 43 NOT_BLACKLISTED = 0,
44 TIMEOUT = 1, 44 TIMEOUT = 1,
45 BLACKLISTED = 2, 45 BLACKLISTED = 2,
46 46
47 // Always keep this at the end. 47 // Always keep this at the end.
48 RESPONSE_NUM, 48 NUM,
49 }; 49 };
50 50
51 // Any new values should be inserted immediately prior to STATUS_NUM. 51 // Any new values should be inserted immediately prior to NUM.
52 enum PermissionEmbargoStatus { 52 enum class PermissionEmbargoStatus {
53 NOT_EMBARGOED = 0, 53 NOT_EMBARGOED = 0,
54 PERMISSIONS_BLACKLISTING = 1, 54 PERMISSIONS_BLACKLISTING = 1,
55 REPEATED_DISMISSALS = 2, 55 REPEATED_DISMISSALS = 2,
56 56
57 // Keep this at the end. 57 // Keep this at the end.
58 STATUS_NUM, 58 NUM,
59 }; 59 };
60 60
61 // A bundle for the information sent in a PermissionReport. 61 // A bundle for the information sent in a PermissionReport.
62 struct PermissionReportInfo { 62 struct PermissionReportInfo {
63 PermissionReportInfo( 63 PermissionReportInfo(
64 const GURL& origin, 64 const GURL& origin,
65 ContentSettingsType permission, 65 ContentSettingsType permission,
66 PermissionAction action, 66 PermissionAction action,
67 PermissionSourceUI source_ui, 67 PermissionSourceUI source_ui,
68 PermissionRequestGestureType gesture_type, 68 PermissionRequestGestureType gesture_type,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // for a single origin using |prefix| for the metric. 209 // for a single origin using |prefix| for the metric.
210 static void RecordPermissionPromptPriorCount( 210 static void RecordPermissionPromptPriorCount(
211 ContentSettingsType permission, 211 ContentSettingsType permission,
212 const std::string& prefix, 212 const std::string& prefix,
213 int count); 213 int count);
214 214
215 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); 215 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil);
216 }; 216 };
217 217
218 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ 218 #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