summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 13:23:38 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 13:23:38 +0000
commit7f6f44c9e44707612415d4c85cfe9924aeacd917 (patch)
tree167b6d29691a127ef3ab1ada5b6f9c774d99363d /chrome/browser
parent7af0889d30c9a27b916aa49d4bfea7ea92465072 (diff)
downloadchromium_src-7f6f44c9e44707612415d4c85cfe9924aeacd917.zip
chromium_src-7f6f44c9e44707612415d4c85cfe9924aeacd917.tar.gz
chromium_src-7f6f44c9e44707612415d4c85cfe9924aeacd917.tar.bz2
Split UserMetrics into API vs. implementation. Move API to content/public.
TBR=davemoore@chromium.org BUG=98716 Review URL: http://codereview.chromium.org/8919017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/about_flags.cc10
-rw-r--r--chrome/browser/app_controller_mac.mm7
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc8
-rw-r--r--chrome/browser/background/background_mode_manager.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.cc20
-rw-r--r--chrome/browser/browsing_data_remover.cc17
-rw-r--r--chrome/browser/chrome_browser_main.cc1
-rw-r--r--chrome/browser/chromeos/external_metrics.cc7
-rw-r--r--chrome/browser/chromeos/locale_change_guard.cc8
-rw-r--r--chrome/browser/chromeos/login/login_performer.cc9
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc9
-rw-r--r--chrome/browser/chromeos/login/screen_locker_views.cc6
-rw-r--r--chrome/browser/chromeos/media/media_player.cc3
-rw-r--r--chrome/browser/chromeos/status/input_method_menu.cc8
-rw-r--r--chrome/browser/chromeos/system_key_event_listener.cc14
-rw-r--r--chrome/browser/content_settings/content_settings_default_provider.cc3
-rw-r--r--chrome/browser/content_settings/content_settings_pref_provider.cc3
-rw-r--r--chrome/browser/content_settings/cookie_settings.cc7
-rw-r--r--chrome/browser/content_settings/host_content_settings_map.cc3
-rw-r--r--chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc10
-rw-r--r--chrome/browser/extensions/crx_installer.cc3
-rw-r--r--chrome/browser/extensions/extension_function.cc5
-rw-r--r--chrome/browser/extensions/extension_metrics_module.cc5
-rw-r--r--chrome/browser/extensions/extension_service.cc1
-rw-r--r--chrome/browser/extensions/file_manager_util.cc5
-rw-r--r--chrome/browser/extensions/installed_loader.cc5
-rw-r--r--chrome/browser/first_run/first_run.cc6
-rw-r--r--chrome/browser/first_run/first_run_win.cc4
-rw-r--r--chrome/browser/password_manager/password_manager.cc7
-rw-r--r--chrome/browser/plugin_observer.cc50
-rw-r--r--chrome/browser/profiles/profile_impl.cc7
-rw-r--r--chrome/browser/profiles/profile_manager.cc5
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc5
-rw-r--r--chrome/browser/search_engines/template_url.cc9
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc21
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc22
-rw-r--r--chrome/browser/themes/theme_service.cc13
-rw-r--r--chrome/browser/ui/browser.cc167
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm10
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm6
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm14
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm10
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm10
-rw-r--r--chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm6
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm10
-rw-r--r--chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm6
-rw-r--r--chrome/browser/ui/content_settings/content_setting_bubble_model.cc7
-rw-r--r--chrome/browser/ui/fullscreen_controller.cc6
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc6
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc14
-rw-r--r--chrome/browser/ui/gtk/browser_toolbar_gtk.cc6
-rw-r--r--chrome/browser/ui/gtk/gtk_theme_service.cc1
-rw-r--r--chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc6
-rw-r--r--chrome/browser/ui/pdf/pdf_unsupported_feature.cc31
-rw-r--r--chrome/browser/ui/search_engines/edit_search_engine_controller.cc6
-rw-r--r--chrome/browser/ui/search_engines/keyword_editor_controller.cc10
-rw-r--r--chrome/browser/ui/toolbar/back_forward_menu_model.cc12
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc8
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc18
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc7
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc15
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc20
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc3
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc5
-rw-r--r--chrome/browser/ui/views/critical_notification_bubble_view.cc12
-rw-r--r--chrome/browser/ui/views/first_run_bubble.cc6
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc35
-rw-r--r--chrome/browser/ui/views/importer/import_lock_dialog_view.cc6
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_win.cc8
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc10
-rw-r--r--chrome/browser/ui/views/tabs/default_tab_drag_controller.cc20
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc6
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc5
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc6
-rw-r--r--chrome/browser/ui/webui/downloads_dom_handler.cc3
-rw-r--r--chrome/browser/ui/webui/flash_ui.cc6
-rw-r--r--chrome/browser/ui/webui/history_ui.cc4
-rw-r--r--chrome/browser/ui/webui/metrics_handler.cc5
-rw-r--r--chrome/browser/ui/webui/ntp/most_visited_handler.cc10
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc3
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_handler.cc30
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc8
-rw-r--r--chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc12
-rw-r--r--chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc6
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc22
-rw-r--r--chrome/browser/ui/webui/options/core_options_handler.cc10
-rw-r--r--chrome/browser/ui/webui/options/language_options_handler.cc6
-rw-r--r--chrome/browser/ui/webui/options/language_options_handler_common.cc10
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc4
-rw-r--r--chrome/browser/ui/webui/options/personal_options_handler.cc8
-rw-r--r--chrome/browser/web_resource/notification_promo.cc8
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc2
95 files changed, 595 insertions, 448 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 543a830..3a70076 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -19,7 +19,7 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/gl/gl_switches.h"
@@ -28,6 +28,8 @@
#include "ui/aura/aura_switches.h"
#endif
+using content::UserMetricsAction;
+
namespace about_flags {
// Macros to simplify specifying the type.
@@ -695,13 +697,13 @@ void RecordUMAStatistics(const PrefService* prefs) {
++it) {
std::string action("AboutFlags_");
action += *it;
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
// Since flag metrics are recorded every startup, add a tick so that the
// stats can be made meaningful.
if (flags.size())
- UserMetrics::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
- UserMetrics::RecordAction(UserMetricsAction("StartupTick"));
+ content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
+ content::RecordAction(UserMetricsAction("StartupTick"));
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 54783b4..814b019 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -63,10 +63,10 @@
#include "chrome/common/url_constants.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
@@ -75,6 +75,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
using content::BrowserThread;
+using content::UserMetricsAction;
// 10.6 adds a public API for the Spotlight-backed search menu item in the Help
// menu. Provide the declaration so it can be called below when building with
@@ -824,7 +825,7 @@ const AEEventClass kAECloudPrintUninstallClass = 'GCPu';
break;
}
case IDC_SHOW_BOOKMARK_MANAGER:
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"));
+ content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
if (Browser* browser = ActivateBrowser(lastProfile)) {
// Open a bookmark manager tab.
browser->OpenBookmarkManager();
@@ -874,7 +875,7 @@ const AEEventClass kAECloudPrintUninstallClass = 'GCPu';
ProfileSyncService::START_FROM_WRENCH);
break;
case IDC_TASK_MANAGER:
- UserMetrics::RecordAction(UserMetricsAction("TaskManager"));
+ content::RecordAction(UserMetricsAction("TaskManager"));
TaskManagerMac::Show(false);
break;
case IDC_OPTIONS:
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index aefa775..f6a115c 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -42,12 +42,14 @@
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "googleurl/src/url_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
+using content::UserMetricsAction;
+
///////////////////////////////////////////////////////////////////////////////
// AutocompleteEditController
@@ -548,7 +550,7 @@ void AutocompleteEditModel::OpenMatch(const AutocompleteMatch& match,
}
if (template_url) {
- UserMetrics::RecordAction(UserMetricsAction("AcceptedKeyword"));
+ content::RecordAction(UserMetricsAction("AcceptedKeyword"));
template_url_service->IncrementUsageCount(template_url);
if (match.transition == content::PAGE_TRANSITION_KEYWORD ||
@@ -607,7 +609,7 @@ bool AutocompleteEditModel::AcceptKeyword() {
// since the edit contents have disappeared. It
// doesn't really matter, but we clear it to be
// consistent.
- UserMetrics::RecordAction(UserMetricsAction("AcceptedKeywordHint"));
+ content::RecordAction(UserMetricsAction("AcceptedKeywordHint"));
return true;
}
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index 75f8916..3b1f875 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -26,15 +26,17 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using content::UserMetricsAction;
+
BackgroundModeManager::BackgroundModeData::BackgroundModeData(
int command_id,
Profile* profile)
@@ -467,7 +469,7 @@ void BackgroundModeManager::ExecuteCommand(int command_id) {
bmd->GetBrowserWindow()->OpenTaskManager(true);
break;
case IDC_EXIT:
- UserMetrics::RecordAction(UserMetricsAction("Exit"));
+ content::RecordAction(UserMetricsAction("Exit"));
BrowserList::AttemptExit();
break;
case IDC_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND: {
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
index a7fdbe7..bf3736e 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
@@ -16,10 +16,12 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/page_navigator.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
BookmarkContextMenuController::BookmarkContextMenuController(
gfx::NativeWindow parent_window,
BookmarkContextMenuControllerDelegate* delegate,
@@ -111,15 +113,15 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
WindowOpenDisposition initial_disposition;
if (id == IDC_BOOKMARK_BAR_OPEN_ALL) {
initial_disposition = NEW_FOREGROUND_TAB;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAll"));
} else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) {
initial_disposition = NEW_WINDOW;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow"));
} else {
initial_disposition = OFF_THE_RECORD;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito"));
}
bookmark_utils::OpenAll(parent_window_, profile_, navigator_, selection_,
@@ -129,7 +131,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
case IDC_BOOKMARK_BAR_RENAME_FOLDER:
case IDC_BOOKMARK_BAR_EDIT:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Edit"));
if (selection_.size() != 1) {
@@ -145,7 +147,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
break;
case IDC_BOOKMARK_BAR_REMOVE: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Remove"));
for (size_t i = 0; i < selection_.size(); ++i) {
@@ -158,7 +160,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
}
case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Add"));
int index;
@@ -173,7 +175,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
}
case IDC_BOOKMARK_BAR_NEW_FOLDER: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_NewFolder"));
int index;
@@ -192,7 +194,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) {
break;
case IDC_BOOKMARK_MANAGER: {
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"));
+ content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
if (!browser) NOTREACHED();
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
index ebfe318..d708cd9 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -43,10 +43,10 @@
#include "chrome/common/url_constants.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/in_process_webkit/webkit_context.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_data_remover.h"
+#include "content/public/browser/user_metrics.h"
#include "net/base/cookie_monster.h"
#include "net/base/net_errors.h"
#include "net/base/transport_security_state.h"
@@ -58,6 +58,7 @@
#include "webkit/quota/quota_types.h"
using content::BrowserThread;
+using content::UserMetricsAction;
// Done so that we can use PostTask on BrowsingDataRemovers and not have
// BrowsingDataRemover implement RefCounted.
@@ -153,7 +154,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (history_service) {
std::set<GURL> restrict_urls;
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_History"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_History"));
waiting_for_clear_history_ = true;
history_service->ExpireHistoryBetween(restrict_urls,
delete_begin_, delete_end_,
@@ -211,7 +212,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
if (remove_mask & REMOVE_DOWNLOADS) {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"));
DownloadManager* download_manager =
DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager();
download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_);
@@ -219,7 +220,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
if (remove_mask & REMOVE_COOKIES) {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
// Since we are running on the UI thread don't call GetURLRequestContext().
net::URLRequestContextGetter* rq_context = profile_->GetRequestContext();
if (rq_context) {
@@ -256,7 +257,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
if (remove_mask & REMOVE_PLUGIN_DATA) {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData"));
waiting_for_clear_plugin_data_ = true;
if (!plugin_data_remover_.get()) {
@@ -269,7 +270,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
if (remove_mask & REMOVE_PASSWORDS) {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
PasswordStore* password_store =
profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS);
@@ -278,7 +279,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
}
if (remove_mask & REMOVE_FORM_DATA) {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill"));
WebDataService* web_data_service =
profile_->GetWebDataService(Profile::EXPLICIT_ACCESS);
@@ -301,7 +302,7 @@ void BrowsingDataRemover::Remove(int remove_mask) {
// Invoke DoClearCache on the IO thread.
waiting_for_clear_cache_ = true;
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cache"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_Cache"));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 8e37265..c31dfd9 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -170,7 +170,6 @@
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/shell_util.h"
-#include "content/browser/user_metrics.h"
#include "net/base/net_util.h"
#include "printing/printed_document.h"
#include "ui/base/l10n/l10n_util_win.h"
diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc
index 73ec755..c3a6188 100644
--- a/chrome/browser/chromeos/external_metrics.cc
+++ b/chrome/browser/chromeos/external_metrics.cc
@@ -15,18 +15,19 @@
#include <string>
-#include "base/bind.h"
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/eintr_wrapper.h"
#include "base/metrics/histogram.h"
#include "base/perftimer.h"
#include "base/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/metrics_service.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/user_metrics.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace chromeos {
@@ -60,7 +61,7 @@ void ExternalMetrics::Start() {
void ExternalMetrics::RecordActionUI(std::string action_string) {
if (valid_user_actions_.count(action_string)) {
- UserMetrics::RecordComputedAction(action_string);
+ content::RecordComputedAction(action_string);
} else {
LOG(ERROR) << "undefined UMA action: " << action_string;
}
diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc
index 485d32c..db63722 100644
--- a/chrome/browser/chromeos/locale_change_guard.cc
+++ b/chrome/browser/chromeos/locale_change_guard.cc
@@ -16,13 +16,15 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
namespace chromeos {
class LocaleChangeGuard::Delegate : public NotificationDelegate {
@@ -67,7 +69,7 @@ void LocaleChangeGuard::RevertLocaleChange(const ListValue* list) {
if (reverted_)
return;
reverted_ = true;
- UserMetrics::RecordAction(UserMetricsAction("LanguageChange_Revert"));
+ content::RecordAction(UserMetricsAction("LanguageChange_Revert"));
profile_->ChangeAppLocale(
from_locale_, Profile::APP_LOCALE_CHANGED_VIA_REVERT);
@@ -192,7 +194,7 @@ void LocaleChangeGuard::AcceptLocaleChange() {
}
if (prefs->GetString(prefs::kApplicationLocale) != to_locale_)
return;
- UserMetrics::RecordAction(UserMetricsAction("LanguageChange_Accept"));
+ content::RecordAction(UserMetricsAction("LanguageChange_Accept"));
prefs->SetString(prefs::kApplicationLocaleBackup, to_locale_);
prefs->SetString(prefs::kApplicationLocaleAccepted, to_locale_);
prefs->ScheduleSavePersistentPrefs();
diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc
index ed24677..d2e927a 100644
--- a/chrome/browser/chromeos/login/login_performer.cc
+++ b/chrome/browser/chromeos/login/login_performer.cc
@@ -26,10 +26,10 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_store.h"
@@ -39,6 +39,7 @@
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace chromeos {
@@ -72,7 +73,7 @@ LoginPerformer::~LoginPerformer() {
// LoginPerformer, LoginStatusConsumer implementation:
void LoginPerformer::OnLoginFailure(const LoginFailure& failure) {
- UserMetrics::RecordAction(UserMetricsAction("Login_Failure"));
+ content::RecordAction(UserMetricsAction("Login_Failure"));
UMA_HISTOGRAM_ENUMERATION("Login.FailureReason", failure.reason(),
LoginFailure::NUM_FAILURE_REASONS);
@@ -126,7 +127,7 @@ void LoginPerformer::OnLoginSuccess(
const GaiaAuthConsumer::ClientLoginResult& credentials,
bool pending_requests,
bool using_oauth) {
- UserMetrics::RecordAction(UserMetricsAction("Login_Success"));
+ content::RecordAction(UserMetricsAction("Login_Success"));
// 0 - Login success offline and online. It's a new user. or it's an
// existing user and offline auth took longer than online auth.
// 1 - Login success offline only. It's an existing user login.
@@ -201,7 +202,7 @@ void LoginPerformer::OnProfileCreated(
}
void LoginPerformer::OnOffTheRecordLoginSuccess() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Login_GuestLoginSuccess"));
if (delegate_)
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index efffa63..09450fd 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -36,9 +36,9 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h"
@@ -53,6 +53,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
@@ -217,7 +218,7 @@ void ScreenLocker::Init() {
void ScreenLocker::OnLoginFailure(const LoginFailure& error) {
DVLOG(1) << "OnLoginFailure";
- UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure"));
+ content::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure"));
if (authentication_start_time_.is_null()) {
LOG(ERROR) << "authentication_start_time_ is not set";
} else {
@@ -324,7 +325,7 @@ void ScreenLocker::Signout() {
// TODO(flackr): For proper functionality, check if (error_info) is NULL
// (crbug.com/105267).
delegate_->ClearErrors();
- UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Signout"));
+ content::RecordAction(UserMetricsAction("ScreenLocker_Signout"));
#if defined(TOOLKIT_USES_GTK)
WmIpc::instance()->NotifyAboutSignout();
#endif
@@ -349,7 +350,7 @@ void ScreenLocker::SetLoginStatusConsumer(
// static
void ScreenLocker::Show() {
DVLOG(1) << "In ScreenLocker::Show";
- UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Show"));
+ content::RecordAction(UserMetricsAction("ScreenLocker_Show"));
DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI);
// Check whether the currently logged in user is a guest account and if so,
diff --git a/chrome/browser/chromeos/login/screen_locker_views.cc b/chrome/browser/chromeos/login/screen_locker_views.cc
index 7a82e25..7872427 100644
--- a/chrome/browser/chromeos/login/screen_locker_views.cc
+++ b/chrome/browser/chromeos/login/screen_locker_views.cc
@@ -27,7 +27,7 @@
#include "chrome/browser/ui/views/window.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/x/x11_util.h"
@@ -39,6 +39,8 @@
#include "ui/views/widget/native_widget_gtk.h"
#endif
+using content::UserMetricsAction;
+
namespace {
// The active ScreenLockerDelegate.
@@ -701,7 +703,7 @@ void ScreenLockerViews::OnGrabInputs() {
void ScreenLockerViews::StartScreenSaver() {
if (!background_view_->IsScreenSaverVisible()) {
VLOG(1) << "StartScreenSaver";
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ScreenLocker_StartScreenSaver"));
background_view_->ShowScreenSaver();
if (screen_lock_view_) {
diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc
index 4a67404..124edba 100644
--- a/chrome/browser/chromeos/media/media_player.cc
+++ b/chrome/browser/chromeos/media/media_player.cc
@@ -37,8 +37,8 @@
#include "chrome/common/url_constants.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -53,6 +53,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
static const char* kMediaPlayerAppName = "mediaplayer";
static const int kPopupLeft = 0;
diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc
index 4ac4b88..c1012d7 100644
--- a/chrome/browser/chromeos/status/input_method_menu.cc
+++ b/chrome/browser/chromeos/status/input_method_menu.cc
@@ -18,8 +18,8 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -30,6 +30,8 @@
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
// The language menu consists of 3 parts (in this order):
//
// (1) input method names. The size of the list is always >= 1.
@@ -354,7 +356,7 @@ void InputMethodMenu::ActivatedAt(int index) {
= input_method_descriptors_->at(index);
InputMethodManager::GetInstance()->ChangeInputMethod(
input_method.id());
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("LanguageMenuButton_InputMethodChanged"));
return;
}
@@ -488,7 +490,7 @@ void InputMethodMenu::FirstObserverIsAdded(InputMethodManager* manager) {
}
void InputMethodMenu::PrepareForMenuOpen() {
- UserMetrics::RecordAction(UserMetricsAction("LanguageMenuButton_Open"));
+ content::RecordAction(UserMetricsAction("LanguageMenuButton_Open"));
PrepareMenuModel();
}
diff --git a/chrome/browser/chromeos/system_key_event_listener.cc b/chrome/browser/chromeos/system_key_event_listener.cc
index 666d32a..330bf95 100644
--- a/chrome/browser/chromeos/system_key_event_listener.cc
+++ b/chrome/browser/chromeos/system_key_event_listener.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
#include "chrome/browser/chromeos/input_method/xkeyboard.h"
#include "chrome/browser/chromeos/volume_bubble.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h"
#include "ui/base/x/x11_util.h"
@@ -28,6 +28,8 @@
#include "base/message_pump_x.h"
#endif
+using content::UserMetricsAction;
+
namespace chromeos {
namespace {
@@ -337,29 +339,29 @@ bool SystemKeyEventListener::ProcessedXEvent(XEvent* xevent) {
if (!(state & (Mod1Mask | ShiftMask | ControlMask))) {
if (keycode == key_f6_ || keycode == key_brightness_down_) {
if (keycode == key_f6_)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Accel_BrightnessDown_F6"));
OnBrightnessDown();
return true;
} else if (keycode == key_f7_ || keycode == key_brightness_up_) {
if (keycode == key_f7_)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Accel_BrightnessUp_F7"));
OnBrightnessUp();
return true;
} else if (keycode == key_f8_ || keycode == key_volume_mute_) {
if (keycode == key_f8_)
- UserMetrics::RecordAction(UserMetricsAction("Accel_VolumeMute_F8"));
+ content::RecordAction(UserMetricsAction("Accel_VolumeMute_F8"));
OnVolumeMute();
return true;
} else if (keycode == key_f9_ || keycode == key_volume_down_) {
if (keycode == key_f9_)
- UserMetrics::RecordAction(UserMetricsAction("Accel_VolumeDown_F9"));
+ content::RecordAction(UserMetricsAction("Accel_VolumeDown_F9"));
OnVolumeDown();
return true;
} else if (keycode == key_f10_ || keycode == key_volume_up_) {
if (keycode == key_f10_)
- UserMetrics::RecordAction(UserMetricsAction("Accel_VolumeUp_F10"));
+ content::RecordAction(UserMetricsAction("Accel_VolumeUp_F10"));
OnVolumeUp();
return true;
}
diff --git a/chrome/browser/content_settings/content_settings_default_provider.cc b/chrome/browser/content_settings/content_settings_default_provider.cc
index c9987a0..bcc3db7 100644
--- a/chrome/browser/content_settings/content_settings_default_provider.cc
+++ b/chrome/browser/content_settings/content_settings_default_provider.cc
@@ -19,13 +19,14 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc
index 93f5aed..8a75fab 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -21,13 +21,14 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc
index 8ff471a..5d929ce 100644
--- a/chrome/browser/content_settings/cookie_settings.cc
+++ b/chrome/browser/content_settings/cookie_settings.cc
@@ -16,15 +16,16 @@
#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/base/static_cookie_policy.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
@@ -91,10 +92,10 @@ CookieSettings::CookieSettings(
block_third_party_cookies_(
prefs->GetBoolean(prefs::kBlockThirdPartyCookies)) {
if (block_third_party_cookies_) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ThirdPartyCookieBlockingEnabled"));
} else {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ThirdPartyCookieBlockingDisabled"));
}
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index ddd7eb7..82eacba 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -27,16 +27,17 @@
#include "chrome/common/content_settings_pattern.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/base/static_cookie_policy.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
index 6517cb7..957f33b 100644
--- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
+++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
@@ -10,10 +10,12 @@
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate(
InfoBarTabHelper* infobar_helper,
ProtocolHandlerRegistry* registry,
@@ -70,14 +72,14 @@ bool RegisterProtocolHandlerInfoBarDelegate::NeedElevation(
}
bool RegisterProtocolHandlerInfoBarDelegate::Accept() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.Infobar_Accept"));
registry_->OnAcceptRegisterProtocolHandler(handler_);
return true;
}
bool RegisterProtocolHandlerInfoBarDelegate::Cancel() {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny"));
registry_->OnIgnoreRegisterProtocolHandler(handler_);
return true;
@@ -89,7 +91,7 @@ string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const {
bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore"));
owner()->tab_contents()->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
chrome::kLearnMoreRegisterProtocolHandlerURL)), GURL(),
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index c7a900b..add5be9 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -32,9 +32,9 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_file_util.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -43,6 +43,7 @@
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc
index 2e2d702..1854de5 100644
--- a/chrome/browser/extensions/extension_function.cc
+++ b/chrome/browser/extensions/extension_function.cc
@@ -12,13 +12,14 @@
#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
#include "chrome/common/extensions/extension_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/result_codes.h"
using content::BrowserThread;
+using content::UserMetricsAction;
// static
void ExtensionFunctionDeleteTraits::Destruct(const ExtensionFunction* x) {
@@ -135,7 +136,7 @@ void ExtensionFunction::HandleBadMessage(base::ProcessHandle process) {
CHECK(false);
} else {
NOTREACHED();
- UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD"));
+ content::RecordAction(UserMetricsAction("BadMessageTerminate_EFD"));
if (process)
base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE,
false);
diff --git a/chrome/browser/extensions/extension_metrics_module.cc b/chrome/browser/extensions/extension_metrics_module.cc
index cd80ef9..48e5d08 100644
--- a/chrome/browser/extensions/extension_metrics_module.cc
+++ b/chrome/browser/extensions/extension_metrics_module.cc
@@ -6,16 +6,17 @@
#include "base/metrics/histogram.h"
#include "chrome/common/extensions/extension.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
using base::Histogram;
using base::LinearHistogram;
+using content::UserMetricsAction;
bool MetricsRecordUserActionFunction::RunImpl() {
std::string name;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &name));
- UserMetrics::RecordComputedAction(name);
+ content::RecordComputedAction(name);
return true;
}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 12ae1d2..40fb7c7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -92,7 +92,6 @@
#include "chrome/common/url_constants.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/plugin_service.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host_registry.h"
#include "content/public/browser/devtools_manager.h"
diff --git a/chrome/browser/extensions/file_manager_util.cc b/chrome/browser/extensions/file_manager_util.cc
index b3d344e..ecfc798 100644
--- a/chrome/browser/extensions/file_manager_util.cc
+++ b/chrome/browser/extensions/file_manager_util.cc
@@ -20,8 +20,8 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "content/browser/plugin_service.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
@@ -34,6 +34,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
#define FILEBROWSER_DOMAIN "hhaomjibdihmijegdhdafkllkbggdgoj"
const char kFileBrowserDomain[] = FILEBROWSER_DOMAIN;
@@ -279,7 +280,7 @@ void ViewFolder(const FilePath& dir) {
std::string url = chrome::kChromeUIFileManagerURL;
url += "#/" + net::EscapeUrlEncodedData(virtual_path.value(), false);
- UserMetrics::RecordAction(UserMetricsAction("ShowFileBrowserFullTab"));
+ content::RecordAction(UserMetricsAction("ShowFileBrowserFullTab"));
browser->ShowSingletonTabRespectRef(GURL(url));
}
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index d74bff4..61c17d6 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -18,9 +18,10 @@
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace errors = extension_manifest_errors;
@@ -88,7 +89,7 @@ void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
info.extension_id != extension->id()) {
error = errors::kCannotChangeExtensionID;
extension = NULL;
- UserMetrics::RecordAction(UserMetricsAction("Extensions.IDChangedError"));
+ content::RecordAction(UserMetricsAction("Extensions.IDChangedError"));
}
if (!extension) {
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index b03e322..fb93929 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -31,7 +31,7 @@
#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#if defined(OS_WIN)
@@ -40,6 +40,8 @@
#include "chrome/installer/util/install_util.h"
#endif
+using content::UserMetricsAction;
+
namespace {
// The kSentinelFile file absence will tell us it is a first run.
@@ -618,7 +620,7 @@ void FirstRun::AutoImport(
ImportSettings(profile, importer_host, importer_list, items);
}
- UserMetrics::RecordAction(UserMetricsAction("FirstRunDef_Accept"));
+ content::RecordAction(UserMetricsAction("FirstRunDef_Accept"));
// Launch the search engine dialog only for certain builds, and only if the
// user has not already set preferences.
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index b7e6401..e0b41e4 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -36,8 +36,8 @@
#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "google_update_idl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -46,6 +46,8 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
+using content::UserMetricsAction;
+
namespace {
// Helper class that performs delayed first-run tasks that need more of the
diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc
index 7d713fb..274cc56 100644
--- a/chrome/browser/password_manager/password_manager.cc
+++ b/chrome/browser/password_manager/password_manager.cc
@@ -15,10 +15,11 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/autofill_messages.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/frame_navigate_params.h"
#include "grit/generated_resources.h"
+using content::UserMetricsAction;
using webkit_glue::PasswordForm;
using webkit_glue::PasswordFormMap;
@@ -49,9 +50,9 @@ static void ReportMetrics(bool password_manager_enabled) {
ran_once = true;
if (password_manager_enabled)
- UserMetrics::RecordAction(UserMetricsAction("PasswordManager_Enabled"));
+ content::RecordAction(UserMetricsAction("PasswordManager_Enabled"));
else
- UserMetrics::RecordAction(UserMetricsAction("PasswordManager_Disabled"));
+ content::RecordAction(UserMetricsAction("PasswordManager_Disabled"));
}
PasswordManager::PasswordManager(TabContents* tab_contents,
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index b01c083..6547add 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);
}
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 57bcfec..2f1610a 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -105,10 +105,10 @@
#include "content/browser/in_process_webkit/webkit_context.h"
#include "content/browser/speech/speech_input_manager.h"
#include "content/browser/ssl/ssl_host_state.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/locale_settings.h"
#include "net/base/transport_security_state.h"
#include "net/http/http_server_properties.h"
@@ -144,6 +144,7 @@
using base::Time;
using base::TimeDelta;
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
@@ -346,10 +347,10 @@ void ProfileImpl::DoFinalInit() {
clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit);
if (clear_local_state_on_exit_) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ClearSiteDataOnExitEnabled"));
} else {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ClearSiteDataOnExitDisabled"));
}
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 004f323..ed81da4 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -32,9 +32,9 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "net/http/http_transaction_factory.h"
#include "net/url_request/url_request_context.h"
@@ -48,6 +48,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
@@ -409,7 +410,7 @@ void ProfileManager::NewWindowWithProfile(
if (browser) {
browser->window()->Activate();
} else {
- UserMetrics::RecordAction(UserMetricsAction("NewWindow"));
+ content::RecordAction(UserMetricsAction("NewWindow"));
CommandLine command_line(CommandLine::NO_PROGRAM);
int return_code;
BrowserInit browser_init;
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 33eedbc..976c414 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -30,8 +30,8 @@
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -40,6 +40,7 @@
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
+using content::UserMetricsAction;
// For malware interstitial pages, we link the problematic URL to Google's
// diagnostic page.
@@ -626,7 +627,7 @@ void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) {
NOTREACHED() << "Unexpected event: " << event;
}
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) {
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index d4cae88..fc6e1fc 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -18,10 +18,13 @@
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/common/guid.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/favicon_size.h"
+
+using content::UserMetricsAction;
+
// TODO(pastarmovj): Remove google_update_settings and user_metrics when the
// CollectRLZMetrics function is not needed anymore.
@@ -577,9 +580,9 @@ void TemplateURLRef::CollectRLZMetrics() const {
!google_util::IsOrganic(brand)) {
// Now we know we should have had RLZ token check if there was one.
if (url().find("rlz=") != std::string::npos)
- UserMetrics::RecordAction(UserMetricsAction("SearchWithRLZ"));
+ content::RecordAction(UserMetricsAction("SearchWithRLZ"));
else
- UserMetrics::RecordAction(UserMetricsAction("SearchWithoutRLZ"));
+ content::RecordAction(UserMetricsAction("SearchWithoutRLZ"));
}
return;
}
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 63079f8..6532425 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -67,8 +67,8 @@
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_restriction.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
@@ -84,6 +84,7 @@
#include "chrome/browser/extensions/file_manager_util.h"
#endif
+using content::UserMetricsAction;
using WebKit::WebContextMenuData;
using WebKit::WebMediaPlayerAction;
using WebKit::WebURL;
@@ -1392,7 +1393,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
if (handlers.empty()) {
return;
}
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.ContextMenu_Open"));
int handlerIndex = id - IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST;
WindowOpenDisposition disposition =
@@ -1476,9 +1477,9 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
case IDC_CONTENT_CONTEXT_PLAYPAUSE: {
bool play = !!(params_.media_flags & WebContextMenuData::MediaPaused);
if (play) {
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Play"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Play"));
} else {
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Pause"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Pause"));
}
MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
WebMediaPlayerAction(
@@ -1489,9 +1490,9 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
case IDC_CONTENT_CONTEXT_MUTE: {
bool mute = !(params_.media_flags & WebContextMenuData::MediaMuted);
if (mute) {
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Mute"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Mute"));
} else {
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Unmute"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Unmute"));
}
MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
WebMediaPlayerAction(
@@ -1500,7 +1501,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
}
case IDC_CONTENT_CONTEXT_LOOP:
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Loop"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Loop"));
MediaPlayerActionAt(gfx::Point(params_.x, params_.y),
WebMediaPlayerAction(
WebMediaPlayerAction::Loop,
@@ -1508,7 +1509,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
break;
case IDC_CONTENT_CONTEXT_CONTROLS:
- UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Controls"));
+ content::RecordAction(UserMetricsAction("MediaContextMenu_Controls"));
MediaPlayerActionAt(
gfx::Point(params_.x, params_.y),
WebMediaPlayerAction(
@@ -1695,7 +1696,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
break;
#endif // OS_MACOSX
case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings"));
WindowOpenDisposition disposition =
ForceNewTabDispositionFromEventFlags(event_flags);
@@ -1847,7 +1848,7 @@ void RenderViewContextMenu::CopyImageAt(int x, int y) {
}
void RenderViewContextMenu::Inspect(int x, int y) {
- UserMetrics::RecordAction(UserMetricsAction("DevTools_InspectElement"));
+ content::RecordAction(UserMetricsAction("DevTools_InspectElement"));
DevToolsWindow::InspectElement(
source_tab_contents_->render_view_host(), x, y);
}
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 4048e0a..96b7c7b 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -29,9 +29,11 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
namespace {
@@ -833,12 +835,12 @@ void TabStripModel::ExecuteContextMenuCommand(
DCHECK(command_id > CommandFirst && command_id < CommandLast);
switch (command_id) {
case CommandNewTab:
- UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
+ content::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
delegate()->AddBlankTabAt(context_index + 1, true);
break;
case CommandReload: {
- UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Reload"));
+ content::RecordAction(UserMetricsAction("TabContextMenu_Reload"));
std::vector<int> indices = GetIndicesForCommand(context_index);
for (size_t i = 0; i < indices.size(); ++i) {
TabContentsWrapper* tab = GetTabContentsAt(indices[i]);
@@ -851,7 +853,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandDuplicate: {
- UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"));
+ content::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"));
std::vector<int> indices = GetIndicesForCommand(context_index);
// Copy the TabContents off as the indices will change as tabs are
// duplicated.
@@ -867,7 +869,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandCloseTab: {
- UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_CloseTab"));
+ content::RecordAction(UserMetricsAction("TabContextMenu_CloseTab"));
std::vector<int> indices = GetIndicesForCommand(context_index);
// Copy the TabContents off as the indices will change as we remove
// things.
@@ -885,7 +887,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandCloseOtherTabs: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("TabContextMenu_CloseOtherTabs"));
InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id),
CLOSE_CREATE_HISTORICAL_TAB);
@@ -893,7 +895,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandCloseTabsToRight: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("TabContextMenu_CloseTabsToRight"));
InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id),
CLOSE_CREATE_HISTORICAL_TAB);
@@ -901,13 +903,13 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandRestoreTab: {
- UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab"));
+ content::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab"));
delegate_->RestoreTab();
break;
}
case CommandTogglePinned: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("TabContextMenu_TogglePinned"));
std::vector<int> indices = GetIndicesForCommand(context_index);
bool pin = WillContextMenuPin(context_index);
@@ -928,7 +930,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandBookmarkAllTabs: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("TabContextMenu_BookmarkAllTabs"));
delegate_->BookmarkAllTabs();
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index c4a62916..e5eb407 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -14,8 +14,8 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "grit/ui_resources.h"
@@ -26,6 +26,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
// Strings used in alignment properties.
const char* ThemeService::kAlignmentTop = "top";
@@ -327,7 +328,7 @@ void ThemeService::SetTheme(const Extension* extension) {
SaveThemeID(extension->id());
NotifyThemeChanged();
- UserMetrics::RecordAction(UserMetricsAction("Themes_Installed"));
+ content::RecordAction(UserMetricsAction("Themes_Installed"));
}
void ThemeService::RemoveUnusedThemes() {
@@ -352,7 +353,7 @@ void ThemeService::RemoveUnusedThemes() {
void ThemeService::UseDefaultTheme() {
ClearAllThemeData();
NotifyThemeChanged();
- UserMetrics::RecordAction(UserMetricsAction("Themes_Reset"));
+ content::RecordAction(UserMetricsAction("Themes_Reset"));
}
void ThemeService::SetNativeTheme() {
@@ -585,7 +586,7 @@ void ThemeService::LoadThemePrefs() {
}
if (loaded_pack) {
- UserMetrics::RecordAction(UserMetricsAction("Themes.Loaded"));
+ content::RecordAction(UserMetricsAction("Themes.Loaded"));
} else {
// TODO(erg): We need to pop up a dialog informing the user that their
// theme is being migrated.
@@ -596,11 +597,11 @@ void ThemeService::LoadThemePrefs() {
if (extension) {
DLOG(ERROR) << "Migrating theme";
BuildFromExtension(extension);
- UserMetrics::RecordAction(UserMetricsAction("Themes.Migrated"));
+ content::RecordAction(UserMetricsAction("Themes.Migrated"));
} else {
DLOG(ERROR) << "Theme is mysteriously gone.";
ClearAllThemeData();
- UserMetrics::RecordAction(UserMetricsAction("Themes.Gone"));
+ content::RecordAction(UserMetricsAction("Themes.Gone"));
}
}
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0a6f78a..9a049a1 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -151,11 +151,11 @@
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/devtools_manager.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_details.h"
#include "content/public/browser/intents_host.h"
+#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_restriction.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/page_zoom.h"
@@ -206,6 +206,7 @@
#endif
using base::TimeDelta;
+using content::UserMetricsAction;
///////////////////////////////////////////////////////////////////////////////
@@ -1495,7 +1496,7 @@ bool Browser::CanGoBack() const {
}
void Browser::GoBack(WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(UserMetricsAction("Back"));
+ content::RecordAction(UserMetricsAction("Back"));
TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper();
if (CanGoBack()) {
@@ -1515,18 +1516,18 @@ bool Browser::CanGoForward() const {
}
void Browser::GoForward(WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(UserMetricsAction("Forward"));
+ content::RecordAction(UserMetricsAction("Forward"));
if (CanGoForward())
GetOrCloneTabForDisposition(disposition)->controller().GoForward();
}
void Browser::Reload(WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(UserMetricsAction("Reload"));
+ content::RecordAction(UserMetricsAction("Reload"));
ReloadInternal(disposition, false);
}
void Browser::ReloadIgnoringCache(WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(UserMetricsAction("ReloadIgnoringCache"));
+ content::RecordAction(UserMetricsAction("ReloadIgnoringCache"));
ReloadInternal(disposition, true);
}
@@ -1552,7 +1553,7 @@ void Browser::ReloadInternal(WindowOpenDisposition disposition,
}
void Browser::Home(WindowOpenDisposition disposition) {
- UserMetrics::RecordAction(UserMetricsAction("Home"));
+ content::RecordAction(UserMetricsAction("Home"));
OpenURL(
profile_->GetHomePage(), GURL(), disposition,
content::PageTransitionFromInt(
@@ -1561,7 +1562,7 @@ void Browser::Home(WindowOpenDisposition disposition) {
}
void Browser::OpenCurrentURL() {
- UserMetrics::RecordAction(UserMetricsAction("LoadURL"));
+ content::RecordAction(UserMetricsAction("LoadURL"));
LocationBar* location_bar = window_->GetLocationBar();
if (!location_bar)
return;
@@ -1602,7 +1603,7 @@ void Browser::OpenCurrentURL() {
}
void Browser::Stop() {
- UserMetrics::RecordAction(UserMetricsAction("Stop"));
+ content::RecordAction(UserMetricsAction("Stop"));
GetSelectedTabContentsWrapper()->tab_contents()->Stop();
}
@@ -1616,7 +1617,7 @@ void Browser::NewWindow() {
NewIncognitoWindow();
return;
}
- UserMetrics::RecordAction(UserMetricsAction("NewWindow"));
+ content::RecordAction(UserMetricsAction("NewWindow"));
SessionService* session_service =
SessionServiceFactory::GetForProfile(profile_->GetOriginalProfile());
if (!session_service ||
@@ -1632,17 +1633,17 @@ void Browser::NewIncognitoWindow() {
return;
}
- UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow"));
+ content::RecordAction(UserMetricsAction("NewIncognitoWindow"));
Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile());
}
void Browser::CloseWindow() {
- UserMetrics::RecordAction(UserMetricsAction("CloseWindow"));
+ content::RecordAction(UserMetricsAction("CloseWindow"));
window_->Close();
}
void Browser::NewTab() {
- UserMetrics::RecordAction(UserMetricsAction("NewTab"));
+ content::RecordAction(UserMetricsAction("NewTab"));
if (is_type_tabbed()) {
AddBlankTab(true);
@@ -1659,18 +1660,18 @@ void Browser::NewTab() {
}
void Browser::CloseTab() {
- UserMetrics::RecordAction(UserMetricsAction("CloseTab_Accelerator"));
+ content::RecordAction(UserMetricsAction("CloseTab_Accelerator"));
if (CanCloseTab())
tab_handler_->GetTabStripModel()->CloseSelectedTabs();
}
void Browser::SelectNextTab() {
- UserMetrics::RecordAction(UserMetricsAction("SelectNextTab"));
+ content::RecordAction(UserMetricsAction("SelectNextTab"));
tab_handler_->GetTabStripModel()->SelectNextTab();
}
void Browser::SelectPreviousTab() {
- UserMetrics::RecordAction(UserMetricsAction("SelectPrevTab"));
+ content::RecordAction(UserMetricsAction("SelectPrevTab"));
tab_handler_->GetTabStripModel()->SelectPreviousTab();
}
@@ -1681,7 +1682,7 @@ void Browser::OpenTabpose() {
return;
}
- UserMetrics::RecordAction(UserMetricsAction("OpenTabpose"));
+ content::RecordAction(UserMetricsAction("OpenTabpose"));
window()->OpenTabpose();
#else
NOTREACHED();
@@ -1689,34 +1690,34 @@ void Browser::OpenTabpose() {
}
void Browser::MoveTabNext() {
- UserMetrics::RecordAction(UserMetricsAction("MoveTabNext"));
+ content::RecordAction(UserMetricsAction("MoveTabNext"));
tab_handler_->GetTabStripModel()->MoveTabNext();
}
void Browser::MoveTabPrevious() {
- UserMetrics::RecordAction(UserMetricsAction("MoveTabPrevious"));
+ content::RecordAction(UserMetricsAction("MoveTabPrevious"));
tab_handler_->GetTabStripModel()->MoveTabPrevious();
}
void Browser::SelectNumberedTab(int index) {
if (index < tab_count()) {
- UserMetrics::RecordAction(UserMetricsAction("SelectNumberedTab"));
+ content::RecordAction(UserMetricsAction("SelectNumberedTab"));
tab_handler_->GetTabStripModel()->ActivateTabAt(index, true);
}
}
void Browser::SelectLastTab() {
- UserMetrics::RecordAction(UserMetricsAction("SelectLastTab"));
+ content::RecordAction(UserMetricsAction("SelectLastTab"));
tab_handler_->GetTabStripModel()->SelectLastTab();
}
void Browser::DuplicateTab() {
- UserMetrics::RecordAction(UserMetricsAction("Duplicate"));
+ content::RecordAction(UserMetricsAction("Duplicate"));
DuplicateContentsAt(active_index());
}
void Browser::RestoreTab() {
- UserMetrics::RecordAction(UserMetricsAction("RestoreTab"));
+ content::RecordAction(UserMetricsAction("RestoreTab"));
TabRestoreService* service =
TabRestoreServiceFactory::GetForProfile(profile_);
if (!service)
@@ -1741,7 +1742,7 @@ void Browser::WriteCurrentURLToClipboard() {
}
void Browser::ConvertPopupToTabbedBrowser() {
- UserMetrics::RecordAction(UserMetricsAction("ShowAsTab"));
+ content::RecordAction(UserMetricsAction("ShowAsTab"));
int tab_strip_index = tab_handler_->GetTabStripModel()->active_index();
TabContentsWrapper* contents =
tab_handler_->GetTabStripModel()->DetachTabContentsAt(tab_strip_index);
@@ -1791,12 +1792,12 @@ void Browser::ShowKeyboardOverlay() {
#endif
void Browser::Exit() {
- UserMetrics::RecordAction(UserMetricsAction("Exit"));
+ content::RecordAction(UserMetricsAction("Exit"));
BrowserList::AttemptUserExit();
}
void Browser::BookmarkCurrentPage() {
- UserMetrics::RecordAction(UserMetricsAction("Star"));
+ content::RecordAction(UserMetricsAction("Star"));
BookmarkModel* model = profile()->GetBookmarkModel();
if (!model || !model->IsLoaded())
@@ -1823,10 +1824,10 @@ void Browser::BookmarkCurrentPage() {
}
void Browser::SavePage() {
- UserMetrics::RecordAction(UserMetricsAction("SavePage"));
+ content::RecordAction(UserMetricsAction("SavePage"));
TabContents* current_tab = GetSelectedTabContents();
if (current_tab && current_tab->contents_mime_type() == "application/pdf")
- UserMetrics::RecordAction(UserMetricsAction("PDF.SavePage"));
+ content::RecordAction(UserMetricsAction("PDF.SavePage"));
GetSelectedTabContents()->OnSavePage();
}
@@ -1847,7 +1848,7 @@ bool Browser::CanSupportWindowFeature(WindowFeature feature) const {
}
void Browser::EmailPageLocation() {
- UserMetrics::RecordAction(UserMetricsAction("EmailPageLocation"));
+ content::RecordAction(UserMetricsAction("EmailPageLocation"));
TabContents* tc = GetSelectedTabContents();
DCHECK(tc);
@@ -1871,7 +1872,7 @@ void Browser::AdvancedPrint() {
}
void Browser::ToggleEncodingAutoDetect() {
- UserMetrics::RecordAction(UserMetricsAction("AutoDetectChange"));
+ content::RecordAction(UserMetricsAction("AutoDetectChange"));
encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue());
// If "auto detect" is turned on, then any current override encoding
// is cleared. This also implicitly performs a reload.
@@ -1885,7 +1886,7 @@ void Browser::ToggleEncodingAutoDetect() {
}
void Browser::OverrideEncoding(int encoding_id) {
- UserMetrics::RecordAction(UserMetricsAction("OverrideEncoding"));
+ content::RecordAction(UserMetricsAction("OverrideEncoding"));
const std::string selected_encoding =
CharacterEncoding::GetCanonicalEncodingNameByCommandId(encoding_id);
TabContents* contents = GetSelectedTabContents();
@@ -1903,32 +1904,32 @@ void Browser::OverrideEncoding(int encoding_id) {
}
void Browser::Cut() {
- UserMetrics::RecordAction(UserMetricsAction("Cut"));
+ content::RecordAction(UserMetricsAction("Cut"));
window()->Cut();
}
void Browser::Copy() {
- UserMetrics::RecordAction(UserMetricsAction("Copy"));
+ content::RecordAction(UserMetricsAction("Copy"));
window()->Copy();
}
void Browser::Paste() {
- UserMetrics::RecordAction(UserMetricsAction("Paste"));
+ content::RecordAction(UserMetricsAction("Paste"));
window()->Paste();
}
void Browser::Find() {
- UserMetrics::RecordAction(UserMetricsAction("Find"));
+ content::RecordAction(UserMetricsAction("Find"));
FindInPage(false, false);
}
void Browser::FindNext() {
- UserMetrics::RecordAction(UserMetricsAction("FindNext"));
+ content::RecordAction(UserMetricsAction("FindNext"));
FindInPage(true, true);
}
void Browser::FindPrevious() {
- UserMetrics::RecordAction(UserMetricsAction("FindPrevious"));
+ content::RecordAction(UserMetricsAction("FindPrevious"));
FindInPage(true, false);
}
@@ -1940,7 +1941,7 @@ void Browser::Zoom(content::PageZoom zoom) {
GetSelectedTabContentsWrapper()->tab_contents()->render_view_host();
if (zoom == content::PAGE_ZOOM_RESET) {
host->SetZoomLevel(0);
- UserMetrics::RecordAction(UserMetricsAction("ZoomNormal"));
+ content::RecordAction(UserMetricsAction("ZoomNormal"));
return;
}
@@ -1963,10 +1964,10 @@ void Browser::Zoom(content::PageZoom zoom) {
continue;
if (zoom_level < current_zoom_level) {
host->SetZoomLevel(zoom_level);
- UserMetrics::RecordAction(UserMetricsAction("ZoomMinus"));
+ content::RecordAction(UserMetricsAction("ZoomMinus"));
return;
}
- UserMetrics::RecordAction(UserMetricsAction("ZoomMinus_AtMinimum"));
+ content::RecordAction(UserMetricsAction("ZoomMinus_AtMinimum"));
}
} else {
// Iterate through the zoom levels in normal order to find the next
@@ -1978,57 +1979,57 @@ void Browser::Zoom(content::PageZoom zoom) {
continue;
if (zoom_level > current_zoom_level) {
host->SetZoomLevel(zoom_level);
- UserMetrics::RecordAction(UserMetricsAction("ZoomPlus"));
+ content::RecordAction(UserMetricsAction("ZoomPlus"));
return;
}
}
- UserMetrics::RecordAction(UserMetricsAction("ZoomPlus_AtMaximum"));
+ content::RecordAction(UserMetricsAction("ZoomPlus_AtMaximum"));
}
}
void Browser::FocusToolbar() {
- UserMetrics::RecordAction(UserMetricsAction("FocusToolbar"));
+ content::RecordAction(UserMetricsAction("FocusToolbar"));
window_->FocusToolbar();
}
void Browser::FocusAppMenu() {
- UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu"));
+ content::RecordAction(UserMetricsAction("FocusAppMenu"));
window_->FocusAppMenu();
}
void Browser::FocusLocationBar() {
- UserMetrics::RecordAction(UserMetricsAction("FocusLocation"));
+ content::RecordAction(UserMetricsAction("FocusLocation"));
window_->SetFocusToLocationBar(true);
}
void Browser::FocusBookmarksToolbar() {
- UserMetrics::RecordAction(UserMetricsAction("FocusBookmarksToolbar"));
+ content::RecordAction(UserMetricsAction("FocusBookmarksToolbar"));
window_->FocusBookmarksToolbar();
}
void Browser::FocusChromeOSStatus() {
- UserMetrics::RecordAction(UserMetricsAction("FocusChromeOSStatus"));
+ content::RecordAction(UserMetricsAction("FocusChromeOSStatus"));
window_->FocusChromeOSStatus();
}
void Browser::FocusNextPane() {
- UserMetrics::RecordAction(UserMetricsAction("FocusNextPane"));
+ content::RecordAction(UserMetricsAction("FocusNextPane"));
window_->RotatePaneFocus(true);
}
void Browser::FocusPreviousPane() {
- UserMetrics::RecordAction(UserMetricsAction("FocusPreviousPane"));
+ content::RecordAction(UserMetricsAction("FocusPreviousPane"));
window_->RotatePaneFocus(false);
}
void Browser::FocusSearch() {
// TODO(beng): replace this with FocusLocationBar
- UserMetrics::RecordAction(UserMetricsAction("FocusSearch"));
+ content::RecordAction(UserMetricsAction("FocusSearch"));
window_->GetLocationBar()->FocusSearch();
}
void Browser::OpenFile() {
- UserMetrics::RecordAction(UserMetricsAction("OpenFile"));
+ content::RecordAction(UserMetricsAction("OpenFile"));
if (!select_file_dialog_.get())
select_file_dialog_ = SelectFileDialog::Create(this);
@@ -2044,7 +2045,7 @@ void Browser::OpenFile() {
}
void Browser::OpenCreateShortcutsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("CreateShortcut"));
+ content::RecordAction(UserMetricsAction("CreateShortcut"));
#if !defined(OS_MACOSX)
TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper();
DCHECK(current_tab &&
@@ -2070,9 +2071,9 @@ void Browser::OpenCreateShortcutsDialog() {
void Browser::ToggleDevToolsWindow(DevToolsToggleAction action) {
if (action == DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE)
- UserMetrics::RecordAction(UserMetricsAction("DevTools_ToggleConsole"));
+ content::RecordAction(UserMetricsAction("DevTools_ToggleConsole"));
else
- UserMetrics::RecordAction(UserMetricsAction("DevTools_ToggleWindow"));
+ content::RecordAction(UserMetricsAction("DevTools_ToggleWindow"));
DevToolsWindow::ToggleDevToolsWindow(
GetSelectedTabContentsWrapper()->tab_contents()->render_view_host(),
@@ -2080,7 +2081,7 @@ void Browser::ToggleDevToolsWindow(DevToolsToggleAction action) {
}
void Browser::OpenTaskManager(bool highlight_background_resources) {
- UserMetrics::RecordAction(UserMetricsAction("TaskManager"));
+ content::RecordAction(UserMetricsAction("TaskManager"));
if (highlight_background_resources)
window_->ShowBackgroundPages();
else
@@ -2088,26 +2089,26 @@ void Browser::OpenTaskManager(bool highlight_background_resources) {
}
void Browser::OpenBugReportDialog() {
- UserMetrics::RecordAction(UserMetricsAction("ReportBug"));
+ content::RecordAction(UserMetricsAction("ReportBug"));
browser::ShowHtmlBugReportView(this, std::string(), 0);
}
void Browser::ToggleBookmarkBar() {
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarksBar"));
+ content::RecordAction(UserMetricsAction("ShowBookmarksBar"));
window_->ToggleBookmarkBar();
}
void Browser::OpenBookmarkManager() {
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"));
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks"));
+ content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
+ content::RecordAction(UserMetricsAction("ShowBookmarks"));
ShowSingletonTabOverwritingNTP(
GetSingletonTabNavigateParams(GURL(chrome::kChromeUIBookmarksURL)));
}
void Browser::OpenBookmarkManagerWithHash(const std::string& action,
int64 node_id) {
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"));
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks"));
+ content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
+ content::RecordAction(UserMetricsAction("ShowBookmarks"));
browser::NavigateParams params(GetSingletonTabNavigateParams(
GURL(chrome::kChromeUIBookmarksURL).Resolve(
StringPrintf("/#%s%s", action.c_str(),
@@ -2134,13 +2135,13 @@ void Browser::ShowAvatarMenu() {
}
void Browser::ShowHistoryTab() {
- UserMetrics::RecordAction(UserMetricsAction("ShowHistory"));
+ content::RecordAction(UserMetricsAction("ShowHistory"));
ShowSingletonTabOverwritingNTP(
GetSingletonTabNavigateParams(GURL(chrome::kChromeUIHistoryURL)));
}
void Browser::ShowDownloadsTab() {
- UserMetrics::RecordAction(UserMetricsAction("ShowDownloads"));
+ content::RecordAction(UserMetricsAction("ShowDownloads"));
#if !defined(OS_CHROMEOS)
// ChromiumOS uses ActiveDownloadsUI instead of of DownloadShelf.
if (window()) {
@@ -2154,17 +2155,17 @@ void Browser::ShowDownloadsTab() {
}
void Browser::ShowExtensionsTab() {
- UserMetrics::RecordAction(UserMetricsAction("ShowExtensions"));
+ content::RecordAction(UserMetricsAction("ShowExtensions"));
ShowOptionsTab(chrome::kExtensionsSubPage);
}
void Browser::ShowAboutConflictsTab() {
- UserMetrics::RecordAction(UserMetricsAction("AboutConflicts"));
+ content::RecordAction(UserMetricsAction("AboutConflicts"));
ShowSingletonTab(GURL(chrome::kChromeUIConflictsURL));
}
void Browser::ShowBrokenPageTab(TabContents* contents) {
- UserMetrics::RecordAction(UserMetricsAction("ReportBug"));
+ content::RecordAction(UserMetricsAction("ReportBug"));
string16 page_title = contents->GetTitle();
NavigationEntry* entry = contents->controller().GetActiveEntry();
if (!entry)
@@ -2187,22 +2188,22 @@ void Browser::ShowOptionsTab(const std::string& sub_page) {
}
void Browser::OpenClearBrowsingDataDialog() {
- UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg"));
+ content::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg"));
ShowOptionsTab(chrome::kClearBrowserDataSubPage);
}
void Browser::OpenOptionsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("ShowOptions"));
+ content::RecordAction(UserMetricsAction("ShowOptions"));
ShowOptionsTab("");
}
void Browser::OpenPasswordManager() {
- UserMetrics::RecordAction(UserMetricsAction("Options_ShowPasswordManager"));
+ content::RecordAction(UserMetricsAction("Options_ShowPasswordManager"));
ShowOptionsTab(chrome::kPasswordManagerSubPage);
}
void Browser::OpenImportSettingsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("Import_ShowDlg"));
+ content::RecordAction(UserMetricsAction("Import_ShowDlg"));
ShowOptionsTab(chrome::kImportDataSubPage);
}
@@ -2216,7 +2217,7 @@ void Browser::OpenSyncMyBookmarksDialog() {
}
void Browser::OpenAboutChromeDialog() {
- UserMetrics::RecordAction(UserMetricsAction("AboutChrome"));
+ content::RecordAction(UserMetricsAction("AboutChrome"));
#if defined(OS_CHROMEOS)
std::string chrome_settings(chrome::kChromeUISettingsURL);
ShowSingletonTab(GURL(chrome_settings.append(chrome::kAboutOptionsSubPage)));
@@ -2226,12 +2227,12 @@ void Browser::OpenAboutChromeDialog() {
}
void Browser::OpenUpdateChromeDialog() {
- UserMetrics::RecordAction(UserMetricsAction("UpdateChrome"));
+ content::RecordAction(UserMetricsAction("UpdateChrome"));
window_->ShowUpdateChromeDialog();
}
void Browser::ShowHelpTab() {
- UserMetrics::RecordAction(UserMetricsAction("ShowHelpTab"));
+ content::RecordAction(UserMetricsAction("ShowHelpTab"));
GURL help_url(kHelpContentUrl);
GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url);
ShowSingletonTab(localized_help_url);
@@ -2249,42 +2250,42 @@ void Browser::OpenAutofillHelpTabAndActivate() {
}
void Browser::OpenSearchEngineOptionsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("EditSearchEngines"));
+ content::RecordAction(UserMetricsAction("EditSearchEngines"));
ShowOptionsTab(chrome::kSearchEnginesSubPage);
}
#if defined(FILE_MANAGER_EXTENSION)
void Browser::OpenFileManager() {
- UserMetrics::RecordAction(UserMetricsAction("OpenFileManager"));
+ content::RecordAction(UserMetricsAction("OpenFileManager"));
ShowSingletonTabRespectRef(GURL(chrome::kChromeUIFileManagerURL));
}
#endif
#if defined(OS_CHROMEOS)
void Browser::LockScreen() {
- UserMetrics::RecordAction(UserMetricsAction("LockScreen"));
+ content::RecordAction(UserMetricsAction("LockScreen"));
chromeos::CrosLibrary::Get()->GetScreenLockLibrary()->
NotifyScreenLockRequested();
}
void Browser::Shutdown() {
- UserMetrics::RecordAction(UserMetricsAction("Shutdown"));
+ content::RecordAction(UserMetricsAction("Shutdown"));
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
RequestShutdown();
}
void Browser::OpenSystemOptionsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("OpenSystemOptionsDialog"));
+ content::RecordAction(UserMetricsAction("OpenSystemOptionsDialog"));
ShowOptionsTab(chrome::kSystemOptionsSubPage);
}
void Browser::OpenInternetOptionsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("OpenInternetOptionsDialog"));
+ content::RecordAction(UserMetricsAction("OpenInternetOptionsDialog"));
ShowOptionsTab(chrome::kInternetOptionsSubPage);
}
void Browser::OpenLanguageOptionsDialog() {
- UserMetrics::RecordAction(UserMetricsAction("OpenLanguageOptionsDialog"));
+ content::RecordAction(UserMetricsAction("OpenLanguageOptionsDialog"));
ShowOptionsTab(chrome::kLanguageOptionsSubPage);
}
@@ -2588,7 +2589,7 @@ void Browser::RegisterProtocolHandlerHelper(TabContents* tab,
tcw->profile()->GetProtocolHandlerRegistry();
if (!registry->SilentlyHandleRegisterHandlerRequest(handler)) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown"));
InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper();
infobar_helper->AddInfoBar(
@@ -5200,7 +5201,7 @@ void Browser::ViewSource(TabContentsWrapper* contents) {
void Browser::ViewSource(TabContentsWrapper* contents,
const GURL& url,
const std::string& content_state) {
- UserMetrics::RecordAction(UserMetricsAction("ViewSource"));
+ content::RecordAction(UserMetricsAction("ViewSource"));
DCHECK(contents);
TabContentsWrapper* view_source_contents = contents->Clone();
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index de93d0d..569839f 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -43,7 +43,7 @@
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -53,6 +53,8 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/mac/nsimage_cache.h"
+using content::UserMetricsAction;
+
// Bookmark bar state changing and animations
//
// The bookmark bar has three real states: "showing" (a normal bar attached to
@@ -750,7 +752,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
const BookmarkNode* node = [self nodeFromMenuItem:sender];
if (node) {
[self openAll:node disposition:NEW_FOREGROUND_TAB];
- UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarks"));
+ content::RecordAction(UserMetricsAction("OpenAllBookmarks"));
}
}
@@ -758,7 +760,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
const BookmarkNode* node = [self nodeFromMenuItem:sender];
if (node) {
[self openAll:node disposition:NEW_WINDOW];
- UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarksNewWindow"));
+ content::RecordAction(UserMetricsAction("OpenAllBookmarksNewWindow"));
}
}
@@ -766,7 +768,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
const BookmarkNode* node = [self nodeFromMenuItem:sender];
if (node) {
[self openAll:node disposition:OFF_THE_RECORD];
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OpenAllBookmarksIncognitoWindow"));
}
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm
index 5d487dc..3d3b133 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm
@@ -9,7 +9,9 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
#import "third_party/mozilla/NSPasteboard+Utils.h"
@@ -203,7 +205,7 @@
doDrag = [[self controller] dragButton:button
to:[info draggingLocation]
copy:copy];
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd"));
+ content::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd"));
}
return doDrag;
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
index e0e6614..0f519cb 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
@@ -6,16 +6,18 @@
#include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
#include "chrome/browser/profiles/profile.h"
+#import "chrome/browser/themes/theme_service.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
-#import "chrome/browser/themes/theme_service.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#import "third_party/mozilla/NSPasteboard+Utils.h"
+using content::UserMetricsAction;
+
@interface BookmarkBarView (Private)
- (void)themeDidChangeNotification:(NSNotification*)aNotification;
- (void)updateTheme:(ui::ThemeProvider*)themeProvider;
@@ -242,7 +244,7 @@
rtn = [controller_ dragButton:button
to:[info draggingLocation]
copy:copy];
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragEnd"));
+ content::RecordAction(UserMetricsAction("BookmarkBar_DragEnd"));
}
return rtn;
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
index 10397ca..7ad1399 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
@@ -12,13 +12,15 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/info_bubble_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
+using content::UserMetricsAction;
+
// Simple class to watch for tab creation/destruction and close the bubble.
// Bridge between Chrome-style notifications and ObjC-style notifications.
@@ -264,7 +266,7 @@ void BookmarkBubbleNotificationBridge::Observe(
}
- (IBAction)edit:(id)sender {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
[self showEditor];
}
@@ -289,7 +291,7 @@ void BookmarkBubbleNotificationBridge::Observe(
- (IBAction)remove:(id)sender {
[self stopPulsingBookmarkButton];
bookmark_utils::RemoveAllBookmarks(model_, node_->url());
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
node_ = NULL; // no longer valid
[self ok:sender];
}
@@ -306,7 +308,7 @@ void BookmarkBubbleNotificationBridge::Observe(
NSMenuItem* selected = [folderPopUpButton_ selectedItem];
ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject];
if ([[selected representedObject] isEqual:chooseItem]) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_EditFromCombobox"));
[self showEditor];
}
@@ -335,7 +337,7 @@ void BookmarkBubbleNotificationBridge::Observe(
NSString* newTitle = [nameTextField_ stringValue];
if (![oldTitle isEqual:newTitle]) {
model_->SetTitle(node_, base::SysNSStringToUTF16(newTitle));
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
}
// Then the parent folder.
@@ -352,7 +354,7 @@ void BookmarkBubbleNotificationBridge::Observe(
if (oldParent != newParent) {
int index = newParent->child_count();
model_->Move(node_, newParent, index);
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_ChangeParent"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_ChangeParent"));
}
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
index 1a51241..fbe66b3 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
@@ -9,11 +9,13 @@
#include "base/logging.h"
#import "base/memory/scoped_nsobject.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
-#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h"
+#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
// The opacity of the bookmark button drag image.
static const CGFloat kDragImageOpacity = 0.7;
@@ -196,9 +198,9 @@ BookmarkButton* gDraggedButton = nil; // Weak
const BookmarkNode* node = [self bookmarkNode];
const BookmarkNode* parent = node ? node->parent() : NULL;
if (parent && parent->type() == BookmarkNode::FOLDER) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBarFolder_DragStart"));
+ content::RecordAction(UserMetricsAction("BookmarkBarFolder_DragStart"));
} else {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragStart"));
+ content::RecordAction(UserMetricsAction("BookmarkBar_DragStart"));
}
dragMouseOffset_ = [self convertPointFromBase:[event locationInWindow]];
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
index 392c7ca..0603733 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -10,11 +10,13 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h"
#import "chrome/browser/ui/cocoa/image_utils.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/gfx/mac/nsimage_cache.h"
+using content::UserMetricsAction;
+
@interface BookmarkButtonCell(Private)
- (void)configureBookmarkButtonCell;
@@ -151,9 +153,9 @@
static_cast<const BookmarkNode*>([[self representedObject] pointerValue]);
if (node->parent() && node->parent()->type() == BookmarkNode::FOLDER) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBarFolder_CtxMenu"));
+ content::RecordAction(UserMetricsAction("BookmarkBarFolder_CtxMenu"));
} else {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_CtxMenu"));
+ content::RecordAction(UserMetricsAction("BookmarkBar_CtxMenu"));
}
[menu setRepresentedObject:[NSNumber numberWithLongLong:node->id()]];
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
index 4dd32d3..375b78e 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
@@ -13,9 +13,11 @@
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
#include "chrome/browser/ui/cocoa/event_utils.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "ui/base/text/text_elider.h"
+using content::UserMetricsAction;
+
namespace {
// Menus more than this many pixels wide will get trimmed
@@ -116,11 +118,11 @@ const NSUInteger kMaximumMenuPixelsWide = 300;
disposition);
if (disposition == NEW_FOREGROUND_TAB) {
- UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarks"));
+ content::RecordAction(UserMetricsAction("OpenAllBookmarks"));
} else if (disposition == NEW_WINDOW) {
- UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarksNewWindow"));
+ content::RecordAction(UserMetricsAction("OpenAllBookmarksNewWindow"));
} else {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("OpenAllBookmarksIncognitoWindow"));
}
}
diff --git a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm
index 707e9d7..451b679f 100644
--- a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm
@@ -9,11 +9,13 @@
#include "base/message_loop.h"
#include "chrome/browser/importer/importer_host.h"
#include "chrome/browser/importer/importer_lock_dialog.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"
+using content::UserMetricsAction;
+
namespace importer {
void ShowImportLockDialog(gfx::NativeWindow parent,
@@ -32,7 +34,7 @@ void ShowImportLockDialog(gfx::NativeWindow parent,
MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(&ImporterHost::OnImportLockDialogEnd,
importer_host, is_continue));
- UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogCocoa_Shown"));
+ content::RecordAction(UserMetricsAction("ImportLockDialogCocoa_Shown"));
}
} // namespace importer
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index d9b9abf1..8f17a7c 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -55,7 +55,7 @@
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -67,6 +67,8 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/mac/nsimage_cache.h"
+using content::UserMetricsAction;
+
NSString* const kTabStripNumberOfTabsChanged = @"kTabStripNumberOfTabsChanged";
namespace {
@@ -695,7 +697,7 @@ private:
if (!tabStripModel_->ContainsIndex(index))
return;
- UserMetrics::RecordAction(UserMetricsAction("CloseTab_Mouse"));
+ content::RecordAction(UserMetricsAction("CloseTab_Mouse"));
const NSInteger numberOfOpenTabs = [self numberOfOpenTabs];
if (numberOfOpenTabs > 1) {
bool isClosingLastTab = index == numberOfOpenTabs - 1;
@@ -1832,7 +1834,7 @@ private:
// Either insert a new tab or open in a current tab.
switch (disposition) {
case NEW_FOREGROUND_TAB: {
- UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"));
+ content::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"));
browser::NavigateParams params(
browser_, *url, content::PAGE_TRANSITION_TYPED);
params.disposition = disposition;
@@ -1843,7 +1845,7 @@ private:
break;
}
case CURRENT_TAB:
- UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab"));
+ content::RecordAction(UserMetricsAction("Tab_DropURLOnTab"));
tabStripModel_->GetTabContentsAt(index)
->tab_contents()->OpenURL(*url, GURL(), CURRENT_TAB,
content::PAGE_TRANSITION_TYPED);
diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm
index 7ff900f..2f4d872 100644
--- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm
@@ -19,17 +19,19 @@
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
#import "chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view.h"
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/accelerators/accelerator_cocoa.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_model.h"
+using content::UserMetricsAction;
+
@interface WrenchMenuController (Private)
- (void)createModel;
- (void)adjustPositioning;
@@ -168,7 +170,7 @@ class ZoomLevelObserver : public content::NotificationObserver {
[self wrenchMenuModel]->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY));
[[[buttonViewController_ zoomItem] viewWithTag:IDC_ZOOM_PERCENT_DISPLAY]
setTitle:title];
- UserMetrics::RecordAction(UserMetricsAction("ShowAppMenu"));
+ content::RecordAction(UserMetricsAction("ShowAppMenu"));
NSImage* icon = [self wrenchMenuModel]->browser()->window()->IsFullscreen() ?
[NSImage imageNamed:NSImageNameExitFullScreenTemplate] :
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index ce99842..8c38964 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -17,19 +17,20 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/common/content_settings.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#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/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
using content_settings::SettingInfo;
using content_settings::SettingSource;
using content_settings::SETTING_SOURCE_USER;
@@ -377,7 +378,7 @@ class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup {
private:
virtual void OnCustomLinkClicked() OVERRIDE {
- UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble"));
+ content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble"));
DCHECK(tab_contents());
RenderViewHost* host = tab_contents()->tab_contents()->render_view_host();
host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->routing_id()));
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index 4db0d80..1b52730 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -15,8 +15,10 @@
#include "chrome/common/chrome_switches.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
FullscreenController::FullscreenController(BrowserWindow* window,
Profile* profile,
@@ -166,7 +168,7 @@ void FullscreenController::ToggleFullscreenMode(bool for_tab) {
tab_fullscreen_accepted_ = entering_fullscreen &&
GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW;
} else {
- UserMetrics::RecordAction(UserMetricsAction("ToggleFullscreen"));
+ content::RecordAction(UserMetricsAction("ToggleFullscreen"));
}
if (entering_fullscreen)
window_->EnterFullscreen(url, GetFullscreenExitBubbleType());
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
index f22769e..b719f2f 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
@@ -36,9 +36,9 @@
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -51,6 +51,8 @@
#include "ui/gfx/image/cairo_cached_surface.h"
#include "ui/gfx/image/image.h"
+using content::UserMetricsAction;
+
namespace {
// The showing height of the bar.
@@ -1135,7 +1137,7 @@ void BookmarkBarGtk::OnClicked(GtkWidget* sender) {
bookmark_utils::OpenAll(window_->GetNativeHandle(), profile, page_navigator_,
node, gtk_util::DispositionForCurrentButtonPressEvent());
- UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
+ content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
}
void BookmarkBarGtk::OnButtonDragBegin(GtkWidget* button,
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc
index 7144953..a2a8744 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc
@@ -23,12 +23,14 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/common/chrome_notification_types.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
namespace {
// We basically have a singleton, since a bubble is sort of app-modal. This
@@ -224,7 +226,7 @@ void BookmarkBubbleGtk::OnNameActivate(GtkWidget* widget) {
void BookmarkBubbleGtk::OnFolderChanged(GtkWidget* widget) {
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_));
if (index == folder_combo_model_->GetItemCount() - 1) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_EditFromCombobox"));
// GTK doesn't handle having the combo box destroyed from the changed
// signal. Since showing the editor also closes the bubble, delay this
@@ -249,7 +251,7 @@ void BookmarkBubbleGtk::OnFolderPopupShown(GtkWidget* widget,
}
void BookmarkBubbleGtk::OnEditClicked(GtkWidget* widget) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
ShowEditor();
}
@@ -258,7 +260,7 @@ void BookmarkBubbleGtk::OnCloseClicked(GtkWidget* widget) {
}
void BookmarkBubbleGtk::OnRemoveClicked(GtkWidget* widget) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
apply_edits_ = false;
remove_bookmark_ = true;
@@ -276,7 +278,7 @@ void BookmarkBubbleGtk::ApplyEdits() {
if (new_title != node->GetTitle()) {
model_->SetTitle(node, new_title);
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
}
@@ -286,7 +288,7 @@ void BookmarkBubbleGtk::ApplyEdits() {
if (index < folder_combo_model_->GetItemCount() - 1) {
const BookmarkNode* new_parent = folder_combo_model_->GetNodeAt(index);
if (new_parent != node->parent()) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_ChangeParent"));
model_->Move(node, new_parent, new_parent->child_count());
}
diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
index 0cd5a1a..11c88f7 100644
--- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc
@@ -43,9 +43,9 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -59,6 +59,8 @@
#include "ui/gfx/image/cairo_cached_surface.h"
#include "ui/gfx/skbitmap_operations.h"
+using content::UserMetricsAction;
+
namespace {
// Padding on left and right of the left toolbar buttons (back, forward, reload,
@@ -291,7 +293,7 @@ void BrowserToolbarGtk::ShowAppMenu() {
RebuildWrenchMenu();
wrench_menu_button_->SetPaintOverride(GTK_STATE_ACTIVE);
- UserMetrics::RecordAction(UserMetricsAction("ShowAppMenu"));
+ content::RecordAction(UserMetricsAction("ShowAppMenu"));
wrench_menu_->PopupAsFromKeyEvent(wrench_menu_button_->widget());
}
diff --git a/chrome/browser/ui/gtk/gtk_theme_service.cc b/chrome/browser/ui/gtk/gtk_theme_service.cc
index 7e3bd61..72a118a 100644
--- a/chrome/browser/ui/gtk/gtk_theme_service.cc
+++ b/chrome/browser/ui/gtk/gtk_theme_service.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/ui/gtk/hover_controller_gtk.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc
index 788ac15..2985ebe 100644
--- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc
@@ -11,18 +11,20 @@
#include "chrome/browser/importer/importer_host.h"
#include "chrome/browser/importer/importer_lock_dialog.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
namespace importer {
void ShowImportLockDialog(gfx::NativeWindow parent,
ImporterHost* importer_host) {
ImportLockDialogGtk::Show(parent, importer_host);
- UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown"));
+ content::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown"));
}
} // namespace importer
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 632e14f..4224b07 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -23,7 +23,7 @@
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.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"
@@ -32,6 +32,7 @@
#include "ui/gfx/image/image.h"
#include "webkit/plugins/npapi/plugin_group.h"
+using content::UserMetricsAction;
using webkit::npapi::PluginGroup;
using webkit::WebPluginInfo;
@@ -74,7 +75,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() {
@@ -113,7 +114,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));
@@ -122,7 +123,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.
@@ -163,7 +164,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:
@@ -198,18 +199,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 {
@@ -264,12 +265,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);
@@ -325,12 +326,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 =
@@ -353,9 +354,9 @@ bool PDFUnsupportedFeatureInfoBarDelegate::OnYes() {
}
void PDFUnsupportedFeatureInfoBarDelegate::OnNo() {
- UserMetrics::RecordAction(reader_installed_ ?
- UserMetricsAction("PDF_UseReaderInfoBarCancel") :
- UserMetricsAction("PDF_InstallReaderInfoBarCancel"));
+ content::RecordAction(reader_installed_ ?
+ UserMetricsAction("PDF_UseReaderInfoBarCancel") :
+ UserMetricsAction("PDF_InstallReaderInfoBarCancel"));
}
void GotPluginGroupsCallback(int process_id,
diff --git a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
index a0c9b52..4716d37 100644
--- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
+++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
@@ -11,9 +11,11 @@
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
+using content::UserMetricsAction;
+
EditSearchEngineController::EditSearchEngineController(
const TemplateURL* template_url,
EditSearchEngineControllerDelegate* edit_keyword_delegate,
@@ -104,7 +106,7 @@ void EditSearchEngineController::AcceptAddOrEdit(
modifiable_url->SetURL(url_string, 0, 0);
// TemplateURLService takes ownership of template_url_.
template_url_service->Add(modifiable_url);
- UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_AddKeywordJS"));
+ content::RecordAction(UserMetricsAction("KeywordEditor_AddKeywordJS"));
} else {
// Adding or modifying an entry via the Delegate.
edit_keyword_delegate_->OnEditedKeyword(template_url_,
diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller.cc b/chrome/browser/ui/search_engines/keyword_editor_controller.cc
index 97752aa..e160655 100644
--- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc
+++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc
@@ -12,7 +12,9 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/search_engines/template_url_table_model.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
KeywordEditorController::KeywordEditorController(Profile* profile)
: profile_(profile) {
@@ -35,7 +37,7 @@ int KeywordEditorController::AddTemplateURL(const string16& title,
const std::string& url) {
DCHECK(!url.empty());
- UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword"));
+ content::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword"));
TemplateURL* template_url = new TemplateURL();
template_url->set_short_name(title);
@@ -75,7 +77,7 @@ void KeywordEditorController::ModifyTemplateURL(const TemplateURL* template_url,
table_model_->ModifyTemplateURL(index, title, keyword, url);
- UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword"));
+ content::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword"));
}
bool KeywordEditorController::CanEdit(const TemplateURL* url) const {
@@ -93,7 +95,7 @@ bool KeywordEditorController::CanRemove(const TemplateURL* url) const {
void KeywordEditorController::RemoveTemplateURL(int index) {
table_model_->Remove(index);
- UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_RemoveKeyword"));
+ content::RecordAction(UserMetricsAction("KeywordEditor_RemoveKeyword"));
}
int KeywordEditorController::MakeDefaultTemplateURL(int index) {
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
index 515c57b..0fdd356 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
@@ -18,7 +18,7 @@
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
@@ -28,6 +28,8 @@
#include "ui/base/text/text_elider.h"
#include "ui/gfx/codec/png_codec.h"
+using content::UserMetricsAction;
+
const int BackForwardMenuModel::kMaxHistoryItems = 12;
const int BackForwardMenuModel::kMaxChapterStops = 5;
static const int kMaxWidth = 700;
@@ -167,7 +169,7 @@ void BackForwardMenuModel::ActivatedAt(int index, int event_flags) {
// Execute the command for the last item: "Show Full History".
if (index == GetItemCount() - 1) {
- UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1));
+ content::RecordComputedAction(BuildActionName("ShowFullHistory", -1));
browser_->ShowSingletonTabOverwritingNTP(
browser_->GetSingletonTabNavigateParams(
GURL(chrome::kChromeUIHistoryURL)));
@@ -176,10 +178,10 @@ void BackForwardMenuModel::ActivatedAt(int index, int event_flags) {
// Log whether it was a history or chapter click.
if (index < GetHistoryItemCount()) {
- UserMetrics::RecordComputedAction(
+ content::RecordComputedAction(
BuildActionName("HistoryClick", index));
} else {
- UserMetrics::RecordComputedAction(
+ content::RecordComputedAction(
BuildActionName("ChapterClick", index - GetHistoryItemCount() - 1));
}
@@ -191,7 +193,7 @@ void BackForwardMenuModel::ActivatedAt(int index, int event_flags) {
}
void BackForwardMenuModel::MenuWillShow() {
- UserMetrics::RecordComputedAction(BuildActionName("Popup", -1));
+ content::RecordComputedAction(BuildActionName("Popup", -1));
requested_favicons_.clear();
load_consumer_.CancelAllRequests();
}
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 1144776..4b70d0e 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -18,8 +18,8 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/sync/sync_global_error.h"
+#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/task_manager/task_manager.h"
#include "chrome/browser/ui/browser.h"
@@ -34,10 +34,10 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/profiling.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -55,6 +55,8 @@
#include "chrome/browser/enumerate_modules_model_win.h"
#endif
+using content::UserMetricsAction;
+
////////////////////////////////////////////////////////////////////////////////
// EncodingMenuModel
@@ -336,7 +338,7 @@ void WrenchMenuModel::ExecuteCommand(int command_id) {
}
if (command_id == IDC_HELP_PAGE)
- UserMetrics::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu"));
+ content::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu"));
browser_->ExecuteCommand(command_id);
}
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index 9adceb8..a21b870 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -26,7 +26,7 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/url_constants.h"
#include "chrome/installer/util/browser_distribution.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -51,6 +51,8 @@
#include "chrome/installer/util/install_util.h"
#endif // defined(OS_WIN)
+using content::UserMetricsAction;
+
// The amount of vertical space separating the error label at the bottom from
// the rest of the text.
static const int kErrorLabelVerticalSpacing = 15; // Pixels.
@@ -663,19 +665,19 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
switch (result) {
case UPGRADE_STARTED:
- UserMetrics::RecordAction(UserMetricsAction("Upgrade_Started"));
+ content::RecordAction(UserMetricsAction("Upgrade_Started"));
show_throbber = true;
update_label_.SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_UPGRADE_STARTED)));
break;
case UPGRADE_CHECK_STARTED:
- UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Started"));
+ content::RecordAction(UserMetricsAction("UpgradeCheck_Started"));
show_throbber = true;
update_label_.SetText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_UPGRADE_CHECK_STARTED)));
break;
case UPGRADE_IS_AVAILABLE:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("UpgradeCheck_UpgradeIsAvailable"));
DCHECK(!google_updater_); // Should have been nulled out already.
google_updater_ = new GoogleUpdate();
@@ -708,7 +710,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
Version::GetVersionFromString(version_info.Version()));
if (!installed_version.get() ||
(installed_version->CompareTo(*running_version) <= 0)) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("UpgradeCheck_AlreadyUpToDate"));
string16 update_label_text = l10n_util::GetStringFUTF16(
IDS_UPGRADE_ALREADY_UP_TO_DATE,
@@ -726,10 +728,10 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
}
case UPGRADE_SUCCESSFUL: {
if (result == UPGRADE_ALREADY_UP_TO_DATE)
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("UpgradeCheck_AlreadyUpgraded"));
else
- UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Upgraded"));
+ content::RecordAction(UserMetricsAction("UpgradeCheck_Upgraded"));
restart_button_visible_ = true;
const string16& update_string =
UTF16ToWide(l10n_util::GetStringFUTF16(
@@ -740,7 +742,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
break;
}
case UPGRADE_ERROR: {
- UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Error"));
+ content::RecordAction(UserMetricsAction("UpgradeCheck_Error"));
if (!error_message.empty() && error_label_) {
error_label_->SetText(
l10n_util::GetStringFUTF16(IDS_ABOUT_BOX_ERROR_DURING_UPDATE_CHECK,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 4020e25..0551fbd 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -39,9 +39,9 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/tab_contents/page_navigator.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/page_transition_types.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -62,6 +62,7 @@
#include "ui/views/widget/tooltip_manager.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
using views::CustomButton;
using views::DropTargetEvent;
using views::MenuButton;
@@ -927,7 +928,7 @@ void BookmarkBarView::BookmarkNodeFaviconChanged(BookmarkModel* model,
void BookmarkBarView::WriteDragDataForView(View* sender,
const gfx::Point& press_pt,
ui::OSExchangeData* data) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragButton"));
+ content::RecordAction(UserMetricsAction("BookmarkBar_DragButton"));
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
@@ -1038,7 +1039,7 @@ void BookmarkBarView::ButtonPressed(views::Button* sender,
bookmark_utils::RecordBookmarkLaunch(IsDetached() ?
bookmark_utils::LAUNCH_DETACHED_BAR :
bookmark_utils::LAUNCH_ATTACHED_BAR);
- UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
+ content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
}
void BookmarkBarView::ShowContextMenuForView(View* source,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index ef4988a..2e9e44f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -16,8 +16,8 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/views/window.h"
#include "chrome/common/chrome_notification_types.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -33,6 +33,7 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
using views::ColumnSet;
using views::GridLayout;
@@ -272,7 +273,7 @@ void BookmarkBubbleView::ButtonPressed(
void BookmarkBubbleView::LinkClicked(views::Link* source, int event_flags) {
DCHECK(source == remove_link_);
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
// Set this so we remove the bookmark after the window closes.
remove_bookmark_ = true;
@@ -284,15 +285,15 @@ void BookmarkBubbleView::ItemChanged(views::Combobox* combo_box,
int prev_index,
int new_index) {
if (new_index + 1 == parent_model_.GetItemCount()) {
- UserMetrics::RecordAction(
- UserMetricsAction("BookmarkBubble_EditFromCombobox"));
+ content::RecordAction(
+ UserMetricsAction("BookmarkBubble_EditFromCombobox"));
ShowEditor();
}
}
void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) {
if (sender == edit_button_) {
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
+ content::RecordAction(UserMetricsAction("BookmarkBubble_Edit"));
ShowEditor();
} else {
DCHECK_EQ(sender, close_button_);
@@ -324,7 +325,7 @@ void BookmarkBubbleView::ApplyEdits() {
const string16 new_title = title_tf_->text();
if (new_title != node->GetTitle()) {
model->SetTitle(node, new_title);
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
}
// Last index means 'Choose another folder...'
@@ -332,7 +333,7 @@ void BookmarkBubbleView::ApplyEdits() {
const BookmarkNode* new_parent =
parent_model_.GetNodeAt(parent_combobox_->selected_item());
if (new_parent != node->parent()) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBubble_ChangeParent"));
model->Move(node, new_parent, new_parent->child_count());
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
index 5e6442b..f9b337e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc
@@ -16,10 +16,12 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/page_navigator.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
BookmarkContextMenuControllerViews::BookmarkContextMenuControllerViews(
views::Widget* parent_widget,
BookmarkContextMenuControllerViewsDelegate* delegate,
@@ -101,15 +103,15 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
WindowOpenDisposition initial_disposition;
if (id == IDC_BOOKMARK_BAR_OPEN_ALL) {
initial_disposition = NEW_FOREGROUND_TAB;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAll"));
} else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) {
initial_disposition = NEW_WINDOW;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow"));
} else {
initial_disposition = OFF_THE_RECORD;
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito"));
}
bookmark_utils::OpenAll(parent_widget_->GetNativeWindow(),
@@ -121,7 +123,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
case IDC_BOOKMARK_BAR_RENAME_FOLDER:
case IDC_BOOKMARK_BAR_EDIT:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Edit"));
if (selection_.size() != 1) {
@@ -137,7 +139,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
break;
case IDC_BOOKMARK_BAR_REMOVE: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Remove"));
delegate_->WillRemoveBookmarks(selection_);
@@ -151,7 +153,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
}
case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_Add"));
int index;
@@ -166,7 +168,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
}
case IDC_BOOKMARK_BAR_NEW_FOLDER: {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("BookmarkBar_ContextMenu_NewFolder"));
int index;
@@ -185,7 +187,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) {
break;
case IDC_BOOKMARK_MANAGER: {
- UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"));
+ content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
if (!browser) NOTREACHED();
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
index 45ac1d9..b356446 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/page_navigator.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -26,6 +26,7 @@
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
using views::MenuItemView;
BookmarkMenuController::BookmarkMenuController(Profile* profile,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index cfac24a..9ca672b 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/page_navigator.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -26,6 +26,7 @@
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
using views::MenuItemView;
// Max width of a menu. There does not appear to be an OS value for this, yet
@@ -288,7 +289,7 @@ void BookmarkMenuDelegate::WriteDragData(MenuItemView* sender,
ui::OSExchangeData* data) {
DCHECK(sender && data);
- UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragFromFolder"));
+ content::RecordAction(UserMetricsAction("BookmarkBar_DragFromFolder"));
BookmarkNodeData drag_data(menu_id_to_node_map_[sender->GetCommand()]);
drag_data.Write(profile_, data);
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.cc b/chrome/browser/ui/views/critical_notification_bubble_view.cc
index c8150c7..3c0750a 100644
--- a/chrome/browser/ui/views/critical_notification_bubble_view.cc
+++ b/chrome/browser/ui/views/critical_notification_bubble_view.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -26,6 +26,8 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
namespace {
// Layout constants.
@@ -78,7 +80,7 @@ void CriticalNotificationBubbleView::OnCountdown() {
int seconds = GetRemainingTime();
if (seconds <= 0) {
// Time's up!
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("CriticalNotification_AutoRestart"));
refresh_timer_.Stop();
BrowserList::AttemptRestart();
@@ -97,11 +99,11 @@ void CriticalNotificationBubbleView::ButtonPressed(
UpgradeDetector::GetInstance()->acknowledge_critical_update();
if (sender == restart_button_) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("CriticalNotification_Restart"));
BrowserList::AttemptRestart();
} else if (sender == dismiss_button_) {
- UserMetrics::RecordAction(UserMetricsAction("CriticalNotification_Ignore"));
+ content::RecordAction(UserMetricsAction("CriticalNotification_Ignore"));
// If the counter reaches 0, we set a restart flag that must be cleared if
// the user selects, for example, "Stay on this page" during an
// onbeforeunload handler.
@@ -196,5 +198,5 @@ void CriticalNotificationBubbleView::Init() {
base::TimeDelta::FromMilliseconds(kRefreshBubbleEvery),
this, &CriticalNotificationBubbleView::OnCountdown);
- UserMetrics::RecordAction(UserMetricsAction("CriticalNotificationShown"));
+ content::RecordAction(UserMetricsAction("CriticalNotificationShown"));
}
diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc
index 20b4fd8..bc838ab 100644
--- a/chrome/browser/ui/views/first_run_bubble.cc
+++ b/chrome/browser/ui/views/first_run_bubble.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/window.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -27,6 +27,8 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
namespace {
const int kAnchorVerticalOffset = -4;
const int kLayoutTopInset = 1;
@@ -120,7 +122,7 @@ FirstRunBubble::~FirstRunBubble() {
void FirstRunBubble::ButtonPressed(views::Button* sender,
const views::Event& event) {
if (bubble_type_ == FirstRun::OEM_BUBBLE) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("FirstRunOEMBubbleView_Clicked"));
}
GetWidget()->Close();
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 14d63e7..9224b14 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -80,8 +80,8 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -140,6 +140,7 @@
#endif
using base::TimeDelta;
+using content::UserMetricsAction;
using views::ColumnSet;
using views::GridLayout;
@@ -2510,7 +2511,7 @@ void BrowserView::UpdateAcceleratorMetrics(
const ui::Accelerator& accelerator, int command_id) {
const ui::KeyboardCode key_code = accelerator.key_code();
if (command_id == IDC_HELP_PAGE && key_code == ui::VKEY_F1)
- UserMetrics::RecordAction(UserMetricsAction("ShowHelpTabViaF1"));
+ content::RecordAction(UserMetricsAction("ShowHelpTabViaF1"));
#if defined(OS_CHROMEOS)
// Collect information about the relative popularity of various accelerators
@@ -2518,50 +2519,50 @@ void BrowserView::UpdateAcceleratorMetrics(
switch (command_id) {
case IDC_BACK:
if (key_code == ui::VKEY_BACK)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Back_Backspace"));
+ content::RecordAction(UserMetricsAction("Accel_Back_Backspace"));
else if (key_code == ui::VKEY_F1)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Back_F1"));
+ content::RecordAction(UserMetricsAction("Accel_Back_F1"));
else if (key_code == ui::VKEY_LEFT)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Back_Left"));
+ content::RecordAction(UserMetricsAction("Accel_Back_Left"));
break;
case IDC_FORWARD:
if (key_code == ui::VKEY_BACK)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Forward_Backspace"));
+ content::RecordAction(UserMetricsAction("Accel_Forward_Backspace"));
else if (key_code == ui::VKEY_F2)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Forward_F2"));
+ content::RecordAction(UserMetricsAction("Accel_Forward_F2"));
else if (key_code == ui::VKEY_RIGHT)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Forward_Right"));
+ content::RecordAction(UserMetricsAction("Accel_Forward_Right"));
break;
case IDC_RELOAD:
case IDC_RELOAD_IGNORING_CACHE:
if (key_code == ui::VKEY_R)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Reload_R"));
+ content::RecordAction(UserMetricsAction("Accel_Reload_R"));
else if (key_code == ui::VKEY_F3)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Reload_F3"));
+ content::RecordAction(UserMetricsAction("Accel_Reload_F3"));
break;
case IDC_FULLSCREEN:
if (key_code == ui::VKEY_F4)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Fullscreen_F4"));
+ content::RecordAction(UserMetricsAction("Accel_Fullscreen_F4"));
break;
case IDC_NEW_TAB:
if (key_code == ui::VKEY_T)
- UserMetrics::RecordAction(UserMetricsAction("Accel_NewTab_T"));
+ content::RecordAction(UserMetricsAction("Accel_NewTab_T"));
break;
case IDC_SEARCH:
if (key_code == ui::VKEY_LWIN)
- UserMetrics::RecordAction(UserMetricsAction("Accel_Search_LWin"));
+ content::RecordAction(UserMetricsAction("Accel_Search_LWin"));
break;
case IDC_FOCUS_LOCATION:
if (key_code == ui::VKEY_D)
- UserMetrics::RecordAction(UserMetricsAction("Accel_FocusLocation_D"));
+ content::RecordAction(UserMetricsAction("Accel_FocusLocation_D"));
else if (key_code == ui::VKEY_L)
- UserMetrics::RecordAction(UserMetricsAction("Accel_FocusLocation_L"));
+ content::RecordAction(UserMetricsAction("Accel_FocusLocation_L"));
break;
case IDC_FOCUS_SEARCH:
if (key_code == ui::VKEY_E)
- UserMetrics::RecordAction(UserMetricsAction("Accel_FocusSearch_E"));
+ content::RecordAction(UserMetricsAction("Accel_FocusSearch_E"));
else if (key_code == ui::VKEY_K)
- UserMetrics::RecordAction(UserMetricsAction("Accel_FocusSearch_K"));
+ content::RecordAction(UserMetricsAction("Accel_FocusSearch_K"));
break;
default:
// Do nothing.
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
index ce404f2..3739a5f 100644
--- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
+++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
@@ -9,7 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/importer/importer_host.h"
#include "chrome/browser/importer/importer_lock_dialog.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -18,6 +18,8 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
// Default size of the dialog window.
static const int kDefaultWindowWidth = 320;
static const int kDefaultWindowHeight = 100;
@@ -27,7 +29,7 @@ namespace importer {
void ShowImportLockDialog(gfx::NativeWindow parent,
ImporterHost* importer_host) {
ImportLockDialogView::Show(parent, importer_host);
- UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogView_Shown"));
+ content::RecordAction(UserMetricsAction("ImportLockDialogView_Shown"));
}
} // namespace importer
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 30a1ea4..6ef5ae5 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -32,7 +32,7 @@
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/url_util.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
@@ -59,6 +59,8 @@
#pragma comment(lib, "oleacc.lib") // Needed for accessibility support.
#pragma comment(lib, "riched20.lib") // Needed for the richedit control.
+using content::UserMetricsAction;
+
///////////////////////////////////////////////////////////////////////////////
// AutocompleteEditModel
@@ -2509,10 +2511,10 @@ void OmniboxViewWin::StartDragIfNecessary(const CPoint& point) {
model_->GetDataForURLExport(&url, &title, &favicon);
drag_utils::SetURLAndDragImage(url, title, favicon, &data);
supported_modes |= DROPEFFECT_LINK;
- UserMetrics::RecordAction(UserMetricsAction("Omnibox_DragURL"));
+ content::RecordAction(UserMetricsAction("Omnibox_DragURL"));
} else {
supported_modes |= DROPEFFECT_MOVE;
- UserMetrics::RecordAction(UserMetricsAction("Omnibox_DragString"));
+ content::RecordAction(UserMetricsAction("Omnibox_DragString"));
}
data.SetString(text_to_write);
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index cae8d3d..1d77cb3 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -20,13 +20,15 @@
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
+
static TabRendererData::NetworkState TabContentsNetworkState(
TabContents* contents) {
if (!contents || !contents->IsLoading())
@@ -285,10 +287,10 @@ void BrowserTabStripController::PerformDrop(bool drop_before,
params.tabstrip_index = index;
if (drop_before) {
- UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"));
+ content::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"));
params.disposition = NEW_FOREGROUND_TAB;
} else {
- UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab"));
+ content::RecordAction(UserMetricsAction("Tab_DropURLOnTab"));
params.disposition = CURRENT_TAB;
params.source_contents = model_->GetTabContentsAt(index);
}
@@ -303,7 +305,7 @@ bool BrowserTabStripController::IsCompatibleWith(BaseTabStrip* other) const {
}
void BrowserTabStripController::CreateNewTab() {
- UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"));
+ content::RecordAction(UserMetricsAction("NewTab_Button"));
model_->delegate()->AddBlankTab(true);
}
diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
index cd76630..8852720 100644
--- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
@@ -22,11 +22,11 @@
#include "chrome/browser/ui/views/tabs/tab.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/animation/animation.h"
@@ -44,6 +44,8 @@
#include <gdk/gdkkeysyms.h> // NOLINT
#endif
+using content::UserMetricsAction;
+
static const int kHorizontalMoveThreshold = 16; // Pixels.
// If non-null there is a drag underway.
@@ -1190,38 +1192,38 @@ void DefaultTabDragController::CompleteDrag() {
if (dock_info_.type() != DockInfo::NONE) {
switch (dock_info_.type()) {
case DockInfo::LEFT_OF_WINDOW:
- UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Left"));
+ content::RecordAction(UserMetricsAction("DockingWindow_Left"));
break;
case DockInfo::RIGHT_OF_WINDOW:
- UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Right"));
+ content::RecordAction(UserMetricsAction("DockingWindow_Right"));
break;
case DockInfo::BOTTOM_OF_WINDOW:
- UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Bottom"));
+ content::RecordAction(UserMetricsAction("DockingWindow_Bottom"));
break;
case DockInfo::TOP_OF_WINDOW:
- UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Top"));
+ content::RecordAction(UserMetricsAction("DockingWindow_Top"));
break;
case DockInfo::MAXIMIZE:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("DockingWindow_Maximize"));
break;
case DockInfo::LEFT_HALF:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("DockingWindow_LeftHalf"));
break;
case DockInfo::RIGHT_HALF:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("DockingWindow_RightHalf"));
break;
case DockInfo::BOTTOM_HALF:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("DockingWindow_BottomHalf"));
break;
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index dc3050a..1c492ee 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -23,8 +23,8 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/accessibility/browser_accessibility_state.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -50,6 +50,8 @@
#endif
#endif
+using content::UserMetricsAction;
+
// static
const char ToolbarView::kViewClassName[] = "browser/ui/views/ToolbarView";
// The space between items is 4 px in general.
@@ -289,7 +291,7 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
} else if (ShouldShowIncompatibilityWarning()) {
#if defined(OS_WIN)
if (!was_showing)
- UserMetrics::RecordAction(UserMetricsAction("ConflictBadge"));
+ content::RecordAction(UserMetricsAction("ConflictBadge"));
badge = *tp->GetBitmapNamed(IDR_CONFLICT_BADGE);
incompatibility_badge_showing = true;
#else
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index bcf8a7a..63fee43 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -18,11 +18,11 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -44,6 +44,7 @@
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/widget/widget.h"
+using content::UserMetricsAction;
using ui::MenuModel;
using views::CustomButton;
using views::ImageButton;
@@ -602,7 +603,7 @@ void WrenchMenu::RunMenu(views::MenuButton* host) {
gfx::Point screen_loc;
views::View::ConvertPointToScreen(host, &screen_loc);
gfx::Rect bounds(screen_loc, host->size());
- UserMetrics::RecordAction(UserMetricsAction("ShowAppMenu"));
+ content::RecordAction(UserMetricsAction("ShowAppMenu"));
if (menu_runner_->RunMenuAt(host->GetWidget(), host, bounds,
MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) ==
views::MenuRunner::MENU_DELETED)
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index 979ae3b..142bbcf 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -20,10 +20,10 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -32,6 +32,8 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using content::UserMetricsAction;
+
namespace {
ChromeWebUIDataSource* CreateConflictsUIHTMLSource() {
@@ -155,7 +157,7 @@ void ConflictsDOMHandler::Observe(int type,
///////////////////////////////////////////////////////////////////////////////
ConflictsUI::ConflictsUI(TabContents* contents) : ChromeWebUI(contents) {
- UserMetrics::RecordAction(UserMetricsAction("ViewAboutConflicts"));
+ content::RecordAction(UserMetricsAction("ViewAboutConflicts"));
AddMessageHandler((new ConflictsDOMHandler())->Attach(this));
// Set up the about:conflicts source.
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 137af2d..820a603 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -31,7 +31,7 @@
#include "chrome/common/url_constants.h"
#include "content/browser/download/download_item.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "ui/gfx/image/image.h"
@@ -44,6 +44,7 @@
#endif
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 1bf0cd3..cdcd6f3 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -29,7 +29,7 @@
#include "content/browser/gpu/gpu_data_manager.h"
#include "content/browser/plugin_service.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -42,6 +42,8 @@
#include "base/win/windows_version.h"
#endif
+using content::UserMetricsAction;
+
namespace {
ChromeWebUIDataSource* CreateFlashUIHTMLSource() {
@@ -362,7 +364,7 @@ void FlashDOMHandler::MaybeRespondToPage() {
///////////////////////////////////////////////////////////////////////////////
FlashUI::FlashUI(TabContents* contents) : ChromeWebUI(contents) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("ViewAboutFlash"));
AddMessageHandler((new FlashDOMHandler())->Attach(this));
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 0174e806..3eb31ce 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -32,9 +32,9 @@
#include "chrome/common/url_constants.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/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -45,6 +45,8 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+using content::UserMetricsAction;
+
// Maximum number of search results to return in a given search. We should
// eventually remove this.
static const int kMaxSearchResults = 100;
diff --git a/chrome/browser/ui/webui/metrics_handler.cc b/chrome/browser/ui/webui/metrics_handler.cc
index 4b9301c..f741c97 100644
--- a/chrome/browser/ui/webui/metrics_handler.cc
+++ b/chrome/browser/ui/webui/metrics_handler.cc
@@ -14,10 +14,11 @@
#include "chrome/browser/ui/webui/chrome_web_ui.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
using base::ListValue;
+using content::UserMetricsAction;
MetricsHandler::MetricsHandler() {}
MetricsHandler::~MetricsHandler() {}
@@ -37,7 +38,7 @@ void MetricsHandler::RegisterMessages() {
void MetricsHandler::HandleRecordAction(const ListValue* args) {
std::string string_action = UTF16ToUTF8(ExtractStringValue(args));
- UserMetrics::RecordComputedAction(string_action);
+ content::RecordComputedAction(string_action);
}
void MetricsHandler::HandleRecordInHistogram(const ListValue* args) {
diff --git a/chrome/browser/ui/webui/ntp/most_visited_handler.cc b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
index 16cb991..aaa30ee 100644
--- a/chrome/browser/ui/webui/ntp/most_visited_handler.cc
+++ b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
@@ -30,15 +30,17 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
MostVisitedHandler::MostVisitedHandler()
: got_first_most_visited_request_(false) {
}
@@ -146,7 +148,7 @@ void MostVisitedHandler::HandleRemoveURLsFromBlacklist(const ListValue* args) {
NOTREACHED();
return;
}
- UserMetrics::RecordAction(UserMetricsAction("MostVisited_UrlRemoved"));
+ content::RecordAction(UserMetricsAction("MostVisited_UrlRemoved"));
history::TopSites* ts = Profile::FromWebUI(web_ui_)->GetTopSites();
if (ts)
ts->RemoveBlacklistedURL(GURL(url));
@@ -154,7 +156,7 @@ void MostVisitedHandler::HandleRemoveURLsFromBlacklist(const ListValue* args) {
}
void MostVisitedHandler::HandleClearBlacklist(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("MostVisited_BlacklistCleared"));
+ content::RecordAction(UserMetricsAction("MostVisited_BlacklistCleared"));
history::TopSites* ts = Profile::FromWebUI(web_ui_)->GetTopSites();
if (ts)
@@ -201,7 +203,7 @@ void MostVisitedHandler::BlacklistURL(const GURL& url) {
history::TopSites* ts = Profile::FromWebUI(web_ui_)->GetTopSites();
if (ts)
ts->AddBlacklistedURL(url);
- UserMetrics::RecordAction(UserMetricsAction("MostVisited_UrlBlacklisted"));
+ content::RecordAction(UserMetricsAction("MostVisited_UrlBlacklisted"));
}
std::string MostVisitedHandler::GetDictionaryKeyForURL(const std::string& url) {
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 5974c53..e08d377 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -42,14 +42,15 @@
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc
index 7d767f9..62d38dc 100644
--- a/chrome/browser/ui/webui/options/advanced_options_handler.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc
@@ -31,9 +31,9 @@
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/page_zoom.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -46,6 +46,8 @@
#include "chrome/browser/ui/webui/options/advanced_options_utils.h"
#endif
+using content::UserMetricsAction;
+
AdvancedOptionsHandler::AdvancedOptionsHandler() {
#if(!defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN))
@@ -354,7 +356,7 @@ void AdvancedOptionsHandler::HandleSelectDownloadLocation(
void AdvancedOptionsHandler::FileSelected(const FilePath& path, int index,
void* params) {
- UserMetrics::RecordAction(UserMetricsAction("Options_SetDownloadDirectory"));
+ content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory"));
PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path);
}
@@ -367,7 +369,7 @@ void AdvancedOptionsHandler::OnCloudPrintSetupClosed() {
}
void AdvancedOptionsHandler::HandleAutoOpenButton(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
+ content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
DownloadManager* manager =
web_ui_->tab_contents()->browser_context()->GetDownloadManager();
if (manager)
@@ -379,9 +381,9 @@ void AdvancedOptionsHandler::HandleMetricsReportingCheckbox(
#if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS)
std::string checked_str = UTF16ToUTF8(ExtractStringValue(args));
bool enabled = checked_str == "true";
- UserMetrics::RecordAction(
+ content::RecordAction(
enabled ?
- UserMetricsAction("Options_MetricsReportingCheckbox_Enable") :
+ UserMetricsAction("Options_MetricsReportingCheckbox_Enable") :
UserMetricsAction("Options_MetricsReportingCheckbox_Disable"));
bool is_enabled = OptionsUtil::ResolveMetricsReportingEnabled(enabled);
enable_metrics_recording_.SetValue(is_enabled);
@@ -411,9 +413,9 @@ void AdvancedOptionsHandler::HandleCheckRevocationCheckbox(
const ListValue* args) {
std::string checked_str = UTF16ToUTF8(ExtractStringValue(args));
bool enabled = checked_str == "true";
- UserMetrics::RecordAction(
+ content::RecordAction(
enabled ?
- UserMetricsAction("Options_CheckCertRevocation_Enable") :
+ UserMetricsAction("Options_CheckCertRevocation_Enable") :
UserMetricsAction("Options_CheckCertRevocation_Disable"));
rev_checking_enabled_.SetValue(enabled);
}
@@ -423,8 +425,8 @@ void AdvancedOptionsHandler::HandleBackgroundModeCheckbox(
const ListValue* args) {
std::string checked_str = UTF16ToUTF8(ExtractStringValue(args));
bool enabled = checked_str == "true";
- UserMetrics::RecordAction(enabled ?
- UserMetricsAction("Options_BackgroundMode_Enable") :
+ content::RecordAction(enabled ?
+ UserMetricsAction("Options_BackgroundMode_Enable") :
UserMetricsAction("Options_BackgroundMode_Disable"));
background_mode_enabled_.SetValue(enabled);
}
@@ -438,20 +440,20 @@ void AdvancedOptionsHandler::SetupBackgroundModeSettings() {
#if !defined(OS_CHROMEOS)
void AdvancedOptionsHandler::ShowNetworkProxySettings(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_ShowProxySettings"));
+ content::RecordAction(UserMetricsAction("Options_ShowProxySettings"));
AdvancedOptionsUtilities::ShowNetworkProxySettings(web_ui_->tab_contents());
}
#endif
#if !defined(USE_NSS) && !defined(USE_OPENSSL)
void AdvancedOptionsHandler::ShowManageSSLCertificates(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_ManageSSLCertificates"));
+ content::RecordAction(UserMetricsAction("Options_ManageSSLCertificates"));
AdvancedOptionsUtilities::ShowManageSSLCertificates(web_ui_->tab_contents());
}
#endif
void AdvancedOptionsHandler::ShowCloudPrintManagePage(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_ManageCloudPrinters"));
+ content::RecordAction(UserMetricsAction("Options_ManageCloudPrinters"));
// Open a new tab in the current window for the management page.
Profile* profile = Profile::FromWebUI(web_ui_);
web_ui_->tab_contents()->OpenURL(
@@ -461,7 +463,7 @@ void AdvancedOptionsHandler::ShowCloudPrintManagePage(const ListValue* args) {
#if !defined(OS_CHROMEOS)
void AdvancedOptionsHandler::ShowCloudPrintSetupDialog(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_EnableCloudPrintProxy"));
+ content::RecordAction(UserMetricsAction("Options_EnableCloudPrintProxy"));
// Open the connector enable page in the current tab.
Profile* profile = Profile::FromWebUI(web_ui_);
web_ui_->tab_contents()->OpenURL(
@@ -472,7 +474,7 @@ void AdvancedOptionsHandler::ShowCloudPrintSetupDialog(const ListValue* args) {
void AdvancedOptionsHandler::HandleDisableCloudPrintProxy(
const ListValue* args) {
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DisableCloudPrintProxy"));
CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui_))->
DisableForUser();
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index d42aa30..3546734 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -29,14 +29,16 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
BrowserOptionsHandler::BrowserOptionsHandler()
: template_url_service_(NULL), startup_custom_pages_table_model_(NULL) {
#if !defined(OS_MACOSX)
@@ -184,7 +186,7 @@ void BrowserOptionsHandler::BecomeDefaultBrowser(const ListValue* args) {
if (default_browser_policy_.IsManaged())
return;
- UserMetrics::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"));
+ content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"));
#if defined(OS_MACOSX)
if (ShellIntegration::SetAsDefaultBrowser())
UpdateDefaultBrowserState();
@@ -285,7 +287,7 @@ void BrowserOptionsHandler::SetDefaultSearchEngine(const ListValue* args) {
selected_index < static_cast<int>(model_urls.size()))
template_url_service_->SetDefaultSearchProvider(model_urls[selected_index]);
- UserMetrics::RecordAction(UserMetricsAction("Options_SearchEngineChanged"));
+ content::RecordAction(UserMetricsAction("Options_SearchEngineChanged"));
}
void BrowserOptionsHandler::UpdateSearchEngines() {
diff --git a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
index b7d6d0a..31543d5 100644
--- a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
@@ -20,10 +20,12 @@
#include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
namespace chromeos {
diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
index ede610e..e0410be 100644
--- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
@@ -20,11 +20,13 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
namespace chromeos {
CrosLanguageOptionsHandler::CrosLanguageOptionsHandler() {
@@ -207,7 +209,7 @@ void CrosLanguageOptionsHandler::SetApplicationLocale(
}
void CrosLanguageOptionsHandler::RestartCallback(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("LanguageOptions_SignOut"));
+ content::RecordAction(UserMetricsAction("LanguageOptions_SignOut"));
Browser* browser = Browser::GetBrowserForController(
&web_ui_->tab_contents()->controller(), NULL);
@@ -220,7 +222,7 @@ void CrosLanguageOptionsHandler::InputMethodDisableCallback(
const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = base::StringPrintf(
"LanguageOptions_DisableInputMethod_%s", input_method_id.c_str());
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
void CrosLanguageOptionsHandler::InputMethodEnableCallback(
@@ -228,7 +230,7 @@ void CrosLanguageOptionsHandler::InputMethodEnableCallback(
const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = base::StringPrintf(
"LanguageOptions_EnableInputMethod_%s", input_method_id.c_str());
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback(
@@ -236,7 +238,7 @@ void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback(
const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = base::StringPrintf(
"InputMethodOptions_Open_%s", input_method_id.c_str());
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc
index 046749f..f4738b6 100644
--- a/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc
@@ -8,7 +8,9 @@
#include "base/bind_helpers.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
+
+using content::UserMetricsAction;
namespace chromeos {
@@ -35,7 +37,7 @@ void StatsOptionsHandler::HandleMetricsReportingCheckbox(
#if defined(GOOGLE_CHROME_BUILD)
const std::string checked_str = UTF16ToUTF8(ExtractStringValue(args));
const bool enabled = (checked_str == "true");
- UserMetrics::RecordAction(
+ content::RecordAction(
enabled ?
UserMetricsAction("Options_MetricsReportingCheckbox_Enable") :
UserMetricsAction("Options_MetricsReportingCheckbox_Disable"));
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index ed4ccc9..89fe148 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -29,15 +29,17 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
namespace {
struct ContentSettingsTypeNameEntry {
@@ -691,39 +693,39 @@ void ContentSettingsHandler::SetContentFilter(const ListValue* args) {
}
switch (content_type) {
case CONTENT_SETTINGS_TYPE_COOKIES:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultCookieSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_IMAGES:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultImagesSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_JAVASCRIPT:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultJavaScriptSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_PLUGINS:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultPluginsSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_POPUPS:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultPopupsSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultNotificationsSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_GEOLOCATION:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultGeolocationSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_INTENTS:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultHandlersSettingChanged"));
break;
case CONTENT_SETTINGS_TYPE_MOUSELOCK:
- UserMetrics::RecordAction(
+ content::RecordAction(
UserMetricsAction("Options_DefaultMouseLockSettingChanged"));
break;
default:
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index dcdcc04..c3ff607 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -19,9 +19,9 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -29,6 +29,8 @@
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
CoreOptionsHandler::CoreOptionsHandler()
: handlers_host_(NULL) {
}
@@ -218,7 +220,7 @@ void CoreOptionsHandler::ClearPref(const std::string& pref_name,
pref_service->ScheduleSavePersistentPrefs();
if (!metric.empty())
- UserMetrics::RecordComputedAction(metric);
+ content::RecordComputedAction(metric);
}
void CoreOptionsHandler::ProcessUserMetric(const base::Value* value,
@@ -233,7 +235,7 @@ void CoreOptionsHandler::ProcessUserMetric(const base::Value* value,
metric_string += bool_value ? "_Enable" : "_Disable";
}
- UserMetrics::RecordComputedAction(metric_string);
+ content::RecordComputedAction(metric_string);
}
void CoreOptionsHandler::NotifyPrefChanged(
@@ -452,7 +454,7 @@ void CoreOptionsHandler::HandleClearPref(const ListValue* args) {
void CoreOptionsHandler::HandleUserMetricsAction(const ListValue* args) {
std::string metric = UTF16ToUTF8(ExtractStringValue(args));
if (!metric.empty())
- UserMetrics::RecordComputedAction(metric);
+ content::RecordComputedAction(metric);
}
void CoreOptionsHandler::UpdateClearPluginLSOData() {
diff --git a/chrome/browser/ui/webui/options/language_options_handler.cc b/chrome/browser/ui/webui/options/language_options_handler.cc
index 5e136f0..f219f9d 100644
--- a/chrome/browser/ui/webui/options/language_options_handler.cc
+++ b/chrome/browser/ui/webui/options/language_options_handler.cc
@@ -20,11 +20,13 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
LanguageOptionsHandler::LanguageOptionsHandler() {
}
@@ -111,6 +113,6 @@ void LanguageOptionsHandler::SetApplicationLocale(
}
void LanguageOptionsHandler::RestartCallback(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("LanguageOptions_Restart"));
+ content::RecordAction(UserMetricsAction("LanguageOptions_Restart"));
BrowserList::AttemptRestart();
}
diff --git a/chrome/browser/ui/webui/options/language_options_handler_common.cc b/chrome/browser/ui/webui/options/language_options_handler_common.cc
index 769359d..cc2cc14 100644
--- a/chrome/browser/ui/webui/options/language_options_handler_common.cc
+++ b/chrome/browser/ui/webui/options/language_options_handler_common.cc
@@ -21,11 +21,13 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/spellcheck_common.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+using content::UserMetricsAction;
+
LanguageOptionsHandlerCommon::LanguageOptionsHandlerCommon() {
}
@@ -142,7 +144,7 @@ DictionaryValue* LanguageOptionsHandlerCommon::GetSpellCheckLanguageCodeSet() {
void LanguageOptionsHandlerCommon::LanguageOptionsOpenCallback(
const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("LanguageOptions_Open"));
+ content::RecordAction(UserMetricsAction("LanguageOptions_Open"));
}
void LanguageOptionsHandlerCommon::UiLanguageChangeCallback(
@@ -151,7 +153,7 @@ void LanguageOptionsHandlerCommon::UiLanguageChangeCallback(
CHECK(!language_code.empty());
const std::string action = base::StringPrintf(
"LanguageOptions_UiLanguageChange_%s", language_code.c_str());
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
SetApplicationLocale(language_code);
web_ui_->CallJavascriptFunction("options.LanguageOptions.uiLanguageSaved");
}
@@ -162,5 +164,5 @@ void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback(
CHECK(!language_code.empty());
const std::string action = base::StringPrintf(
"LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str());
- UserMetrics::RecordComputedAction(action);
+ content::RecordComputedAction(action);
}
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index 3455124..c41a372 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -46,9 +46,9 @@
#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/browser_thread.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -82,6 +82,8 @@
#include "chrome/browser/ui/webui/options/certificate_manager_handler.h"
#endif
+using content::UserMetricsAction;
+
static const char kLocalizedStringsFile[] = "strings.js";
static const char kOptionsBundleJsFile[] = "options_bundle.js";
diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc
index 0bba9fc..5d53dc5 100644
--- a/chrome/browser/ui/webui/options/personal_options_handler.cc
+++ b/chrome/browser/ui/webui/options/personal_options_handler.cc
@@ -34,8 +34,8 @@
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -53,6 +53,8 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#endif // defined(TOOLKIT_GTK)
+using content::UserMetricsAction;
+
PersonalOptionsHandler::PersonalOptionsHandler() {
multiprofile_ = ProfileManager::IsMultipleProfilesEnabled();
#if defined(OS_CHROMEOS)
@@ -378,14 +380,14 @@ void PersonalOptionsHandler::Initialize() {
}
void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_ThemesReset"));
+ content::RecordAction(UserMetricsAction("Options_ThemesReset"));
Profile* profile = Profile::FromWebUI(web_ui_);
ThemeServiceFactory::GetForProfile(profile)->UseDefaultTheme();
}
#if defined(TOOLKIT_GTK)
void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
- UserMetrics::RecordAction(UserMetricsAction("Options_GtkThemeSet"));
+ content::RecordAction(UserMetricsAction("Options_GtkThemeSet"));
Profile* profile = Profile::FromWebUI(web_ui_);
ThemeServiceFactory::GetForProfile(profile)->SetNativeTheme();
}
diff --git a/chrome/browser/web_resource/notification_promo.cc b/chrome/browser/web_resource/notification_promo.cc
index e3d12e4..cd6b19b 100644
--- a/chrome/browser/web_resource/notification_promo.cc
+++ b/chrome/browser/web_resource/notification_promo.cc
@@ -16,11 +16,13 @@
#include "chrome/browser/profiles/profile_impl.h"
#include "chrome/browser/web_resource/promo_resource_service.h"
#include "chrome/common/pref_names.h"
-#include "content/browser/user_metrics.h"
+#include "content/public/browser/user_metrics.h"
#include "googleurl/src/gurl.h"
#include "net/base/cookie_store.h"
#include "net/url_request/url_request_context.h"
+using content::UserMetricsAction;
+
namespace {
// Maximum number of views.
@@ -335,12 +337,12 @@ bool NotificationPromo::CanShow() const {
}
void NotificationPromo::HandleClosed() {
- UserMetrics::RecordAction(UserMetricsAction("NTPPromoClosed"));
+ content::RecordAction(UserMetricsAction("NTPPromoClosed"));
prefs_->SetBoolean(prefs::kNTPPromoClosed, true);
}
bool NotificationPromo::HandleViewed() {
- UserMetrics::RecordAction(UserMetricsAction("NTPPromoShown"));
+ content::RecordAction(UserMetricsAction("NTPPromoShown"));
if (prefs_->HasPrefPath(prefs::kNTPPromoViewsMax))
max_views_ = prefs_->GetInteger(prefs::kNTPPromoViewsMax);
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 712142e..403836f 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -75,7 +75,7 @@ class WebResourceService::UnpackerClient : public UtilityProcessHost::Client {
IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackWebResource_Failed,
OnUnpackWebResourceFailed)
IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP_EX()
+ IPC_END_MESSAGE_MAP()
return handled;
}