Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2647)

Unified Diff: chrome/browser/plugin_observer.cc

Issue 8919017: Split UserMetrics into API vs. implementation. Move API to content/public. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Version for commit (merged again). Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/password_manager/password_manager.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_observer.cc
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index b01c08379a980c12f120dbfba5307e5e5ced6dc3..6547addd664050d23bc46aee70eadd13d81ca64b 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -21,7 +21,7 @@
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
@@ -29,6 +29,8 @@
#include "webkit/plugins/npapi/plugin_group.h"
#include "webkit/plugins/webplugininfo.h"
+using content::UserMetricsAction;
+
namespace {
// PluginInfoBarDelegate ------------------------------------------------------
@@ -119,27 +121,27 @@ BlockedPluginInfoBarDelegate::BlockedPluginInfoBarDelegate(
const string16& utf16_name)
: PluginInfoBarDelegate(infobar_helper, utf16_name),
content_settings_(content_settings) {
- UserMetrics::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown"));
+ content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown"));
std::string name = UTF16ToUTF8(utf16_name);
if (name == webkit::npapi::PluginGroup::kJavaGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Shown.Java"));
else if (name == webkit::npapi::PluginGroup::kQuickTimeGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Shown.QuickTime"));
else if (name == webkit::npapi::PluginGroup::kShockwaveGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Shown.Shockwave"));
else if (name == webkit::npapi::PluginGroup::kRealPlayerGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Shown.RealPlayer"));
else if (name == webkit::npapi::PluginGroup::kWindowsMediaPlayerGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Shown.WindowsMediaPlayer"));
}
BlockedPluginInfoBarDelegate::~BlockedPluginInfoBarDelegate() {
- UserMetrics::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed"));
+ content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed"));
}
std::string BlockedPluginInfoBarDelegate::GetLearnMoreURL() const {
@@ -157,13 +159,13 @@ string16 BlockedPluginInfoBarDelegate::GetButtonLabel(
}
bool BlockedPluginInfoBarDelegate::Accept() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.AllowThisTime"));
return PluginInfoBarDelegate::Cancel();
}
bool BlockedPluginInfoBarDelegate::Cancel() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.AlwaysAllow"));
content_settings_->AddExceptionForURL(owner()->tab_contents()->GetURL(),
owner()->tab_contents()->GetURL(),
@@ -174,13 +176,13 @@ bool BlockedPluginInfoBarDelegate::Cancel() {
}
void BlockedPluginInfoBarDelegate::InfoBarDismissed() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.Dismissed"));
}
bool BlockedPluginInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BlockedPluginInfobar.LearnMore"));
return PluginInfoBarDelegate::LinkClicked(disposition);
}
@@ -216,30 +218,30 @@ OutdatedPluginInfoBarDelegate::OutdatedPluginInfoBarDelegate(
const GURL& update_url)
: PluginInfoBarDelegate(infobar_helper, utf16_name),
update_url_(update_url) {
- UserMetrics::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown"));
+ content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown"));
std::string name = UTF16ToUTF8(utf16_name);
if (name == webkit::npapi::PluginGroup::kJavaGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.Java"));
else if (name == webkit::npapi::PluginGroup::kQuickTimeGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.QuickTime"));
else if (name == webkit::npapi::PluginGroup::kShockwaveGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.Shockwave"));
else if (name == webkit::npapi::PluginGroup::kRealPlayerGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.RealPlayer"));
else if (name == webkit::npapi::PluginGroup::kSilverlightGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.Silverlight"));
else if (name == webkit::npapi::PluginGroup::kAdobeReaderGroupName)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Shown.Reader"));
}
OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() {
- UserMetrics::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed"));
+ content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed"));
}
std::string OutdatedPluginInfoBarDelegate::GetLearnMoreURL() const {
@@ -257,26 +259,26 @@ string16 OutdatedPluginInfoBarDelegate::GetButtonLabel(
}
bool OutdatedPluginInfoBarDelegate::Accept() {
- UserMetrics::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Update"));
+ content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Update"));
owner()->tab_contents()->OpenURL(update_url_, GURL(), NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK);
return false;
}
bool OutdatedPluginInfoBarDelegate::Cancel() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.AllowThisTime"));
return PluginInfoBarDelegate::Cancel();
}
void OutdatedPluginInfoBarDelegate::InfoBarDismissed() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.Dismissed"));
}
bool OutdatedPluginInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OutdatedPluginInfobar.LearnMore"));
return PluginInfoBarDelegate::LinkClicked(disposition);
}
« no previous file with comments | « chrome/browser/password_manager/password_manager.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698