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 #include "base/metrics/histogram.h" | 5 #include "base/metrics/histogram.h" |
6 #include "chrome/browser/content_settings/permission_context_uma_util.h" | 6 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
7 #include "content/public/browser/permission_type.h" | 7 #include "content/public/browser/permission_type.h" |
8 #include "url/gurl.h" | 8 #include "url/gurl.h" |
9 | 9 |
10 // UMA keys need to be statically initialized so plain function would not | 10 // UMA keys need to be statically initialized so plain function would not |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 break; | 98 break; |
99 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 99 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
100 type = content::PERMISSION_NOTIFICATIONS; | 100 type = content::PERMISSION_NOTIFICATIONS; |
101 break; | 101 break; |
102 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 102 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
103 type = content::PERMISSION_MIDI_SYSEX; | 103 type = content::PERMISSION_MIDI_SYSEX; |
104 break; | 104 break; |
105 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: | 105 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: |
106 type = content::PERMISSION_PUSH_MESSAGING; | 106 type = content::PERMISSION_PUSH_MESSAGING; |
107 break; | 107 break; |
| 108 #if defined(OS_ANDROID) |
| 109 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: |
| 110 type = content::PERMISSION_PROTECTED_MEDIA; |
| 111 break; |
| 112 #endif |
108 default: | 113 default: |
109 NOTREACHED() << "PERMISSION " << permission << " not accounted for"; | 114 NOTREACHED() << "PERMISSION " << permission << " not accounted for"; |
110 return; | 115 return; |
111 } | 116 } |
112 UMA_HISTOGRAM_ENUMERATION( | 117 UMA_HISTOGRAM_ENUMERATION( |
113 "ContentSettings.PermissionRequested", type, content::PERMISSION_NUM); | 118 "ContentSettings.PermissionRequested", type, content::PERMISSION_NUM); |
114 if (secure_origin) { | 119 if (secure_origin) { |
115 UMA_HISTOGRAM_ENUMERATION( | 120 UMA_HISTOGRAM_ENUMERATION( |
116 "ContentSettings.PermissionRequested_SecureOrigin", | 121 "ContentSettings.PermissionRequested_SecureOrigin", |
117 type, | 122 type, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 ContentSettingsType permission, const GURL& requesting_origin) { | 154 ContentSettingsType permission, const GURL& requesting_origin) { |
150 RecordPermissionAction(permission, DISMISSED, | 155 RecordPermissionAction(permission, DISMISSED, |
151 requesting_origin.SchemeIsSecure()); | 156 requesting_origin.SchemeIsSecure()); |
152 } | 157 } |
153 | 158 |
154 void PermissionContextUmaUtil::PermissionIgnored( | 159 void PermissionContextUmaUtil::PermissionIgnored( |
155 ContentSettingsType permission, const GURL& requesting_origin) { | 160 ContentSettingsType permission, const GURL& requesting_origin) { |
156 RecordPermissionAction(permission, IGNORED, | 161 RecordPermissionAction(permission, IGNORED, |
157 requesting_origin.SchemeIsSecure()); | 162 requesting_origin.SchemeIsSecure()); |
158 } | 163 } |
OLD | NEW |