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/tabs | |
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/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 32 |
1 files changed, 11 insertions, 21 deletions
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; |