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

Unified Diff: chrome/browser/ui/tabs/tab_strip_model.cc

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tabs/tab_strip_model.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 802f4ee123338d4f54f3d81731459078d829cb59..98f12a0360f13128708b16566147ceae49a0c4f6 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
+#include "base/metrics/user_metrics.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/defaults.h"
@@ -26,7 +27,6 @@
#include "chrome/common/url_constants.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
using base::UserMetricsAction;
@@ -902,7 +902,7 @@ void TabStripModel::ExecuteContextMenuCommand(
DCHECK(command_id > CommandFirst && command_id < CommandLast);
switch (command_id) {
case CommandNewTab:
- content::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_NewTab"));
UMA_HISTOGRAM_ENUMERATION("Tab.NewTab",
TabStripModel::NEW_TAB_CONTEXT_MENU,
TabStripModel::NEW_TAB_ENUM_COUNT);
@@ -910,7 +910,7 @@ void TabStripModel::ExecuteContextMenuCommand(
break;
case CommandReload: {
- content::RecordAction(UserMetricsAction("TabContextMenu_Reload"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_Reload"));
std::vector<int> indices = GetIndicesForCommand(context_index);
for (size_t i = 0; i < indices.size(); ++i) {
WebContents* tab = GetWebContentsAt(indices[i]);
@@ -925,7 +925,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandDuplicate: {
- content::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_Duplicate"));
std::vector<int> indices = GetIndicesForCommand(context_index);
// Copy the WebContents off as the indices will change as tabs are
// duplicated.
@@ -941,37 +941,34 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandCloseTab: {
- content::RecordAction(UserMetricsAction("TabContextMenu_CloseTab"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_CloseTab"));
InternalCloseTabs(GetIndicesForCommand(context_index),
CLOSE_CREATE_HISTORICAL_TAB | CLOSE_USER_GESTURE);
break;
}
case CommandCloseOtherTabs: {
- content::RecordAction(
- UserMetricsAction("TabContextMenu_CloseOtherTabs"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_CloseOtherTabs"));
InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id),
CLOSE_CREATE_HISTORICAL_TAB);
break;
}
case CommandCloseTabsToRight: {
- content::RecordAction(
- UserMetricsAction("TabContextMenu_CloseTabsToRight"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_CloseTabsToRight"));
InternalCloseTabs(GetIndicesClosedByCommand(context_index, command_id),
CLOSE_CREATE_HISTORICAL_TAB);
break;
}
case CommandRestoreTab: {
- content::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_RestoreTab"));
delegate_->RestoreTab();
break;
}
case CommandTogglePinned: {
- content::RecordAction(
- UserMetricsAction("TabContextMenu_TogglePinned"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_TogglePinned"));
std::vector<int> indices = GetIndicesForCommand(context_index);
bool pin = WillContextMenuPin(context_index);
if (pin) {
@@ -990,9 +987,9 @@ void TabStripModel::ExecuteContextMenuCommand(
const std::vector<int>& indices = GetIndicesForCommand(context_index);
const bool mute = !chrome::AreAllTabsMuted(*this, indices);
if (mute)
- content::RecordAction(UserMetricsAction("TabContextMenu_MuteTabs"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_MuteTabs"));
else
- content::RecordAction(UserMetricsAction("TabContextMenu_UnmuteTabs"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_UnmuteTabs"));
for (std::vector<int>::const_iterator i = indices.begin();
i != indices.end(); ++i) {
chrome::SetTabAudioMuted(GetWebContentsAt(*i), mute,
@@ -1002,8 +999,7 @@ void TabStripModel::ExecuteContextMenuCommand(
}
case CommandBookmarkAllTabs: {
- content::RecordAction(
- UserMetricsAction("TabContextMenu_BookmarkAllTabs"));
+ base::RecordAction(UserMetricsAction("TabContextMenu_BookmarkAllTabs"));
delegate_->BookmarkAllTabs();
break;
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.cc ('k') | chrome/browser/ui/toolbar/app_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698