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

Unified Diff: chrome/browser/ui/pdf/pdf_unsupported_feature.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: Move to content namespace. Update usages. Update extract_actions tool. 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
Index: chrome/browser/ui/pdf/pdf_unsupported_feature.cc
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 7e7082193c3a25590af49c7386bbc80718ee9940..d45fb742e2a9e0dac5aa0326842f10f1719d4858 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -22,7 +22,7 @@
#include "chrome/common/pref_names.h"
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
@@ -31,6 +31,7 @@
#include "ui/gfx/image/image.h"
#include "webkit/plugins/npapi/plugin_group.h"
+using content::UserMetricsAction;
using webkit::npapi::PluginGroup;
using webkit::WebPluginInfo;
@@ -73,7 +74,7 @@ PDFEnableAdobeReaderInfoBarDelegate::PDFEnableAdobeReaderInfoBarDelegate(
InfoBarTabHelper* infobar_helper, Profile* profile)
: ConfirmInfoBarDelegate(infobar_helper),
profile_(profile) {
- UserMetrics::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarShown"));
+ content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarShown"));
}
PDFEnableAdobeReaderInfoBarDelegate::~PDFEnableAdobeReaderInfoBarDelegate() {
@@ -112,7 +113,7 @@ string16 PDFEnableAdobeReaderInfoBarDelegate::GetMessageText() const {
}
void PDFEnableAdobeReaderInfoBarDelegate::OnYes() {
- UserMetrics::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK"));
+ content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK"));
PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_);
plugin_prefs->EnablePluginGroup(
true, ASCIIToUTF16(webkit::npapi::PluginGroup::kAdobeReaderGroupName));
@@ -121,7 +122,7 @@ void PDFEnableAdobeReaderInfoBarDelegate::OnYes() {
}
void PDFEnableAdobeReaderInfoBarDelegate::OnNo() {
- UserMetrics::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel"));
+ content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel"));
}
// Launch the url to get the latest Adbobe Reader installer.
@@ -162,7 +163,7 @@ class PDFUnsupportedFeatureInterstitial : public ChromeInterstitialPage {
tab->tab_contents(), false, tab->tab_contents()->GetURL()),
tab_contents_(tab),
reader_webplugininfo_(reader_webplugininfo) {
- UserMetrics::RecordAction(UserMetricsAction("PDF_ReaderInterstitialShown"));
+ content::RecordAction(UserMetricsAction("PDF_ReaderInterstitialShown"));
}
protected:
@@ -197,18 +198,18 @@ class PDFUnsupportedFeatureInterstitial : public ChromeInterstitialPage {
virtual void CommandReceived(const std::string& command) {
if (command == "0") {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("PDF_ReaderInterstitialCancel"));
DontProceed();
return;
}
if (command == "1") {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("PDF_ReaderInterstitialUpdate"));
OpenReaderUpdateURL(tab());
} else if (command == "2") {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("PDF_ReaderInterstitialIgnore"));
OpenUsingReader(tab_contents_, reader_webplugininfo_, NULL, NULL);
} else {
@@ -263,12 +264,12 @@ PDFUnsupportedFeatureInfoBarDelegate::PDFUnsupportedFeatureInfoBarDelegate(
reader_installed_(!!reader_group),
reader_vulnerable_(false) {
if (!reader_installed_) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("PDF_InstallReaderInfoBarShown"));
return;
}
- UserMetrics::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarShown"));
+ content::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarShown"));
const std::vector<WebPluginInfo>& plugins =
reader_group->web_plugin_infos();
DCHECK_EQ(plugins.size(), 1u);
@@ -324,12 +325,12 @@ string16 PDFUnsupportedFeatureInfoBarDelegate::GetMessageText() const {
bool PDFUnsupportedFeatureInfoBarDelegate::OnYes() {
if (!reader_installed_) {
- UserMetrics::RecordAction(UserMetricsAction("PDF_InstallReaderInfoBarOK"));
+ content::RecordAction(UserMetricsAction("PDF_InstallReaderInfoBarOK"));
OpenReaderUpdateURL(tab_contents_->tab_contents());
return true;
}
- UserMetrics::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarOK"));
+ content::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarOK"));
if (reader_vulnerable_) {
PDFUnsupportedFeatureInterstitial* interstitial =
@@ -352,8 +353,8 @@ bool PDFUnsupportedFeatureInfoBarDelegate::OnYes() {
}
void PDFUnsupportedFeatureInfoBarDelegate::OnNo() {
- UserMetrics::RecordAction(reader_installed_ ?
- UserMetricsAction("PDF_UseReaderInfoBarCancel") :
+ content::RecordAction(reader_installed_ ?
+ UserMetricsAction("PDF_UseReaderInfoBarCancel") :
UserMetricsAction("PDF_InstallReaderInfoBarCancel"));
}

Powered by Google App Engine
This is Rietveld 408576698