Chromium Code Reviews| Index: chrome/browser/plugins/chrome_plugin_service_filter.cc |
| diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc |
| index 35962492ac85ad93c3ef94d9cccc1f01b4913684..984a3b1e2262cdea49e98a6508bd9e6aec2c34f6 100644 |
| --- a/chrome/browser/plugins/chrome_plugin_service_filter.cc |
| +++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc |
| @@ -24,12 +24,14 @@ |
| #include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/render_process_host.h" |
| #include "content/public/browser/resource_context.h" |
| +#include "content/public/browser/user_metrics.h" |
| #include "content/public/browser/web_contents.h" |
| #include "grit/components_strings.h" |
| #include "grit/theme_resources.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/window_open_disposition.h" |
| +using base::UserMetricsAction; |
| using content::BrowserThread; |
| using content::PluginService; |
| @@ -81,6 +83,55 @@ NPAPIRemovalInfoBarDelegate::NPAPIRemovalInfoBarDelegate( |
| const base::string16& plugin_name, |
| int message_id) |
| : plugin_name_(plugin_name), message_id_(message_id) { |
| + content::RecordAction(UserMetricsAction("NPAPIRemovalInfobar.Shown")); |
| + |
| + std::string name = base::UTF16ToUTF8(plugin_name); |
| + // This has to be an expanded if statement so extract_actions.py likes it. |
| + if (message_id == IDS_PLUGINS_NPAPI_REMOVED) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed")); |
| + if (name == PluginMetadata::kJavaGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.Java")); |
|
Will Harris
2015/05/12 00:38:35
this code shamelessly stolen from plugin_infobar_d
|
| + } else if (name == PluginMetadata::kQuickTimeGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.QuickTime")); |
| + } else if (name == PluginMetadata::kShockwaveGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.Shockwave")); |
| + } else if (name == PluginMetadata::kRealPlayerGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.RealPlayer")); |
| + } else if (name == PluginMetadata::kSilverlightGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.Silverlight")); |
| + } else if (name == PluginMetadata::kAdobeReaderGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.Removed.Reader")); |
| + } |
| + } else { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.RemovedSoon")); |
| + if (name == PluginMetadata::kJavaGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.RemovedSoon.Java")); |
| + } else if (name == PluginMetadata::kQuickTimeGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.RemovedSoon.QuickTime")); |
| + } else if (name == PluginMetadata::kShockwaveGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.RemovedSoon.Shockwave")); |
| + } else if (name == PluginMetadata::kRealPlayerGroupName) { |
| + content::RecordAction(UserMetricsAction( |
| + "NPAPIRemovalInfobar.Shown.RemovedSoon.RealPlayer")); |
| + } else if (name == PluginMetadata::kSilverlightGroupName) { |
| + content::RecordAction(UserMetricsAction( |
| + "NPAPIRemovalInfobar.Shown.RemovedSoon.Silverlight")); |
| + } else if (name == PluginMetadata::kAdobeReaderGroupName) { |
| + content::RecordAction( |
| + UserMetricsAction("NPAPIRemovalInfobar.Shown.RemovedSoon.Reader")); |
| + } |
| + } |
| } |
| NPAPIRemovalInfoBarDelegate::~NPAPIRemovalInfoBarDelegate() { |
| @@ -109,6 +160,7 @@ bool NPAPIRemovalInfoBarDelegate::LinkClicked( |
| GURL(kLearnMoreUrl), content::Referrer(), |
| (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| ui::PAGE_TRANSITION_LINK, false)); |
| + content::RecordAction(UserMetricsAction("NPAPIRemovalInfobar.LearnMore")); |
| return true; |
| } |