diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 23:29:59 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 23:29:59 +0000 |
commit | afd1e525b648613762191b3720ca9533eef358a8 (patch) | |
tree | 3082154d5fd8850222b249d062c874f283f93115 /chrome/browser | |
parent | c5ac7e1ef43c7087c8e2c08582b9cd0029229686 (diff) | |
download | chromium_src-afd1e525b648613762191b3720ca9533eef358a8.zip chromium_src-afd1e525b648613762191b3720ca9533eef358a8.tar.gz chromium_src-afd1e525b648613762191b3720ca9533eef358a8.tar.bz2 |
Move UserMetrics to content.
Just the class that provides the action logging API which is used all over the place
is being moved. The UserMetrics class uses the notification system to inform the core
of the user metrics system of each event, that core part is not being moved.
Also take care of a TODO to remove the class methods that take a Profile*
as a paramter (since Profile is verbotten in /content).
BUG=78499
Review URL: http://codereview.chromium.org/6883021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
87 files changed, 276 insertions, 492 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index d418124..b9e3da3 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -13,11 +13,11 @@ #include "base/memory/singleton.h" #include "base/string_number_conversions.h" #include "base/values.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 7e81d1c..5311133 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -19,7 +19,6 @@ #include "chrome/browser/command_updater.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/instant/instant_confirm_dialog.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/profiles/profile_manager.h" @@ -50,6 +49,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -791,8 +791,7 @@ void RecordLastRunAppBundlePath() { break; } case IDC_SHOW_BOOKMARK_MANAGER: - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"), - defaultProfile); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); if (Browser* browser = ActivateBrowser(defaultProfile)) { // Open a bookmark manager tab. browser->OpenBookmarkManager(); @@ -853,8 +852,7 @@ void RecordLastRunAppBundlePath() { ProfileSyncService::START_FROM_WRENCH); break; case IDC_TASK_MANAGER: - UserMetrics::RecordAction(UserMetricsAction("TaskManager"), - defaultProfile); + UserMetrics::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 380c32d..524ef9d 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -22,7 +22,6 @@ #include "chrome/browser/extensions/extension_omnibox_api.h" #include "chrome/browser/google/google_url_tracker.h" #include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/predictor_api.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/profiles/profile.h" @@ -31,6 +30,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/url_constants.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "googleurl/src/gurl.h" #include "googleurl/src/url_util.h" @@ -524,7 +524,7 @@ void AutocompleteEditModel::OpenURL(const GURL& url, } if (template_url) { - UserMetrics::RecordAction(UserMetricsAction("AcceptedKeyword"), profile_); + UserMetrics::RecordAction(UserMetricsAction("AcceptedKeyword")); template_url_model->IncrementUsageCount(template_url); } @@ -556,7 +556,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"), profile_); + UserMetrics::RecordAction(UserMetricsAction("AcceptedKeywordHint")); return true; } diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc index a97372a..178f4c3 100644 --- a/chrome/browser/background_mode_manager.cc +++ b/chrome/browser/background_mode_manager.cc @@ -12,7 +12,6 @@ #include "chrome/browser/background_application_list_model.h" #include "chrome/browser/background_mode_manager.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/status_icons/status_icon.h" #include "chrome/browser/status_icons/status_tray.h" @@ -20,6 +19,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "grit/chromium_strings.h" @@ -339,7 +339,7 @@ void BackgroundModeManager::ExecuteCommand(int item) { GetBrowserWindow()->OpenAboutChromeDialog(); break; case IDC_EXIT: - UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Exit")); BrowserList::CloseAllBrowsersAndExit(); break; case IDC_OPTIONS: diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc index 55b09d6..95cb5ff 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc @@ -10,13 +10,13 @@ #include "chrome/browser/bookmarks/bookmark_folder_editor_controller.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #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 "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -112,18 +112,15 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { initial_disposition = NEW_FOREGROUND_TAB; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAll"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { initial_disposition = NEW_WINDOW; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); } else { initial_disposition = OFF_THE_RECORD; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); } bookmark_utils::OpenAll(parent_window_, profile_, navigator_, selection_, initial_disposition); @@ -133,8 +130,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_RENAME_FOLDER: case IDC_BOOKMARK_BAR_EDIT: UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Edit"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Edit")); if (selection_.size() != 1) { NOTREACHED(); @@ -154,8 +150,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_REMOVE: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Remove"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Remove")); for (size_t i = 0; i < selection_.size(); ++i) { int index = selection_[i]->parent()->GetIndexOf(selection_[i]); @@ -168,8 +163,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Add"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Add")); // TODO: this should honor the index from GetParentForNewNodes. BookmarkEditor::Show( @@ -181,8 +175,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_NEW_FOLDER: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_NewFolder"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_NewFolder")); int index; const BookmarkNode* parent = bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); @@ -196,8 +189,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { break; case IDC_BOOKMARK_MANAGER: - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); { Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser) diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index e8c9724..a4fd01e 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -165,7 +165,6 @@ #include "chrome/browser/browser_util_win.h" #include "chrome/browser/first_run/try_chrome_dialog_view.h" #include "chrome/browser/first_run/upgrade_util_win.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/ui/views/user_data_dir_dialog.h" @@ -173,6 +172,7 @@ #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 "net/base/sdch_manager.h" #include "printing/printed_document.h" diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index 074f9da..3d335de 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -15,7 +15,6 @@ #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/history/history.h" #include "chrome/browser/io_thread.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/chrome_net_log.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/password_manager/password_store.h" @@ -29,6 +28,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/in_process_webkit/webkit_context.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_source.h" #include "net/base/cookie_monster.h" #include "net/base/net_errors.h" @@ -116,8 +116,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"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_History")); waiting_for_clear_history_ = true; history_service->ExpireHistoryBetween(restrict_urls, delete_begin_, delete_end_, @@ -160,16 +159,14 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_DOWNLOADS) { - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Downloads")); DownloadManager* download_manager = profile_->GetDownloadManager(); download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); download_manager->ClearLastDownloadPath(); } if (remove_mask & REMOVE_COOKIES) { - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); // Since we are running on the UI thread don't call GetURLRequestContext(). net::CookieMonster* cookie_monster = profile_->GetRequestContext()->DONTUSEME_GetCookieStore()-> @@ -211,8 +208,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_PASSWORDS) { - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); PasswordStore* password_store = profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); @@ -221,8 +217,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_FORM_DATA) { - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Autofill")); WebDataService* web_data_service = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); @@ -244,8 +239,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { // Invoke DoClearCache on the IO thread. waiting_for_clear_cache_ = true; - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cache"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_Cache")); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc index 830de18..509c4bb 100644 --- a/chrome/browser/chromeos/external_metrics.cc +++ b/chrome/browser/chromeos/external_metrics.cc @@ -20,7 +20,7 @@ #include "base/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/metrics/metrics_service.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" #include "content/browser/browser_thread.h" namespace chromeos { diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc index 92e1732..b925892 100644 --- a/chrome/browser/chromeos/locale_change_guard.cc +++ b/chrome/browser/chromeos/locale_change_guard.cc @@ -8,13 +8,13 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/notifications/notification_delegate.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/pref_names.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc index 8d333e6..e340751 100644 --- a/chrome/browser/chromeos/login/login_performer.cc +++ b/chrome/browser/chromeos/login/login_performer.cc @@ -18,12 +18,12 @@ #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/user_cros_settings_provider.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index e7c453e..9f49a88 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -35,7 +35,6 @@ #include "chrome/browser/chromeos/system_key_event_listener.h" #include "chrome/browser/chromeos/view_ids.h" #include "chrome/browser/chromeos/wm_ipc.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sync/profile_sync_service.h" @@ -44,6 +43,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc index a817509..5820831 100644 --- a/chrome/browser/chromeos/status/input_method_menu.cc +++ b/chrome/browser/chromeos/status/input_method_menu.cc @@ -15,9 +15,9 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/language_preferences.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/chromeos/system_key_event_listener.cc b/chrome/browser/chromeos/system_key_event_listener.cc index fa056bd..5fa6a50 100644 --- a/chrome/browser/chromeos/system_key_event_listener.cc +++ b/chrome/browser/chromeos/system_key_event_listener.cc @@ -10,7 +10,7 @@ #include "chrome/browser/chromeos/audio_handler.h" #include "chrome/browser/chromeos/brightness_bubble.h" #include "chrome/browser/chromeos/volume_bubble.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" namespace chromeos { diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc index 841b281..acf4e91 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc @@ -11,7 +11,6 @@ #include "base/command_line.h" #include "chrome/browser/content_settings/content_settings_details.h" #include "chrome/browser/content_settings/content_settings_pattern.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" @@ -19,6 +18,7 @@ #include "chrome/common/content_settings.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 5dc96e9..09f4f5c 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -11,7 +11,6 @@ #include "chrome/browser/content_settings/content_settings_policy_provider.h" #include "chrome/browser/content_settings/content_settings_pref_provider.h" #include "chrome/browser/content_settings/content_settings_provider.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" @@ -19,6 +18,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc index f490882..7e15cbd 100644 --- a/chrome/browser/download/download_shelf.cc +++ b/chrome/browser/download/download_shelf.cc @@ -9,9 +9,9 @@ #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ui/webui/downloads_ui.h" #include "chrome/common/url_constants.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc index efca9b6..6e4758d 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.cc +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -45,7 +45,6 @@ #include "chrome/browser/extensions/extension_webstore_private_api.h" #include "chrome/browser/extensions/extensions_quota_service.h" #include "chrome/browser/external_protocol_handler.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" @@ -56,6 +55,7 @@ #include "content/browser/child_process_security_policy.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/result_codes.h" #include "ipc/ipc_message.h" diff --git a/chrome/browser/extensions/extension_metrics_module.cc b/chrome/browser/extensions/extension_metrics_module.cc index 9681d84..8e3428d 100644 --- a/chrome/browser/extensions/extension_metrics_module.cc +++ b/chrome/browser/extensions/extension_metrics_module.cc @@ -7,9 +7,9 @@ #include "base/metrics/histogram.h" #include "base/values.h" #include "chrome/common/extensions/extension.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ui/options/options_util.h" #include "chrome/installer/util/google_update_settings.h" +#include "content/browser/user_metrics.h" using base::Histogram; using base::LinearHistogram; @@ -57,7 +57,7 @@ bool MetricsRecordUserActionFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &name)); name = BuildMetricName(name, GetExtension()); - UserMetrics::RecordComputedAction(name, profile()); + UserMetrics::RecordComputedAction(name); return true; } diff --git a/chrome/browser/extensions/file_manager_util.cc b/chrome/browser/extensions/file_manager_util.cc index e838f16..bf831a5 100644 --- a/chrome/browser/extensions/file_manager_util.cc +++ b/chrome/browser/extensions/file_manager_util.cc @@ -7,10 +7,10 @@ #include "base/logging.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "content/browser/user_metrics.h" #include "third_party/libjingle/source/talk/base/urlencode.h" #include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/file_system_mount_point_provider.h" @@ -70,7 +70,7 @@ GURL FileManagerUtil::GetFileBrowserUrlWithParams( } // static -void FileManagerUtil::ShowFullTabUrl(Profile* profile, +void FileManagerUtil::ShowFullTabUrl(Profile*, const FilePath& default_path) { std::string json = GetArgumentsJson(SelectFileDialog::SELECT_NONE, string16(), default_path, NULL, 0, FilePath::StringType()); @@ -80,8 +80,7 @@ void FileManagerUtil::ShowFullTabUrl(Profile* profile, if (!browser) return; - UserMetrics::RecordAction(UserMetricsAction("ShowFileBrowserFullTab"), - profile); + UserMetrics::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); browser->ShowSingletonTab(GURL(url)); } diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 243732f..f06f707 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -18,7 +18,6 @@ #include "chrome/browser/importer/importer_list.h" #include "chrome/browser/importer/importer_progress_dialog.h" #include "chrome/browser/importer/importer_progress_observer.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/process_singleton.h" #include "chrome/browser/profiles/profile_manager.h" @@ -30,6 +29,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 "googleurl/src/gurl.h" #if defined(OS_WIN) diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 67e2918..c678510 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -35,6 +35,7 @@ #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/shell_util.h" #include "chrome/installer/util/util_constants.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/result_codes.h" #include "google_update_idl.h" diff --git a/chrome/browser/language_combobox_model.cc b/chrome/browser/language_combobox_model.cc index 54e67e1..1395897 100644 --- a/chrome/browser/language_combobox_model.cc +++ b/chrome/browser/language_combobox_model.cc @@ -9,9 +9,9 @@ #include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "unicode/uloc.h" diff --git a/chrome/browser/metrics/user_metrics.cc b/chrome/browser/metrics/user_metrics.cc deleted file mode 100644 index fadda77..0000000 --- a/chrome/browser/metrics/user_metrics.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/metrics/user_metrics.h" - -#include "chrome/browser/profiles/profile.h" -#include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" - -void UserMetrics::RecordAction(const UserMetricsAction& action, - Profile* profile) { - Record(action.str_, profile); -} - -void UserMetrics::RecordComputedAction(const std::string& action, - Profile* profile) { - Record(action.c_str(), profile); -} - -void UserMetrics::Record(const char *action, Profile *profile) { - Record(action); -} - -void UserMetrics::RecordAction(const UserMetricsAction& action) { - Record(action.str_); -} - -void UserMetrics::RecordComputedAction(const std::string& action) { - Record(action.c_str()); -} - -void UserMetrics::Record(const char *action) { - if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableFunction(&UserMetrics::CallRecordOnUI, action)); - return; - } - - NotificationService::current()->Notify(NotificationType::USER_ACTION, - NotificationService::AllSources(), - Details<const char*>(&action)); -} - -void UserMetrics::CallRecordOnUI(const std::string& action) { - Record(action.c_str()); -} diff --git a/chrome/browser/metrics/user_metrics.h b/chrome/browser/metrics/user_metrics.h deleted file mode 100644 index 1c992ac..0000000 --- a/chrome/browser/metrics/user_metrics.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_METRICS_USER_METRICS_H_ -#define CHROME_BROWSER_METRICS_USER_METRICS_H_ -#pragma once - -#include <string> - -class Profile; - -// This module provides some helper functions for logging actions tracked by -// the user metrics system. - - -// UserMetricsAction exist purely to standardize on the paramters passed to -// UserMetrics. That way, our toolset can scan the sourcecode reliable for -// constructors and extract the associated string constants -struct UserMetricsAction { - const char* str_; - explicit UserMetricsAction(const char* str) : str_(str) {} -}; - - -class UserMetrics { - public: - // Record that the user performed an action. - // "Action" here means a user-generated event: - // good: "Reload", "CloseTab", and "IMEInvoked" - // not good: "SSLDialogShown", "PageLoaded", "DiskFull" - // We use this to gather anonymized information about how users are - // interacting with the browser. - // WARNING: Call this function exactly like this: - // UserMetrics::RecordAction(UserMetricsAction("foo bar")); - // (all on one line and with the metric string literal [no variables]) - // because otherwise our processing scripts won't pick up on new actions. - // - // Once a new recorded action is added, run chrome/tools/extract_actions.py - // to generate a new mapping of [action hashes -> metric names] and send it - // out for review to be updated. - // - // For more complicated situations (like when there are many different - // possible actions), see RecordComputedAction. - // - // TODO(semenzato): |profile| isn't actually used---should switch all calls - // to the version without it. - static void RecordAction(const UserMetricsAction& action, Profile* profile); - - // This function has identical input and behavior to RecordAction, but is - // not automatically found by the action-processing scripts. It can be used - // when it's a pain to enumerate all possible actions, but if you use this - // you need to also update the rules for extracting known actions in - // chrome/tools/extract_actions.py. - static void RecordComputedAction(const std::string& action, - Profile* profile); - - static void RecordAction(const UserMetricsAction& action); - static void RecordComputedAction(const std::string& action); - - private: - static void Record(const char *action, Profile *profile); - static void Record(const char *action); - static void CallRecordOnUI(const std::string& action); -}; - -#endif // CHROME_BROWSER_METRICS_USER_METRICS_H_ diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index 6860b13..b5dc14c 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -9,13 +9,13 @@ #include "base/stl_util-inl.h" #include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/password_manager/password_form_manager.h" #include "chrome/browser/password_manager/password_manager_delegate.h" #include "chrome/browser/prefs/pref_service.h" #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/common/view_messages.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/pdf_unsupported_feature.cc b/chrome/browser/pdf_unsupported_feature.cc index 7db02605..6c81def 100644 --- a/chrome/browser/pdf_unsupported_feature.cc +++ b/chrome/browser/pdf_unsupported_feature.cc @@ -7,7 +7,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/version.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" @@ -19,6 +18,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/interstitial_page.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc index a985f8f..248cf478 100644 --- a/chrome/browser/plugin_observer.cc +++ b/chrome/browser/plugin_observer.cc @@ -7,7 +7,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/plugin_installer_infobar_delegate.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" @@ -16,6 +15,7 @@ #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/common/view_messages.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 96c1487..92e7630 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -40,7 +40,6 @@ #include "chrome/browser/history/history.h" #include "chrome/browser/history/top_sites.h" #include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/net/gaia/token_service.h" #include "chrome/browser/net/net_pref_observer.h" @@ -93,6 +92,7 @@ #include "content/browser/host_zoom_map.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/renderer_host/render_process_host.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/browser_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 70d1ac5..8c09472 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -16,7 +16,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/malware_details.h" @@ -30,6 +29,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 "grit/browser_resources.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 2a9d74c..5952fdb3 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -9,12 +9,12 @@ #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/search_engines/search_engine_type.h" #include "chrome/browser/search_engines/search_terms_data.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/common/url_constants.h" #include "chrome/installer/util/google_update_settings.h" +#include "content/browser/user_metrics.h" #include "net/base/escape.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/favicon_size.h" diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index c7b4e5e..625a8f1 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -26,7 +26,6 @@ #include "chrome/browser/download/save_package.h" #include "chrome/browser/extensions/extension_event_router.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/browser_url_util.h" #include "chrome/browser/page_info_window.h" #include "chrome/browser/platform_util.h" @@ -54,6 +53,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "net/base/escape.h" #include "net/url_request/url_request.h" @@ -1259,11 +1259,9 @@ void RenderViewContextMenu::ExecuteCommand(int id) { case IDC_CONTENT_CONTEXT_PLAYPAUSE: { bool play = !!(params_.media_flags & WebContextMenuData::MediaPaused); if (play) { - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Play"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Play")); } else { - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Pause"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Pause")); } MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( @@ -1274,11 +1272,9 @@ void RenderViewContextMenu::ExecuteCommand(int id) { case IDC_CONTENT_CONTEXT_MUTE: { bool mute = !(params_.media_flags & WebContextMenuData::MediaMuted); if (mute) { - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Mute"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Mute")); } else { - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Unmute"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Unmute")); } MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( @@ -1287,8 +1283,7 @@ void RenderViewContextMenu::ExecuteCommand(int id) { } case IDC_CONTENT_CONTEXT_LOOP: - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Loop"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Loop")); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Loop, @@ -1296,8 +1291,7 @@ void RenderViewContextMenu::ExecuteCommand(int id) { break; case IDC_CONTENT_CONTEXT_CONTROLS: - UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Controls"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("MediaContextMenu_Controls")); MediaPlayerActionAt( gfx::Point(params_.x, params_.y), WebMediaPlayerAction( @@ -1571,8 +1565,7 @@ void RenderViewContextMenu::CopyImageAt(int x, int y) { } void RenderViewContextMenu::Inspect(int x, int y) { - UserMetrics::RecordAction(UserMetricsAction("DevTools_InspectElement"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("DevTools_InspectElement")); DevToolsManager::GetInstance()->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 7acb656c5..fa632af 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -17,7 +17,6 @@ #include "chrome/browser/defaults.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_helper.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/tab_restore_service.h" #include "chrome/browser/tabs/tab_strip_model_delegate.h" @@ -30,6 +29,7 @@ #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/common/notification_service.h" namespace { @@ -794,14 +794,12 @@ void TabStripModel::ExecuteContextMenuCommand( DCHECK(command_id > CommandFirst && command_id < CommandLast); switch (command_id) { case CommandNewTab: - UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_NewTab"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_NewTab")); delegate()->AddBlankTabAt(context_index + 1, true); break; case CommandReload: { - UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Reload"), - profile_); + UserMetrics::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]); @@ -814,8 +812,7 @@ void TabStripModel::ExecuteContextMenuCommand( } case CommandDuplicate: { - UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_Duplicate")); std::vector<int> indices = GetIndicesForCommand(context_index); // Copy the TabContents off as the indices will change as tabs are // duplicated. @@ -831,8 +828,7 @@ void TabStripModel::ExecuteContextMenuCommand( } case CommandCloseTab: { - UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_CloseTab"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_CloseTab")); std::vector<int> indices = GetIndicesForCommand(context_index); // Copy the TabContents off as the indices will change as we remove // things. @@ -851,8 +847,7 @@ void TabStripModel::ExecuteContextMenuCommand( case CommandCloseOtherTabs: { UserMetrics::RecordAction( - UserMetricsAction("TabContextMenu_CloseOtherTabs"), - profile_); + UserMetricsAction("TabContextMenu_CloseOtherTabs")); InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id), CLOSE_CREATE_HISTORICAL_TAB); break; @@ -860,24 +855,21 @@ void TabStripModel::ExecuteContextMenuCommand( case CommandCloseTabsToRight: { UserMetrics::RecordAction( - UserMetricsAction("TabContextMenu_CloseTabsToRight"), - profile_); + UserMetricsAction("TabContextMenu_CloseTabsToRight")); InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id), CLOSE_CREATE_HISTORICAL_TAB); break; } case CommandRestoreTab: { - UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab")); delegate_->RestoreTab(); break; } case CommandTogglePinned: { UserMetrics::RecordAction( - UserMetricsAction("TabContextMenu_TogglePinned"), - profile_); + UserMetricsAction("TabContextMenu_TogglePinned")); std::vector<int> indices = GetIndicesForCommand(context_index); bool pin = WillContextMenuPin(context_index); if (pin) { @@ -898,8 +890,7 @@ void TabStripModel::ExecuteContextMenuCommand( case CommandBookmarkAllTabs: { UserMetrics::RecordAction( - UserMetricsAction("TabContextMenu_BookmarkAllTabs"), - profile_); + UserMetricsAction("TabContextMenu_BookmarkAllTabs")); delegate_->BookmarkAllTabs(); break; @@ -907,8 +898,7 @@ void TabStripModel::ExecuteContextMenuCommand( case CommandUseVerticalTabs: { UserMetrics::RecordAction( - UserMetricsAction("TabContextMenu_UseVerticalTabs"), - profile_); + UserMetricsAction("TabContextMenu_UseVerticalTabs")); delegate()->ToggleUseVerticalTabs(); break; diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index a23a013..361bf6e 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc @@ -8,11 +8,11 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/browser_theme_pack.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "grit/app_resources.h" @@ -314,7 +314,7 @@ void ThemeService::SetTheme(const Extension* extension) { SaveThemeID(extension->id()); NotifyThemeChanged(); - UserMetrics::RecordAction(UserMetricsAction("Themes_Installed"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Themes_Installed")); } void ThemeService::RemoveUnusedThemes() { @@ -339,7 +339,7 @@ void ThemeService::RemoveUnusedThemes() { void ThemeService::UseDefaultTheme() { ClearAllThemeData(); NotifyThemeChanged(); - UserMetrics::RecordAction(UserMetricsAction("Themes_Reset"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Themes_Reset")); } void ThemeService::SetNativeTheme() { @@ -576,7 +576,7 @@ void ThemeService::LoadThemePrefs() { } if (loaded_pack) { - UserMetrics::RecordAction(UserMetricsAction("Themes.Loaded"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Themes.Loaded")); } else { // TODO(erg): We need to pop up a dialog informing the user that their // theme is being migrated. @@ -587,12 +587,11 @@ void ThemeService::LoadThemePrefs() { if (extension) { DLOG(ERROR) << "Migrating theme"; BuildFromExtension(extension); - UserMetrics::RecordAction(UserMetricsAction("Themes.Migrated"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("Themes.Migrated")); } else { DLOG(ERROR) << "Theme is mysteriously gone."; ClearAllThemeData(); - UserMetrics::RecordAction(UserMetricsAction("Themes.Gone"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Themes.Gone")); } } } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index eacaa70..20bea8e 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -53,7 +53,6 @@ #include "chrome/browser/google/google_util.h" #include "chrome/browser/instant/instant_controller.h" #include "chrome/browser/instant/instant_unload_handler.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/browser_url_util.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/notifications/notification_ui_manager.h" @@ -112,6 +111,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/common/notification_service.h" #include "content/common/page_transition_types.h" #include "grit/chromium_strings.h" @@ -1275,7 +1275,7 @@ bool Browser::IsClosingPermitted() { } void Browser::GoBack(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(UserMetricsAction("Back"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Back")); TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper(); if (current_tab->controller().CanGoBack()) { @@ -1290,18 +1290,18 @@ void Browser::GoBack(WindowOpenDisposition disposition) { } void Browser::GoForward(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(UserMetricsAction("Forward"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Forward")); if (GetSelectedTabContentsWrapper()->controller().CanGoForward()) GetOrCloneTabForDisposition(disposition)->controller().GoForward(); } void Browser::Reload(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(UserMetricsAction("Reload"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Reload")); ReloadInternal(disposition, false); } void Browser::ReloadIgnoringCache(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(UserMetricsAction("ReloadIgnoringCache"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ReloadIgnoringCache")); ReloadInternal(disposition, true); } @@ -1327,12 +1327,12 @@ void Browser::ReloadInternal(WindowOpenDisposition disposition, } void Browser::Home(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(UserMetricsAction("Home"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Home")); OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK); } void Browser::OpenCurrentURL() { - UserMetrics::RecordAction(UserMetricsAction("LoadURL"), profile_); + UserMetrics::RecordAction(UserMetricsAction("LoadURL")); LocationBar* location_bar = window_->GetLocationBar(); if (!location_bar) return; @@ -1373,7 +1373,7 @@ void Browser::OpenCurrentURL() { } void Browser::Stop() { - UserMetrics::RecordAction(UserMetricsAction("Stop"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Stop")); GetSelectedTabContentsWrapper()->tab_contents()->Stop(); } @@ -1384,7 +1384,7 @@ void Browser::NewWindow() { NewIncognitoWindow(); return; } - UserMetrics::RecordAction(UserMetricsAction("NewWindow"), profile_); + UserMetrics::RecordAction(UserMetricsAction("NewWindow")); SessionService* session_service = profile_->GetOriginalProfile()->GetSessionService(); if (!session_service || @@ -1399,17 +1399,17 @@ void Browser::NewIncognitoWindow() { return; } - UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow"), profile_); + UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow")); Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile()); } void Browser::CloseWindow() { - UserMetrics::RecordAction(UserMetricsAction("CloseWindow"), profile_); + UserMetrics::RecordAction(UserMetricsAction("CloseWindow")); window_->Close(); } void Browser::NewTab() { - UserMetrics::RecordAction(UserMetricsAction("NewTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("NewTab")); if (type() == TYPE_NORMAL) { AddBlankTab(true); @@ -1426,19 +1426,18 @@ void Browser::NewTab() { } void Browser::CloseTab() { - UserMetrics::RecordAction(UserMetricsAction("CloseTab_Accelerator"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("CloseTab_Accelerator")); if (CanCloseTab()) tab_handler_->GetTabStripModel()->CloseSelectedTabs(); } void Browser::SelectNextTab() { - UserMetrics::RecordAction(UserMetricsAction("SelectNextTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("SelectNextTab")); tab_handler_->GetTabStripModel()->SelectNextTab(); } void Browser::SelectPreviousTab() { - UserMetrics::RecordAction(UserMetricsAction("SelectPrevTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("SelectPrevTab")); tab_handler_->GetTabStripModel()->SelectPreviousTab(); } @@ -1449,7 +1448,7 @@ void Browser::OpenTabpose() { return; } - UserMetrics::RecordAction(UserMetricsAction("OpenTabpose"), profile_); + UserMetrics::RecordAction(UserMetricsAction("OpenTabpose")); window()->OpenTabpose(); #else NOTREACHED(); @@ -1457,35 +1456,34 @@ void Browser::OpenTabpose() { } void Browser::MoveTabNext() { - UserMetrics::RecordAction(UserMetricsAction("MoveTabNext"), profile_); + UserMetrics::RecordAction(UserMetricsAction("MoveTabNext")); tab_handler_->GetTabStripModel()->MoveTabNext(); } void Browser::MoveTabPrevious() { - UserMetrics::RecordAction(UserMetricsAction("MoveTabPrevious"), profile_); + UserMetrics::RecordAction(UserMetricsAction("MoveTabPrevious")); tab_handler_->GetTabStripModel()->MoveTabPrevious(); } void Browser::SelectNumberedTab(int index) { if (index < tab_count()) { - UserMetrics::RecordAction(UserMetricsAction("SelectNumberedTab"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("SelectNumberedTab")); tab_handler_->GetTabStripModel()->ActivateTabAt(index, true); } } void Browser::SelectLastTab() { - UserMetrics::RecordAction(UserMetricsAction("SelectLastTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("SelectLastTab")); tab_handler_->GetTabStripModel()->SelectLastTab(); } void Browser::DuplicateTab() { - UserMetrics::RecordAction(UserMetricsAction("Duplicate"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Duplicate")); DuplicateContentsAt(active_index()); } void Browser::RestoreTab() { - UserMetrics::RecordAction(UserMetricsAction("RestoreTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("RestoreTab")); TabRestoreService* service = profile_->GetTabRestoreService(); if (!service) return; @@ -1509,7 +1507,7 @@ void Browser::WriteCurrentURLToClipboard() { } void Browser::ConvertPopupToTabbedBrowser() { - UserMetrics::RecordAction(UserMetricsAction("ShowAsTab"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowAsTab")); int tab_strip_index = tab_handler_->GetTabStripModel()->active_index(); TabContentsWrapper* contents = tab_handler_->GetTabStripModel()->DetachTabContentsAt(tab_strip_index); @@ -1527,7 +1525,7 @@ void Browser::ToggleFullscreenMode() { return; #endif - UserMetrics::RecordAction(UserMetricsAction("ToggleFullscreen"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ToggleFullscreen")); window_->SetFullscreen(!window_->IsFullscreen()); // On Linux, setting fullscreen mode is an async call to the X server, which // may or may not support fullscreen mode. @@ -1566,7 +1564,7 @@ void Browser::ShowKeyboardOverlay() { #endif void Browser::Exit() { - UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Exit")); #if defined(OS_CHROMEOS) chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); // Write /tmp/uptime-logout-started as well. @@ -1589,7 +1587,7 @@ void Browser::Exit() { } void Browser::BookmarkCurrentPage() { - UserMetrics::RecordAction(UserMetricsAction("Star"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Star")); BookmarkModel* model = profile()->GetBookmarkModel(); if (!model || !model->IsLoaded()) @@ -1616,10 +1614,10 @@ void Browser::BookmarkCurrentPage() { } void Browser::SavePage() { - UserMetrics::RecordAction(UserMetricsAction("SavePage"), profile_); + UserMetrics::RecordAction(UserMetricsAction("SavePage")); TabContents* current_tab = GetSelectedTabContents(); if (current_tab && current_tab->contents_mime_type() == "application/pdf") - UserMetrics::RecordAction(UserMetricsAction("PDF.SavePage"), profile_); + UserMetrics::RecordAction(UserMetricsAction("PDF.SavePage")); GetSelectedTabContentsWrapper()->download_tab_helper()->OnSavePage(); } @@ -1640,12 +1638,12 @@ bool Browser::CanSupportWindowFeature(WindowFeature feature) const { } void Browser::EmailPageLocation() { - UserMetrics::RecordAction(UserMetricsAction("EmailPageLocation"), profile_); + UserMetrics::RecordAction(UserMetricsAction("EmailPageLocation")); GetSelectedTabContents()->EmailPageLocation(); } void Browser::Print() { - UserMetrics::RecordAction(UserMetricsAction("PrintPreview"), profile_); + UserMetrics::RecordAction(UserMetricsAction("PrintPreview")); if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePrintPreview)) { printing::PrintPreviewTabController::PrintPreview( @@ -1656,7 +1654,7 @@ void Browser::Print() { } void Browser::ToggleEncodingAutoDetect() { - UserMetrics::RecordAction(UserMetricsAction("AutoDetectChange"), profile_); + UserMetrics::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. @@ -1670,7 +1668,7 @@ void Browser::ToggleEncodingAutoDetect() { } void Browser::OverrideEncoding(int encoding_id) { - UserMetrics::RecordAction(UserMetricsAction("OverrideEncoding"), profile_); + UserMetrics::RecordAction(UserMetricsAction("OverrideEncoding")); const std::string selected_encoding = CharacterEncoding::GetCanonicalEncodingNameByCommandId(encoding_id); TabContents* contents = GetSelectedTabContents(); @@ -1688,32 +1686,32 @@ void Browser::OverrideEncoding(int encoding_id) { } void Browser::Cut() { - UserMetrics::RecordAction(UserMetricsAction("Cut"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Cut")); window()->Cut(); } void Browser::Copy() { - UserMetrics::RecordAction(UserMetricsAction("Copy"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Copy")); window()->Copy(); } void Browser::Paste() { - UserMetrics::RecordAction(UserMetricsAction("Paste"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Paste")); window()->Paste(); } void Browser::Find() { - UserMetrics::RecordAction(UserMetricsAction("Find"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Find")); FindInPage(false, false); } void Browser::FindNext() { - UserMetrics::RecordAction(UserMetricsAction("FindNext"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FindNext")); FindInPage(true, true); } void Browser::FindPrevious() { - UserMetrics::RecordAction(UserMetricsAction("FindPrevious"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FindPrevious")); FindInPage(true, false); } @@ -1724,56 +1722,54 @@ void Browser::Zoom(PageZoom::Function zoom_function) { UserMetricsAction("ZoomPlus") }; - UserMetrics::RecordAction(kActions[zoom_function - PageZoom::ZOOM_OUT], - profile_); + UserMetrics::RecordAction(kActions[zoom_function - PageZoom::ZOOM_OUT]); TabContentsWrapper* tab_contents = GetSelectedTabContentsWrapper(); tab_contents->render_view_host()->Zoom(zoom_function); } void Browser::FocusToolbar() { - UserMetrics::RecordAction(UserMetricsAction("FocusToolbar"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusToolbar")); window_->FocusToolbar(); } void Browser::FocusAppMenu() { - UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu")); window_->FocusAppMenu(); } void Browser::FocusLocationBar() { - UserMetrics::RecordAction(UserMetricsAction("FocusLocation"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusLocation")); window_->SetFocusToLocationBar(true); } void Browser::FocusBookmarksToolbar() { - UserMetrics::RecordAction(UserMetricsAction("FocusBookmarksToolbar"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusBookmarksToolbar")); window_->FocusBookmarksToolbar(); } void Browser::FocusChromeOSStatus() { - UserMetrics::RecordAction(UserMetricsAction("FocusChromeOSStatus"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusChromeOSStatus")); window_->FocusChromeOSStatus(); } void Browser::FocusNextPane() { - UserMetrics::RecordAction(UserMetricsAction("FocusNextPane"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusNextPane")); window_->RotatePaneFocus(true); } void Browser::FocusPreviousPane() { - UserMetrics::RecordAction(UserMetricsAction("FocusPreviousPane"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusPreviousPane")); window_->RotatePaneFocus(false); } void Browser::FocusSearch() { // TODO(beng): replace this with FocusLocationBar - UserMetrics::RecordAction(UserMetricsAction("FocusSearch"), profile_); + UserMetrics::RecordAction(UserMetricsAction("FocusSearch")); window_->GetLocationBar()->FocusSearch(); } void Browser::OpenFile() { - UserMetrics::RecordAction(UserMetricsAction("OpenFile"), profile_); + UserMetrics::RecordAction(UserMetricsAction("OpenFile")); #if defined(OS_CHROMEOS) && !defined(FILE_MANAGER_EXTENSION) FileBrowseUI::OpenPopup(profile_, "", @@ -1796,7 +1792,7 @@ void Browser::OpenFile() { } void Browser::OpenCreateShortcutsDialog() { - UserMetrics::RecordAction(UserMetricsAction("CreateShortcut"), profile_); + UserMetrics::RecordAction(UserMetricsAction("CreateShortcut")); #if defined(OS_WIN) || defined(OS_LINUX) TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper(); DCHECK(current_tab && @@ -1831,13 +1827,13 @@ void Browser::ToggleDevToolsWindow(DevToolsToggleAction action) { uma_string = "DevTools_ToggleWindow"; break; } - UserMetrics::RecordAction(UserMetricsAction(uma_string.c_str()), profile_); + UserMetrics::RecordAction(UserMetricsAction(uma_string.c_str())); DevToolsManager::GetInstance()->ToggleDevToolsWindow( GetSelectedTabContentsWrapper()->render_view_host(), action); } void Browser::OpenTaskManager(bool highlight_background_resources) { - UserMetrics::RecordAction(UserMetricsAction("TaskManager"), profile_); + UserMetrics::RecordAction(UserMetricsAction("TaskManager")); if (highlight_background_resources) window_->ShowBackgroundPages(); else @@ -1845,17 +1841,17 @@ void Browser::OpenTaskManager(bool highlight_background_resources) { } void Browser::OpenBugReportDialog() { - UserMetrics::RecordAction(UserMetricsAction("ReportBug"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ReportBug")); browser::ShowHtmlBugReportView(this); } void Browser::ToggleBookmarkBar() { - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarksBar"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarksBar")); window_->ToggleBookmarkBar(); } void Browser::OpenBookmarkManager() { - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); ShowBookmarkManagerTab(); } @@ -1865,17 +1861,17 @@ void Browser::ShowAppMenu() { } void Browser::ShowBookmarkManagerTab() { - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarks")); ShowSingletonTab(GURL(chrome::kChromeUIBookmarksURL)); } void Browser::ShowHistoryTab() { - UserMetrics::RecordAction(UserMetricsAction("ShowHistory"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); ShowSingletonTab(GURL(chrome::kChromeUIHistoryURL)); } void Browser::ShowDownloadsTab() { - UserMetrics::RecordAction(UserMetricsAction("ShowDownloads"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowDownloads")); if (window()) { DownloadShelf* shelf = window()->GetDownloadShelf(); if (shelf->IsShowing()) @@ -1885,17 +1881,17 @@ void Browser::ShowDownloadsTab() { } void Browser::ShowExtensionsTab() { - UserMetrics::RecordAction(UserMetricsAction("ShowExtensions"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowExtensions")); ShowSingletonTab(GURL(chrome::kChromeUIExtensionsURL)); } void Browser::ShowAboutConflictsTab() { - UserMetrics::RecordAction(UserMetricsAction("AboutConflicts"), profile_); + UserMetrics::RecordAction(UserMetricsAction("AboutConflicts")); ShowSingletonTab(GURL(chrome::kChromeUIConflictsURL)); } void Browser::ShowBrokenPageTab(TabContents* contents) { - UserMetrics::RecordAction(UserMetricsAction("ReportBug"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ReportBug")); string16 page_title = contents->GetTitle(); NavigationEntry* entry = contents->controller().GetActiveEntry(); if (!entry) @@ -1917,13 +1913,12 @@ void Browser::ShowOptionsTab(const std::string& sub_page) { } void Browser::OpenClearBrowsingDataDialog() { - UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_ShowDlg")); ShowOptionsTab(chrome::kClearBrowserDataSubPage); } void Browser::OpenOptionsDialog() { - UserMetrics::RecordAction(UserMetricsAction("ShowOptions"), profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowOptions")); GURL url(chrome::kChromeUISettingsURL); browser::NavigateParams params(GetSingletonTabNavigateParams(url)); params.path_behavior = browser::NavigateParams::IGNORE_AND_STAY_PUT; @@ -1931,13 +1926,12 @@ void Browser::OpenOptionsDialog() { } void Browser::OpenPasswordManager() { - UserMetrics::RecordAction(UserMetricsAction("Options_ShowPasswordManager"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("Options_ShowPasswordManager")); ShowOptionsTab(chrome::kPasswordManagerSubPage); } void Browser::OpenImportSettingsDialog() { - UserMetrics::RecordAction(UserMetricsAction("Import_ShowDlg"), profile_); + UserMetrics::RecordAction(UserMetricsAction("Import_ShowDlg")); ShowOptionsTab(chrome::kImportDataSubPage); } @@ -1951,7 +1945,7 @@ void Browser::OpenSyncMyBookmarksDialog() { } void Browser::OpenAboutChromeDialog() { - UserMetrics::RecordAction(UserMetricsAction("AboutChrome"), profile_); + UserMetrics::RecordAction(UserMetricsAction("AboutChrome")); #if defined(OS_CHROMEOS) ShowSingletonTab(GURL(chrome::kChromeUIAboutURL)); #else @@ -1960,7 +1954,7 @@ void Browser::OpenAboutChromeDialog() { } void Browser::OpenUpdateChromeDialog() { - UserMetrics::RecordAction(UserMetricsAction("UpdateChrome"), profile_); + UserMetrics::RecordAction(UserMetricsAction("UpdateChrome")); window_->ShowUpdateChromeDialog(); } @@ -1987,26 +1981,23 @@ void Browser::OpenAutofillHelpTabAndActivate() { } void Browser::OpenSearchEngineOptionsDialog() { - UserMetrics::RecordAction(UserMetricsAction("EditSearchEngines"), profile_); + UserMetrics::RecordAction(UserMetricsAction("EditSearchEngines")); ShowOptionsTab(chrome::kSearchEnginesSubPage); } #if defined(OS_CHROMEOS) void Browser::OpenSystemOptionsDialog() { - UserMetrics::RecordAction(UserMetricsAction("OpenSystemOptionsDialog"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("OpenSystemOptionsDialog")); ShowOptionsTab(chrome::kSystemOptionsSubPage); } void Browser::OpenInternetOptionsDialog() { - UserMetrics::RecordAction(UserMetricsAction("OpenInternetOptionsDialog"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("OpenInternetOptionsDialog")); ShowOptionsTab(chrome::kInternetOptionsSubPage); } void Browser::OpenLanguageOptionsDialog() { - UserMetrics::RecordAction(UserMetricsAction("OpenLanguageOptionsDialog"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("OpenLanguageOptionsDialog")); ShowOptionsTab(chrome::kLanguageOptionsSubPage); } @@ -4419,7 +4410,7 @@ void Browser::ViewSource(TabContentsWrapper* contents) { void Browser::ViewSource(TabContentsWrapper* contents, const GURL& url, const std::string& content_state) { - UserMetrics::RecordAction(UserMetricsAction("ViewSource"), profile_); + UserMetrics::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 d83552c..d7d203e 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -12,7 +12,6 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #import "chrome/browser/themes/theme_service.h" @@ -44,6 +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 "grit/app_resources.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -753,8 +753,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"), - browser_->profile()); + UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarks")); } } @@ -762,8 +761,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"), - browser_->profile()); + UserMetrics::RecordAction(UserMetricsAction("OpenAllBookmarksNewWindow")); } } @@ -772,8 +770,7 @@ void RecordAppLaunch(Profile* profile, GURL url) { if (node) { [self openAll:node disposition:OFF_THE_RECORD]; UserMetrics::RecordAction( - UserMetricsAction("OpenAllBookmarksIncognitoWindow"), - browser_->profile()); + 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 d37a6fb..eff63db 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm @@ -5,9 +5,10 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.h" #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" -#include "chrome/browser/metrics/user_metrics.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" +#include "content/browser/user_metrics.h" + #import "third_party/mozilla/NSPasteboard+Utils.h" @implementation BookmarkBarFolderView diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm index 80935e2..0b2e979 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm @@ -5,13 +5,13 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.h" #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" -#include "chrome/browser/metrics/user_metrics.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/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" #import "third_party/mozilla/NSPasteboard+Utils.h" @interface BookmarkBarView (Private) diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm index d7f3d6c..0e9e97f 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm @@ -8,10 +8,10 @@ #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" // TODO(viettrungluu): remove #include "chrome/browser/bookmarks/bookmark_model.h" -#include "chrome/browser/metrics/user_metrics.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.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/common/notification_observer.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" @@ -252,8 +252,7 @@ void BookmarkBubbleNotificationBridge::Observe( } - (IBAction)edit:(id)sender { - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); [self showEditor]; } @@ -279,8 +278,7 @@ void BookmarkBubbleNotificationBridge::Observe( [self stopPulsingBookmarkButton]; // TODO(viettrungluu): get rid of conversion and utf_string_conversions.h. model_->SetURLStarred(node_->GetURL(), node_->GetTitle(), false); - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); node_ = NULL; // no longer valid [self ok:sender]; } @@ -298,8 +296,7 @@ void BookmarkBubbleNotificationBridge::Observe( ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject]; if ([[selected representedObject] isEqual:chooseItem]) { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_EditFromCombobox"), - model_->profile()); + UserMetricsAction("BookmarkBubble_EditFromCombobox")); [self showEditor]; } } @@ -328,8 +325,7 @@ void BookmarkBubbleNotificationBridge::Observe( if (![oldTitle isEqual:newTitle]) { model_->SetTitle(node_, base::SysNSStringToUTF16(newTitle)); UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"), - model_->profile()); + UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); } // Then the parent folder. const BookmarkNode* oldParent = node_->parent(); @@ -345,8 +341,7 @@ void BookmarkBubbleNotificationBridge::Observe( if (oldParent != newParent) { int index = newParent->child_count(); model_->Move(node_, newParent, index); - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_ChangeParent"), - model_->profile()); + UserMetrics::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 197e92f..0c7c378 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm @@ -7,11 +7,11 @@ #include "base/logging.h" #import "base/memory/scoped_nsobject.h" #include "chrome/browser/bookmarks/bookmark_model.h" -#include "chrome/browser/metrics/user_metrics.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/browser_window_controller.h" #import "chrome/browser/ui/cocoa/view_id_util.h" +#include "content/browser/user_metrics.h" // The opacity of the bookmark button drag image. static const CGFloat kDragImageOpacity = 0.7; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm index 0f21ed5..32c0e56 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm @@ -8,10 +8,10 @@ #include "base/logging.h" #include "base/sys_string_conversions.h" #import "chrome/browser/bookmarks/bookmark_model.h" -#include "chrome/browser/metrics/user_metrics.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" #import "chrome/browser/ui/cocoa/image_utils.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" 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 8ea883e..8c3043d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm @@ -10,10 +10,10 @@ #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/metrics/user_metrics.h" #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 "ui/base/text/text_elider.h" namespace { @@ -109,8 +109,7 @@ const NSUInteger kMaximumMenuPixelsWide = 300; } else { metrics_action = "OpenAllBookmarksIncognitoWindow"; } - UserMetrics::RecordAction(UserMetricsAction(metrics_action), - browser->profile()); + UserMetrics::RecordAction(UserMetricsAction(metrics_action)); } - (IBAction)openBookmarkMenuItem:(id)sender { 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 f04261d..a6556d7 100644 --- a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm @@ -8,7 +8,7 @@ #include "base/message_loop.h" #include "chrome/browser/importer/importer_host.h" #include "chrome/browser/importer/importer_lock_dialog.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 3e599f1..0a2dfaf 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -18,7 +18,6 @@ #include "chrome/browser/autocomplete/autocomplete_classifier.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/extensions/extension_tab_helper.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/debugger/devtools_window.h" @@ -52,6 +51,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/common/notification_service.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" @@ -750,10 +750,7 @@ class NotificationBridge : public NotificationObserver { if (!tabStripModel_->ContainsIndex(index)) return; - TabContentsWrapper* contents = tabStripModel_->GetTabContentsAt(index); - if (contents) - UserMetrics::RecordAction(UserMetricsAction("CloseTab_Mouse"), - contents->tab_contents()->profile()); + UserMetrics::RecordAction(UserMetricsAction("CloseTab_Mouse")); const NSInteger numberOfOpenTabs = [self numberOfOpenTabs]; if (numberOfOpenTabs > 1) { bool isClosingLastTab = index == numberOfOpenTabs - 1; @@ -1917,8 +1914,7 @@ class NotificationBridge : public NotificationObserver { // Either insert a new tab or open in a current tab. switch (disposition) { case NEW_FOREGROUND_TAB: { - UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"), - browser_->profile()); + UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); browser::NavigateParams params(browser_, *url, PageTransition::TYPED); params.disposition = disposition; params.tabstrip_index = index; @@ -1928,8 +1924,7 @@ class NotificationBridge : public NotificationObserver { break; } case CURRENT_TAB: - UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab"), - browser_->profile()); + UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); tabStripModel_->GetTabContentsAt(index) ->tab_contents()->OpenURL(*url, GURL(), CURRENT_TAB, PageTransition::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 0fd9c07..a1d6b4a 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm @@ -6,12 +6,12 @@ #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #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/common/notification_observer.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" 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 2b6b06c..b01b1b3 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc @@ -8,7 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/geolocation/geolocation_content_settings_map.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/tab_specific_content_settings.h" @@ -20,6 +19,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/common/notification_service.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc index aba739b..551aa46 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc @@ -13,7 +13,6 @@ #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ntp_background_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -39,6 +38,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/common/notification_service.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" @@ -1038,8 +1038,7 @@ void BookmarkBarGtk::OnClicked(GtkWidget* sender) { gtk_util::DispositionForCurrentButtonPressEvent(), PageTransition::AUTO_BOOKMARK); - UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"), - profile_); + UserMetrics::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 229ef43..8a7a129 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc @@ -16,11 +16,11 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_theme_service.h" #include "chrome/browser/ui/gtk/gtk_util.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -222,7 +222,7 @@ 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( - UserMetricsAction("BookmarkBubble_EditFromCombobox"), profile_); + 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 // so that GTK can unwind. Specifically gtk_menu_shell_button_release @@ -245,8 +245,7 @@ void BookmarkBubbleGtk::OnFolderPopupShown(GtkWidget* widget, } void BookmarkBubbleGtk::OnEditClicked(GtkWidget* widget) { - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); ShowEditor(); } @@ -255,8 +254,7 @@ void BookmarkBubbleGtk::OnCloseClicked(GtkWidget* widget) { } void BookmarkBubbleGtk::OnRemoveClicked(GtkWidget* widget) { - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); apply_edits_ = false; remove_bookmark_ = true; @@ -276,8 +274,7 @@ void BookmarkBubbleGtk::ApplyEdits() { if (new_title != node->GetTitle()) { model->SetTitle(node, new_title); UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"), - profile_); + UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); } int index = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_)); @@ -287,7 +284,7 @@ void BookmarkBubbleGtk::ApplyEdits() { const BookmarkNode* new_parent = folder_combo_model_->GetNodeAt(index); if (new_parent != node->parent()) { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); + 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 d9bf268..b6e02d8 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc @@ -15,7 +15,6 @@ #include "base/memory/singleton.h" #include "base/path_service.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -40,6 +39,7 @@ #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/common/notification_details.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" diff --git a/chrome/browser/ui/gtk/gtk_theme_service.cc b/chrome/browser/ui/gtk/gtk_theme_service.cc index 4ca5c9b..8aa26b3 100644 --- a/chrome/browser/ui/gtk/gtk_theme_service.cc +++ b/chrome/browser/ui/gtk/gtk_theme_service.cc @@ -12,7 +12,6 @@ #include "base/environment.h" #include "base/nix/xdg_util.h" #include "base/stl_util-inl.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/theme_service_factory.h" @@ -24,6 +23,7 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/hover_controller_gtk.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_details.h" #include "content/common/notification_service.h" #include "content/common/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 22997bf..9e6a150 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc @@ -9,8 +9,8 @@ #include "base/message_loop.h" #include "chrome/browser/importer/importer_host.h" #include "chrome/browser/importer/importer_lock_dialog.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ui/gtk/gtk_util.h" +#include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" 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 bd397f2..f409fe6 100644 --- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc +++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc @@ -6,11 +6,11 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" +#include "content/browser/user_metrics.h" #include "googleurl/src/gurl.h" EditSearchEngineController::EditSearchEngineController( @@ -101,8 +101,7 @@ void EditSearchEngineController::AcceptAddOrEdit( modifiable_url->SetURL(url_string, 0, 0); // TemplateURLModel takes ownership of template_url_. profile_->GetTemplateURLModel()->Add(modifiable_url); - UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_AddKeywordJS"), - profile_); + UserMetrics::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 0c98b0f..293ad50 100644 --- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc +++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc @@ -5,13 +5,13 @@ #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/ui/search_engines/template_url_table_model.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" KeywordEditorController::KeywordEditorController(Profile* profile) : profile_(profile) { @@ -33,8 +33,7 @@ int KeywordEditorController::AddTemplateURL(const string16& title, const std::string& url) { DCHECK(!url.empty()); - UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword")); TemplateURL* template_url = new TemplateURL(); template_url->set_short_name(title); @@ -74,8 +73,7 @@ void KeywordEditorController::ModifyTemplateURL(const TemplateURL* template_url, table_model_->ModifyTemplateURL(index, title, keyword, url); - UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword")); } bool KeywordEditorController::CanEdit(const TemplateURL* url) const { @@ -93,8 +91,7 @@ bool KeywordEditorController::CanRemove(const TemplateURL* url) const { void KeywordEditorController::RemoveTemplateURL(int index) { table_model_->Remove(index); - UserMetrics::RecordAction(UserMetricsAction("KeywordEditor_RemoveKeyword"), - profile_); + UserMetrics::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 9577003..71e78c5 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -7,7 +7,6 @@ #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" #include "base/string_number_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -16,6 +15,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 "grit/generated_resources.h" #include "grit/theme_resources.h" #include "net/base/registry_controlled_domain.h" @@ -158,14 +158,11 @@ void BackForwardMenuModel::ActivatedAt(int index) { void BackForwardMenuModel::ActivatedAtWithDisposition( int index, int disposition) { - Profile* profile = browser_->profile(); - DCHECK(!IsSeparator(index)); // Execute the command for the last item: "Show Full History". if (index == GetItemCount() - 1) { - UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1), - profile); + UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1)); browser_->ShowSingletonTab(GURL(chrome::kChromeUIHistoryURL)); return; } @@ -173,11 +170,10 @@ void BackForwardMenuModel::ActivatedAtWithDisposition( // Log whether it was a history or chapter click. if (index < GetHistoryItemCount()) { UserMetrics::RecordComputedAction( - BuildActionName("HistoryClick", index), profile); + BuildActionName("HistoryClick", index)); } else { UserMetrics::RecordComputedAction( - BuildActionName("ChapterClick", index - GetHistoryItemCount() - 1), - profile); + BuildActionName("ChapterClick", index - GetHistoryItemCount() - 1)); } int controller_index = MenuIndexToNavEntryIndex(index); @@ -188,8 +184,7 @@ void BackForwardMenuModel::ActivatedAtWithDisposition( } void BackForwardMenuModel::MenuWillShow() { - UserMetrics::RecordComputedAction(BuildActionName("Popup", -1), - browser_->profile()); + UserMetrics::RecordComputedAction(BuildActionName("Popup", -1)); requested_favicons_.clear(); load_consumer_.CancelAllRequests(); } diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 1b080e5..ae6dc40 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -18,7 +18,6 @@ #include "base/utf_string_conversions.h" #include "base/win/windows_version.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/ui/browser_list.h" @@ -28,6 +27,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/installer/util/browser_distribution.h" +#include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -711,21 +711,20 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, switch (result) { case UPGRADE_STARTED: - UserMetrics::RecordAction(UserMetricsAction("Upgrade_Started"), profile_); + UserMetrics::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"), - profile_); + UserMetrics::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( - UserMetricsAction("UpgradeCheck_UpgradeIsAvailable"), profile_); + UserMetricsAction("UpgradeCheck_UpgradeIsAvailable")); DCHECK(!google_updater_); // Should have been nulled out already. google_updater_ = new GoogleUpdate(); google_updater_->set_status_listener(this); @@ -759,7 +758,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, (installed_version->CompareTo(*running_version) <= 0)) { #endif UserMetrics::RecordAction( - UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_); + UserMetricsAction("UpgradeCheck_AlreadyUpToDate")); #if defined(OS_CHROMEOS) std::wstring update_label_text = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_UPGRADE_ALREADY_UP_TO_DATE, @@ -785,10 +784,9 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, case UPGRADE_SUCCESSFUL: { if (result == UPGRADE_ALREADY_UP_TO_DATE) UserMetrics::RecordAction( - UserMetricsAction("UpgradeCheck_AlreadyUpgraded"), profile_); + UserMetricsAction("UpgradeCheck_AlreadyUpgraded")); else - UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Upgraded"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Upgraded")); restart_button_visible_ = true; const std::wstring& update_string = UTF16ToWide(l10n_util::GetStringFUTF16( @@ -799,8 +797,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, break; } case UPGRADE_ERROR: - UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Error"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Error")); restart_button_visible_ = false; if (error_code != GOOGLE_UPDATE_DISABLED_BY_POLICY) { update_label_.SetText(UTF16ToWide( diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index 909d21b..248b76d 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -17,7 +17,6 @@ #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/sync_ui_util.h" @@ -35,6 +34,7 @@ #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/common/notification_service.h" #include "content/common/page_transition_types.h" #include "grit/app_resources.h" @@ -1082,8 +1082,7 @@ void BookmarkBarView::BookmarkNodeFaviconLoaded(BookmarkModel* model, void BookmarkBarView::WriteDragDataForView(View* sender, const gfx::Point& press_pt, ui::OSExchangeData* data) { - UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragButton"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragButton")); for (int i = 0; i < GetBookmarkButtonCount(); ++i) { if (sender == GetBookmarkButton(i)) { @@ -1203,8 +1202,7 @@ void BookmarkBarView::ButtonPressed(views::Button* sender, bookmark_utils::OpenAll(GetWindow()->GetNativeWindow(), profile_, GetPageNavigator(), node, disposition_from_event_flags); } - UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"), - profile_); + UserMetrics::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 372a471..215239a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc @@ -11,11 +11,11 @@ #include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/views/bubble/bubble.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -293,8 +293,7 @@ void BookmarkBubbleView::ButtonPressed( void BookmarkBubbleView::LinkClicked(views::Link* source, int event_flags) { DCHECK(source == remove_link_); - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar")); // Set this so we remove the bookmark after the window closes. remove_bookmark_ = true; @@ -309,7 +308,7 @@ void BookmarkBubbleView::ItemChanged(views::Combobox* combobox, int new_index) { if (new_index + 1 == parent_model_.GetItemCount()) { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_EditFromCombobox"), profile_); + UserMetricsAction("BookmarkBubble_EditFromCombobox")); ShowEditor(); return; @@ -356,8 +355,7 @@ void BookmarkBubbleView::Close() { void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { if (sender == edit_button_) { - UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit")); bubble_->set_fade_away_on_close(true); ShowEditor(); } else { @@ -426,8 +424,7 @@ void BookmarkBubbleView::ApplyEdits() { if (new_title != node->GetTitle()) { model->SetTitle(node, new_title); UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"), - profile_); + UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); } // Last index means 'Choose another folder...' if (parent_combobox_->selected_item() < @@ -436,7 +433,7 @@ void BookmarkBubbleView::ApplyEdits() { parent_model_.GetNodeAt(parent_combobox_->selected_item()); if (new_parent != node->parent()) { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); + 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 bac70d5..926f97b 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 @@ -10,11 +10,11 @@ #include "chrome/browser/bookmarks/bookmark_folder_editor_controller.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "content/browser/user_metrics.h" #include "chrome/common/pref_names.h" #include "content/browser/tab_contents/page_navigator.h" #include "grit/generated_resources.h" @@ -101,18 +101,15 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { initial_disposition = NEW_FOREGROUND_TAB; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAll"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { initial_disposition = NEW_WINDOW; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); } else { initial_disposition = OFF_THE_RECORD; UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); } bookmark_utils::OpenAll(parent_window_, profile_, navigator_, selection_, initial_disposition); @@ -122,7 +119,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_RENAME_FOLDER: case IDC_BOOKMARK_BAR_EDIT: UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Edit"), profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Edit")); if (selection_.size() != 1) { NOTREACHED(); @@ -142,7 +139,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_REMOVE: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Remove"), profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Remove")); delegate_->WillRemoveBookmarks(selection_); for (size_t i = 0; i < selection_.size(); ++i) { @@ -156,7 +153,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_Add"), profile_); + UserMetricsAction("BookmarkBar_ContextMenu_Add")); // TODO: this should honor the index from GetParentForNewNodes. BookmarkEditor::Show( @@ -168,8 +165,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { case IDC_BOOKMARK_BAR_NEW_FOLDER: { UserMetrics::RecordAction( - UserMetricsAction("BookmarkBar_ContextMenu_NewFolder"), - profile_); + UserMetricsAction("BookmarkBar_ContextMenu_NewFolder")); int index; const BookmarkNode* parent = bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); @@ -183,8 +179,7 @@ void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { break; case IDC_BOOKMARK_MANAGER: - UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("ShowBookmarkManager")); { Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser) 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 ae25ae5..5b18e08 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc @@ -9,7 +9,6 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -17,6 +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/common/page_transition_types.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" @@ -236,8 +236,7 @@ void BookmarkMenuController::WriteDragData(MenuItemView* sender, ui::OSExchangeData* data) { DCHECK(sender && data); - UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragFromFolder"), - profile_); + UserMetrics::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/file_manager_dialogs.cc b/chrome/browser/ui/views/file_manager_dialogs.cc index 59de0d5..03e37e2 100644 --- a/chrome/browser/ui/views/file_manager_dialogs.cc +++ b/chrome/browser/ui/views/file_manager_dialogs.cc @@ -5,7 +5,6 @@ #include "base/logging.h" #include "chrome/browser/extensions/extension_file_browser_private_api.h" #include "chrome/browser/extensions/file_manager_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_dialogs.h" @@ -15,6 +14,7 @@ #include "chrome/browser/ui/webui/html_dialog_ui.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "views/window/window.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index 820d27c..9851985 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -6,11 +6,11 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/first_run/first_run.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/search_engines/util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" +#include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -145,14 +145,12 @@ void FirstRunBubbleView::BubbleShown() { void FirstRunBubbleView::ButtonPressed(views::Button* sender, const views::Event& event) { - UserMetrics::RecordAction(UserMetricsAction("FirstRunBubbleView_Clicked"), - profile_); + UserMetrics::RecordAction(UserMetricsAction("FirstRunBubbleView_Clicked")); bubble_window_->set_fade_away_on_close(true); bubble_window_->Close(); if (change_button_ == sender) { UserMetrics::RecordAction( - UserMetricsAction("FirstRunBubbleView_ChangeButton"), - profile_); + UserMetricsAction("FirstRunBubbleView_ChangeButton")); Browser* browser = BrowserList::GetLastActive(); if (browser) { @@ -305,8 +303,8 @@ void FirstRunOEMBubbleView::BubbleShown() { void FirstRunOEMBubbleView::ButtonPressed(views::Button* sender, const views::Event& event) { - UserMetrics::RecordAction(UserMetricsAction("FirstRunOEMBubbleView_Clicked"), - profile_); + UserMetrics::RecordAction( + UserMetricsAction("FirstRunOEMBubbleView_Clicked")); bubble_window_->set_fade_away_on_close(true); bubble_window_->Close(); } diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 5c93bbc..dc3fe86 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -26,7 +26,6 @@ #include "chrome/browser/extensions/extension_tab_helper.h" #include "chrome/browser/extensions/extension_tts_api.h" #include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/ntp_background_util.h" #include "chrome/browser/page_info_window.h" #include "chrome/browser/prefs/pref_service.h" @@ -71,6 +70,7 @@ #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/common/notification_service.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" 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 5a28b6f9..1149ccc 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc @@ -8,7 +8,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/importer/importer_host.h" #include "chrome/browser/importer/importer_lock_dialog.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc index 1d9834d..6504ea9 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc @@ -26,13 +26,13 @@ #include "chrome/browser/autocomplete/keyword_provider.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/command_updater.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "googleurl/src/url_util.h" #include "grit/generated_resources.h" @@ -2450,12 +2450,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"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("Omnibox_DragURL")); } else { supported_modes |= DROPEFFECT_MOVE; - UserMetrics::RecordAction(UserMetricsAction("Omnibox_DragString"), - model_->profile()); + UserMetrics::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 1844f6c..b725ce0 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -7,7 +7,6 @@ #include "base/auto_reset.h" #include "base/command_line.h" #include "chrome/browser/extensions/extension_tab_helper.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" @@ -18,6 +17,7 @@ #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/common/notification_service.h" #include "views/controls/menu/menu_2.h" #include "views/widget/widget.h" @@ -282,8 +282,7 @@ void BrowserTabStripController::PerformDrop(bool drop_before, int index, const GURL& url) { if (drop_before) { - UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLBetweenTabs")); // Insert a new tab. TabContentsWrapper* contents = model_->delegate()->CreateTabContentsForURL( @@ -291,8 +290,7 @@ void BrowserTabStripController::PerformDrop(bool drop_before, model_->AddTabContents(contents, index, PageTransition::GENERATED, TabStripModel::ADD_ACTIVE); } else { - UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("Tab_DropURLOnTab")); model_->GetTabContentsAt(index)->controller().LoadURL( url, GURL(), PageTransition::GENERATED); @@ -307,8 +305,7 @@ bool BrowserTabStripController::IsCompatibleWith(BaseTabStrip* other) const { } void BrowserTabStripController::CreateNewTab() { - UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"), - model_->profile()); + UserMetrics::RecordAction(UserMetricsAction("NewTab_Button")); model_->delegate()->AddBlankTab(true); } diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 2cbfb45..72a4afc 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -10,7 +10,6 @@ #include "base/callback.h" #include "base/i18n/rtl.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/frame/browser_view.h" @@ -24,6 +23,7 @@ #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/common/notification_details.h" #include "content/common/notification_source.h" #include "grit/theme_resources.h" @@ -1239,48 +1239,41 @@ void DraggedTabController::CompleteDrag() { GetTabsMatchingDraggedContents(attached_tabstrip_)); } else { if (dock_info_.type() != DockInfo::NONE) { - Profile* profile = GetModel(source_tabstrip_)->profile(); switch (dock_info_.type()) { case DockInfo::LEFT_OF_WINDOW: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Left"), - profile); + UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Left")); break; case DockInfo::RIGHT_OF_WINDOW: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Right"), - profile); + UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Right")); break; case DockInfo::BOTTOM_OF_WINDOW: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Bottom"), - profile); + UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Bottom")); break; case DockInfo::TOP_OF_WINDOW: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Top"), - profile); + UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Top")); break; case DockInfo::MAXIMIZE: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_Maximize"), - profile); + UserMetrics::RecordAction( + UserMetricsAction("DockingWindow_Maximize")); break; case DockInfo::LEFT_HALF: - UserMetrics::RecordAction(UserMetricsAction("DockingWindow_LeftHalf"), - profile); + UserMetrics::RecordAction( + UserMetricsAction("DockingWindow_LeftHalf")); break; case DockInfo::RIGHT_HALF: UserMetrics::RecordAction( - UserMetricsAction("DockingWindow_RightHalf"), - profile); + UserMetricsAction("DockingWindow_RightHalf")); break; case DockInfo::BOTTOM_HALF: UserMetrics::RecordAction( - UserMetricsAction("DockingWindow_BottomHalf"), - profile); + UserMetricsAction("DockingWindow_BottomHalf")); break; default: diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index c0d4bdb..20c4715 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -8,7 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/accessibility/browser_accessibility_state.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -19,6 +18,7 @@ #include "chrome/browser/ui/views/event_utils.h" #include "chrome/browser/upgrade_detector.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -756,7 +756,7 @@ SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) { } else if (ShouldShowIncompatibilityWarning()) { #if defined(OS_WIN) if (!was_showing) - UserMetrics::RecordAction(UserMetricsAction("ConflictBadge"), profile_); + UserMetrics::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 9b2a2b9..d1910e2 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -9,10 +9,10 @@ #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/metrics/user_metrics.h" #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/common/notification_observer.h" #include "content/common/notification_registrar.h" #include "content/common/notification_source.h" diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc index 2d516d7..11dd833 100644 --- a/chrome/browser/ui/webui/active_downloads_ui.cc +++ b/chrome/browser/ui/webui/active_downloads_ui.cc @@ -27,7 +27,6 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" @@ -44,6 +43,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc index 5e4ac9b..d1c7d2f 100644 --- a/chrome/browser/ui/webui/conflicts_ui.cc +++ b/chrome/browser/ui/webui/conflicts_ui.cc @@ -12,12 +12,12 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/enumerate_modules_model_win.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" @@ -198,7 +198,7 @@ void ConflictsDOMHandler::Observe(NotificationType type, ConflictsUI::ConflictsUI(TabContents* contents) : WebUI(contents) { UserMetrics::RecordAction( - UserMetricsAction("ViewAboutConflicts"), contents->profile()); + UserMetricsAction("ViewAboutConflicts")); AddMessageHandler((new ConflictsDOMHandler())->Attach(this)); diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc index 5e3731b..7520933 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler.cc @@ -18,7 +18,6 @@ #include "chrome/browser/download/download_history.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/fileicon_source.h" @@ -26,6 +25,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/gfx/image.h" diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc index b21ecd5..d59bdcc 100644 --- a/chrome/browser/ui/webui/history2_ui.cc +++ b/chrome/browser/ui/webui/history2_ui.cc @@ -20,7 +20,6 @@ #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" @@ -31,6 +30,7 @@ #include "content/browser/browser_thread.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 "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index 0f6aff8..fa9a08e 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -20,7 +20,6 @@ #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" @@ -31,6 +30,7 @@ #include "content/browser/browser_thread.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 "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/webui/mediaplayer_ui.cc b/chrome/browser/ui/webui/mediaplayer_ui.cc index f8afc26..c6bfaa6 100644 --- a/chrome/browser/ui/webui/mediaplayer_ui.cc +++ b/chrome/browser/ui/webui/mediaplayer_ui.cc @@ -20,7 +20,6 @@ #include "chrome/browser/download/download_util.h" #include "chrome/browser/extensions/file_manager_util.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" @@ -35,6 +34,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/user_metrics.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/webui/most_visited_handler.cc b/chrome/browser/ui/webui/most_visited_handler.cc index 0d57872..ac81ce8 100644 --- a/chrome/browser/ui/webui/most_visited_handler.cc +++ b/chrome/browser/ui/webui/most_visited_handler.cc @@ -18,7 +18,6 @@ #include "base/values.h" #include "chrome/browser/history/page_usage_data.h" #include "chrome/browser/history/top_sites.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" @@ -29,6 +28,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" #include "googleurl/src/gurl.h" @@ -150,8 +150,7 @@ void MostVisitedHandler::HandleRemoveURLsFromBlacklist(const ListValue* args) { NOTREACHED(); return; } - UserMetrics::RecordAction(UserMetricsAction("MostVisited_UrlRemoved"), - web_ui_->GetProfile()); + UserMetrics::RecordAction(UserMetricsAction("MostVisited_UrlRemoved")); history::TopSites* ts = web_ui_->GetProfile()->GetTopSites(); if (ts) ts->RemoveBlacklistedURL(GURL(url)); @@ -159,8 +158,7 @@ void MostVisitedHandler::HandleRemoveURLsFromBlacklist(const ListValue* args) { } void MostVisitedHandler::HandleClearBlacklist(const ListValue* args) { - UserMetrics::RecordAction(UserMetricsAction("MostVisited_BlacklistCleared"), - web_ui_->GetProfile()); + UserMetrics::RecordAction(UserMetricsAction("MostVisited_BlacklistCleared")); history::TopSites* ts = web_ui_->GetProfile()->GetTopSites(); if (ts) diff --git a/chrome/browser/ui/webui/new_tab_ui.cc b/chrome/browser/ui/webui/new_tab_ui.cc index 69957fc..862cefd 100644 --- a/chrome/browser/ui/webui/new_tab_ui.cc +++ b/chrome/browser/ui/webui/new_tab_ui.cc @@ -16,7 +16,6 @@ #include "base/string_number_conversions.h" #include "base/threading/thread.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/session_types.h" @@ -43,6 +42,7 @@ #include "content/browser/browser_thread.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/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -199,7 +199,7 @@ void MetricsHandler::RegisterMessages() { void MetricsHandler::HandleMetrics(const ListValue* args) { std::string string_action = UTF16ToUTF8(ExtractStringValue(args)); - UserMetrics::RecordComputedAction(string_action, web_ui_->GetProfile()); + UserMetrics::RecordComputedAction(string_action); } void MetricsHandler::HandleLogEventTime(const ListValue* args) { diff --git a/chrome/browser/ui/webui/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp_resource_cache.cc index b3910ed..b2996c6 100644 --- a/chrome/browser/ui/webui/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp_resource_cache.cc @@ -16,7 +16,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/theme_service.h" @@ -31,6 +30,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "grit/browser_resources.h" diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc index ac183b0..becd454 100644 --- a/chrome/browser/ui/webui/options/advanced_options_handler.cc +++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc @@ -15,7 +15,6 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" @@ -31,6 +30,7 @@ #include "chrome/common/url_constants.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/common/notification_details.h" #include "content/common/notification_type.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index a6cab2e..bc53dcd 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -15,7 +15,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/custom_home_pages_table_model.h" #include "chrome/browser/instant/instant_confirm_dialog.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/pref_service.h" @@ -28,6 +27,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" 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 ba4bd8d..2186a79 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 @@ -9,7 +9,7 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/chromeos/cros_settings.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" 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 fd16d3f..dd6d929 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 @@ -12,10 +12,10 @@ #include "base/values.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/metrics/user_metrics.h" #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 "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" 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 84ee134..30a1030 100644 --- a/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc @@ -11,7 +11,7 @@ #include "chrome/browser/chromeos/cros_settings_names.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" -#include "chrome/browser/metrics/user_metrics.h" +#include "content/browser/user_metrics.h" namespace chromeos { diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc index 4193cf1..d16ee4c 100644 --- a/chrome/browser/ui/webui/options/core_options_handler.cc +++ b/chrome/browser/ui/webui/options/core_options_handler.cc @@ -12,11 +12,11 @@ #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google/google_util.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_details.h" #include "content/common/notification_type.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/ui/webui/options/language_options_handler.cc b/chrome/browser/ui/webui/options/language_options_handler.cc index f22b223..78e39c6 100644 --- a/chrome/browser/ui/webui/options/language_options_handler.cc +++ b/chrome/browser/ui/webui/options/language_options_handler.cc @@ -15,11 +15,11 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #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 "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" 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 7e2bfc0..77fa00c 100644 --- a/chrome/browser/ui/webui/options/language_options_handler_common.cc +++ b/chrome/browser/ui/webui/options/language_options_handler_common.cc @@ -14,12 +14,12 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/ui/browser_list.h" #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 "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc index 1a43e93..840f04d 100644 --- a/chrome/browser/ui/webui/options/options_ui.cc +++ b/chrome/browser/ui/webui/options/options_ui.cc @@ -17,7 +17,6 @@ #include "base/time.h" #include "base/values.h" #include "chrome/browser/browser_about_handler.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/options/about_page_handler.h" #include "chrome/browser/ui/webui/options/advanced_options_handler.h" @@ -43,6 +42,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/common/notification_type.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -147,7 +147,7 @@ bool OptionsPageUIHandler::IsEnabled() { void OptionsPageUIHandler::UserMetricsRecordAction( const UserMetricsAction& action) { - UserMetrics::RecordAction(action, web_ui_->GetProfile()); + UserMetrics::RecordAction(action); } // static diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc index 237eee1..363db95 100644 --- a/chrome/browser/ui/webui/options/personal_options_handler.cc +++ b/chrome/browser/ui/webui/options/personal_options_handler.cc @@ -16,7 +16,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "build/build_config.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sync/profile_sync_service.h" @@ -29,6 +28,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/url_constants.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/webui/shown_sections_handler.cc b/chrome/browser/ui/webui/shown_sections_handler.cc index c8811c3..7f92cdc 100644 --- a/chrome/browser/ui/webui/shown_sections_handler.cc +++ b/chrome/browser/ui/webui/shown_sections_handler.cc @@ -10,11 +10,11 @@ #include "base/command_line.h" #include "base/string_number_conversions.h" #include "base/values.h" -#include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" +#include "content/browser/user_metrics.h" #include "content/common/notification_details.h" #include "content/common/notification_type.h" @@ -30,14 +30,12 @@ void NotifySectionDisabled(int new_mode, int old_mode, Profile *profile) { if (old_had_it && !new_has_it) { UserMetrics::RecordAction( - UserMetricsAction("ShowSections_RecentSitesDisabled"), - profile); + UserMetricsAction("ShowSections_RecentSitesDisabled")); } if (new_has_it && !old_had_it) { UserMetrics::RecordAction( - UserMetricsAction("ShowSections_RecentSitesEnabled"), - profile); + UserMetricsAction("ShowSections_RecentSitesEnabled")); } } |