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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 type = content::PERMISSION_NOTIFICATIONS; | 104 type = content::PERMISSION_NOTIFICATIONS; |
105 break; | 105 break; |
106 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 106 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
107 type = content::PERMISSION_MIDI_SYSEX; | 107 type = content::PERMISSION_MIDI_SYSEX; |
108 break; | 108 break; |
109 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: | 109 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: |
110 type = content::PERMISSION_PUSH_MESSAGING; | 110 type = content::PERMISSION_PUSH_MESSAGING; |
111 break; | 111 break; |
112 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 112 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
113 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: | 113 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: |
114 type = content::PERMISSION_PROTECTED_MEDIA; | 114 type = content::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; |
115 break; | 115 break; |
116 #endif | 116 #endif |
117 default: | 117 default: |
118 NOTREACHED() << "PERMISSION " << permission << " not accounted for"; | 118 NOTREACHED() << "PERMISSION " << permission << " not accounted for"; |
119 return; | 119 return; |
120 } | 120 } |
121 UMA_HISTOGRAM_ENUMERATION( | 121 UMA_HISTOGRAM_ENUMERATION( |
122 "ContentSettings.PermissionRequested", type, content::PERMISSION_NUM); | 122 "ContentSettings.PermissionRequested", type, content::PERMISSION_NUM); |
123 if (secure_origin) { | 123 if (secure_origin) { |
124 UMA_HISTOGRAM_ENUMERATION( | 124 UMA_HISTOGRAM_ENUMERATION( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 ContentSettingsType permission, const GURL& requesting_origin) { | 158 ContentSettingsType permission, const GURL& requesting_origin) { |
159 RecordPermissionAction(permission, DISMISSED, | 159 RecordPermissionAction(permission, DISMISSED, |
160 requesting_origin.SchemeIsSecure()); | 160 requesting_origin.SchemeIsSecure()); |
161 } | 161 } |
162 | 162 |
163 void PermissionContextUmaUtil::PermissionIgnored( | 163 void PermissionContextUmaUtil::PermissionIgnored( |
164 ContentSettingsType permission, const GURL& requesting_origin) { | 164 ContentSettingsType permission, const GURL& requesting_origin) { |
165 RecordPermissionAction(permission, IGNORED, | 165 RecordPermissionAction(permission, IGNORED, |
166 requesting_origin.SchemeIsSecure()); | 166 requesting_origin.SchemeIsSecure()); |
167 } | 167 } |
OLD | NEW |