| 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..3579198aae50fc31ee768cb724afab713f913200 100644
|
| --- a/chrome/renderer/plugins/plugin_uma.cc
|
| +++ b/chrome/renderer/plugins/plugin_uma.cc
|
| @@ -9,15 +9,18 @@
|
|
|
| #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 kShockwaveFlashType[] = "application/x-shockwave-flash";
|
| +const char kWidevineCDMType[] = "application/x-ppapi-widevine-cdm";
|
|
|
| // Arrays containing file extensions connected with specific plugins.
|
| // The arrays must be sorted because binary search is used on them.
|
| @@ -43,6 +46,11 @@ const char* kQuickTimeExtensions[] = {
|
| ".qtif"
|
| };
|
|
|
| +const char* kShockwaveFlashExtensions[] = {
|
| + ".flv",
|
| + ".swf"
|
| +};
|
| +
|
| } // namespace.
|
|
|
| class UMASenderImpl : public MissingPluginReporter::UMASender {
|
| @@ -54,7 +62,7 @@ void UMASenderImpl::SendPluginUMA(
|
| MissingPluginReporter::PluginType plugin_type) {
|
| UMA_HISTOGRAM_ENUMERATION("Plugin.MissingPlugins",
|
| plugin_type,
|
| - MissingPluginReporter::OTHER);
|
| + MissingPluginReporter::PLUGIN_TYPE_MAX);
|
| }
|
|
|
| // static.
|
| @@ -137,12 +145,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 +170,17 @@ 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.c_str(), kShockwaveFlashType)
|
| + return SHOCKWAVE_FLASH;
|
|
|
| + if (mime_type.c_str(), kWidevineCDMType)
|
| + return WIDEVINE_CDM;
|
| +
|
| + return UNSUPPORTED_MIMETYPE;
|
| +}
|
|
|