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 "chrome/browser/permissions/permission_context_uma_util.h" | 5 #include "chrome/browser/permissions/permission_context_uma_util.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/permissions/permission_manager.h" | 10 #include "chrome/browser/permissions/permission_manager.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 case PermissionType::NOTIFICATIONS: | 198 case PermissionType::NOTIFICATIONS: |
199 return "Notifications"; | 199 return "Notifications"; |
200 case PermissionType::GEOLOCATION: | 200 case PermissionType::GEOLOCATION: |
201 return "Geolocation"; | 201 return "Geolocation"; |
202 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 202 case PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
203 return "ProtectedMediaIdentifier"; | 203 return "ProtectedMediaIdentifier"; |
204 case PermissionType::DURABLE_STORAGE: | 204 case PermissionType::DURABLE_STORAGE: |
205 return "DurableStorage"; | 205 return "DurableStorage"; |
206 case PermissionType::MIDI: | 206 case PermissionType::MIDI: |
207 return "Midi"; | 207 return "Midi"; |
208 case PermissionType::AUDIO_CAPTURE: | |
209 return "AudioRecording"; | |
210 case PermissionType::VIDEO_CAPTURE: | |
211 return "VideoRecording"; | |
208 case PermissionType::NUM: | 212 case PermissionType::NUM: |
209 break; | 213 break; |
210 } | 214 } |
211 NOTREACHED(); | 215 NOTREACHED(); |
palmer
2015/09/01 18:31:04
This should be the default: clause of the switch.
guoweis_left_chromium
2015/09/01 19:36:34
It's intended to be without default so compiler ca
| |
212 return std::string(); | 216 return std::string(); |
213 } | 217 } |
214 | 218 |
215 void RecordPermissionRequest(ContentSettingsType permission, | 219 void RecordPermissionRequest(ContentSettingsType permission, |
216 const GURL& requesting_origin, | 220 const GURL& requesting_origin, |
217 const GURL& embedding_origin, | 221 const GURL& embedding_origin, |
218 Profile* profile) { | 222 Profile* profile) { |
219 bool secure_origin = content::IsOriginSecure(requesting_origin); | 223 bool secure_origin = content::IsOriginSecure(requesting_origin); |
220 PermissionType type; | 224 PermissionType type; |
221 switch (permission) { | 225 switch (permission) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 | 321 |
318 void PermissionContextUmaUtil::PermissionDismissed( | 322 void PermissionContextUmaUtil::PermissionDismissed( |
319 ContentSettingsType permission, const GURL& requesting_origin) { | 323 ContentSettingsType permission, const GURL& requesting_origin) { |
320 RecordPermissionAction(permission, DISMISSED, requesting_origin); | 324 RecordPermissionAction(permission, DISMISSED, requesting_origin); |
321 } | 325 } |
322 | 326 |
323 void PermissionContextUmaUtil::PermissionIgnored( | 327 void PermissionContextUmaUtil::PermissionIgnored( |
324 ContentSettingsType permission, const GURL& requesting_origin) { | 328 ContentSettingsType permission, const GURL& requesting_origin) { |
325 RecordPermissionAction(permission, IGNORED, requesting_origin); | 329 RecordPermissionAction(permission, IGNORED, requesting_origin); |
326 } | 330 } |
OLD | NEW |