Index: chrome/renderer/plugins/plugin_uma.cc |
diff --git a/chrome/renderer/plugins/plugin_uma.cc b/chrome/renderer/plugins/plugin_uma.cc |
index 5f1bec1a5e72d005f23e639a14549dbebc553817..6964161b31673dc3265386ae3d9eaadf4344315a 100644 |
--- a/chrome/renderer/plugins/plugin_uma.cc |
+++ b/chrome/renderer/plugins/plugin_uma.cc |
@@ -9,15 +9,19 @@ |
#include "base/metrics/histogram.h" |
#include "base/string_util.h" |
+#include "content/public/common/content_constants.h" |
namespace { |
-// String we will use to convert mime tyoe to plugin type. |
+// String we will use to convert mime type to plugin type. |
const char kWindowsMediaPlayerType[] = "application/x-mplayer2"; |
const char kSilverlightTypePrefix[] = "application/x-silverlight"; |
const char kRealPlayerTypePrefix[] = "audio/x-pn-realaudio"; |
const char kJavaTypeSubstring[] = "application/x-java-applet"; |
const char kQuickTimeType[] = "video/quicktime"; |
+const char kFlashPluginSwfMimeType[] = "application/x-shockwave-flash"; |
ddorwin
2013/04/05 05:32:17
Are we allowed to include webkit/plugins/plugin_co
Bernhard Bauer
2013/04/05 13:29:10
Yes.
xhwang
2013/04/05 19:00:09
Done.
|
+const char kFlashPluginSplMimeType[] = "application/futuresplash"; |
+const char kWidevineCDMType[] = "application/x-ppapi-widevine-cdm"; |
ddorwin
2013/04/05 05:32:17
Should we include widevine_cdm_common.h?
xhwang
2013/04/05 19:00:09
Done.
|
// Arrays containing file extensions connected with specific plugins. |
// The arrays must be sorted because binary search is used on them. |
@@ -43,6 +47,11 @@ const char* kQuickTimeExtensions[] = { |
".qtif" |
}; |
+const char* kShockwaveFlashExtensions[] = { |
+ ".swf", |
+ ".spl" |
+}; |
+ |
} // namespace. |
class UMASenderImpl : public MissingPluginReporter::UMASender { |
@@ -54,7 +63,7 @@ void UMASenderImpl::SendPluginUMA( |
MissingPluginReporter::PluginType plugin_type) { |
UMA_HISTOGRAM_ENUMERATION("Plugin.MissingPlugins", |
plugin_type, |
- MissingPluginReporter::OTHER); |
+ MissingPluginReporter::PLUGIN_TYPE_MAX); |
} |
// static. |
@@ -137,12 +146,18 @@ MissingPluginReporter::PluginType MissingPluginReporter::SrcToPluginType( |
return REALPLAYER; |
} |
- return OTHER; |
+ if (CStringArrayContainsCString(kShockwaveFlashExtensions, |
+ arraysize(kShockwaveFlashExtensions), |
+ file_extension.c_str())) { |
+ return SHOCKWAVE_FLASH; |
+ } |
+ |
+ return UNSUPPORTED_EXTENSION; |
} |
MissingPluginReporter::PluginType MissingPluginReporter::MimeTypeToPluginType( |
const std::string& mime_type) { |
- if (strcmp(mime_type.c_str(), kWindowsMediaPlayerType) == 0) |
+ if (mime_type == kWindowsMediaPlayerType) |
return WINDOWS_MEDIA_PLAYER; |
size_t prefix_length = strlen(kSilverlightTypePrefix); |
@@ -156,9 +171,19 @@ MissingPluginReporter::PluginType MissingPluginReporter::MimeTypeToPluginType( |
if (strstr(mime_type.c_str(), kJavaTypeSubstring)) |
return JAVA; |
- if (strcmp(mime_type.c_str(), kQuickTimeType) == 0) |
+ if (mime_type == kQuickTimeType) |
return QUICKTIME; |
- return OTHER; |
-} |
+ if (mime_type == content::kBrowserPluginMimeType) |
+ return BROWSER_PLUGIN; |
+ |
+ if (mime_type == kFlashPluginSwfMimeType || |
+ mime_type == kFlashPluginSplMimeType) { |
+ return SHOCKWAVE_FLASH; |
+ } |
+ if (mime_type == kWidevineCDMType) |
+ return WIDEVINE_CDM; |
+ |
+ return UNSUPPORTED_MIMETYPE; |
+} |