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 "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/content_settings/core/common/content_settings.h" |
| 11 #include "components/content_settings/core/common/content_settings_types.h" |
10 | 12 |
| 13 class ContentSettingsPattern; |
11 class GURL; | 14 class GURL; |
12 class Profile; | 15 class Profile; |
13 | 16 |
14 namespace content { | 17 namespace content { |
15 enum class PermissionType; | 18 enum class PermissionType; |
16 } // namespace content | 19 } // namespace content |
17 | 20 |
18 // Provides a convenient way of logging UMA for permission related operations. | 21 // Provides a convenient way of logging UMA for permission related operations. |
19 class PermissionUmaUtil { | 22 class PermissionUmaUtil { |
20 public: | 23 public: |
21 static void PermissionRequested(content::PermissionType permission, | 24 static void PermissionRequested(content::PermissionType permission, |
22 const GURL& requesting_origin, | 25 const GURL& requesting_origin, |
23 const GURL& embedding_origin, | 26 const GURL& embedding_origin, |
24 Profile* profile); | 27 Profile* profile); |
25 static void PermissionGranted(content::PermissionType permission, | 28 static void PermissionGranted(content::PermissionType permission, |
26 const GURL& requesting_origin); | 29 const GURL& requesting_origin); |
27 static void PermissionDenied(content::PermissionType permission, | 30 static void PermissionDenied(content::PermissionType permission, |
28 const GURL& requesting_origin); | 31 const GURL& requesting_origin); |
29 static void PermissionDismissed(content::PermissionType permission, | 32 static void PermissionDismissed(content::PermissionType permission, |
30 const GURL& requesting_origin); | 33 const GURL& requesting_origin); |
31 static void PermissionIgnored(content::PermissionType permission, | 34 static void PermissionIgnored(content::PermissionType permission, |
32 const GURL& requesting_origin); | 35 const GURL& requesting_origin); |
33 static void PermissionRevoked(content::PermissionType permission, | 36 static void PermissionRevoked(content::PermissionType permission, |
34 const GURL& revoked_origin); | 37 const GURL& revoked_origin); |
35 | 38 |
| 39 static void OnContentsettingChanged( |
| 40 Profile* profile, |
| 41 const ContentSettingsPattern& primary_pattern, |
| 42 const ContentSettingsPattern& secondary_pattern, |
| 43 ContentSettingsType content_type, |
| 44 ContentSetting previous_value); |
| 45 |
36 private: | 46 private: |
37 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 47 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
38 }; | 48 }; |
39 | 49 |
40 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 50 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
OLD | NEW |