OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/plugins/plugin_uma.h" | 5 #include "chrome/renderer/plugins/plugin_uma.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 | 9 |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "content/public/common/content_constants.h" | 12 #include "content/public/common/content_constants.h" |
13 #include "third_party/widevine/cdm/widevine_cdm_common.h" | 13 #include "third_party/widevine/cdm/widevine_cdm_common.h" |
14 #include "webkit/plugins/plugin_constants.h" | |
15 | 14 |
16 namespace { | 15 namespace { |
17 | 16 |
18 // String we will use to convert mime type to plugin type. | 17 // String we will use to convert mime type to plugin type. |
19 const char kWindowsMediaPlayerType[] = "application/x-mplayer2"; | 18 const char kWindowsMediaPlayerType[] = "application/x-mplayer2"; |
20 const char kSilverlightTypePrefix[] = "application/x-silverlight"; | 19 const char kSilverlightTypePrefix[] = "application/x-silverlight"; |
21 const char kRealPlayerTypePrefix[] = "audio/x-pn-realaudio"; | 20 const char kRealPlayerTypePrefix[] = "audio/x-pn-realaudio"; |
22 const char kJavaTypeSubstring[] = "application/x-java-applet"; | 21 const char kJavaTypeSubstring[] = "application/x-java-applet"; |
23 const char kQuickTimeType[] = "video/quicktime"; | 22 const char kQuickTimeType[] = "video/quicktime"; |
24 | 23 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 184 |
186 if (strstr(mime_type.c_str(), kJavaTypeSubstring)) | 185 if (strstr(mime_type.c_str(), kJavaTypeSubstring)) |
187 return JAVA; | 186 return JAVA; |
188 | 187 |
189 if (mime_type == kQuickTimeType) | 188 if (mime_type == kQuickTimeType) |
190 return QUICKTIME; | 189 return QUICKTIME; |
191 | 190 |
192 if (mime_type == content::kBrowserPluginMimeType) | 191 if (mime_type == content::kBrowserPluginMimeType) |
193 return BROWSER_PLUGIN; | 192 return BROWSER_PLUGIN; |
194 | 193 |
195 if (mime_type == kFlashPluginSwfMimeType || | 194 if (mime_type == content::kFlashPluginSwfMimeType || |
196 mime_type == kFlashPluginSplMimeType) { | 195 mime_type == content::kFlashPluginSplMimeType) { |
197 return SHOCKWAVE_FLASH; | 196 return SHOCKWAVE_FLASH; |
198 } | 197 } |
199 | 198 |
200 #if defined(ENABLE_PEPPER_CDMS) | 199 #if defined(ENABLE_PEPPER_CDMS) |
201 if (mime_type == kWidevineCdmPluginMimeType) | 200 if (mime_type == kWidevineCdmPluginMimeType) |
202 return WIDEVINE_CDM; | 201 return WIDEVINE_CDM; |
203 #endif | 202 #endif |
204 | 203 |
205 return UNSUPPORTED_MIMETYPE; | 204 return UNSUPPORTED_MIMETYPE; |
206 } | 205 } |
OLD | NEW |