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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 16832003: Add UMA metrics to measure the effectiveness of views fuzzing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 7 years, 6 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
« chrome/browser/ui/views/tabs/tab.cc ('K') | « chrome/browser/ui/views/tabs/tab.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 68fede90480e98b164fbbd69695457df5428ed2a..b3f5427ed434fdf7560406e74586bb1aff3c145f 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -56,6 +56,12 @@
#include "win8/util/win8_util.h"
#endif
+#if defined(USE_ASH)
+#include "ash/touch/touch_uma.h"
+
+using ash::internal::TouchUMA;
+#endif
+
using content::UserMetricsAction;
using ui::DropTargetEvent;
@@ -1495,6 +1501,11 @@ void TabStrip::ButtonPressed(views::Button* sender, const ui::Event& event) {
UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON,
TabStripModel::NEW_TAB_ENUM_COUNT);
controller()->CreateNewTab();
+#if defined(USE_ASH)
+ if (event.type() == ui::ET_GESTURE_TAP)
+ TouchUMA::GetInstance()->RecordGestureAction(
+ TouchUMA::GESTURE_NEWTAB_TAP);
+#endif
}
}
@@ -1583,6 +1594,19 @@ void TabStrip::OnGestureEvent(ui::GestureEvent* event) {
EndDrag(END_DRAG_CANCEL);
break;
+#if defined(USE_ASH)
+ case ui::ET_GESTURE_TAP: {
+ const int active_index = controller_->GetActiveIndex();
+ DCHECK_NE(-1, active_index);
+ Tab* active_tab = tab_at(active_index);
+ TouchUMA::GestureActionType action = TouchUMA::GESTURE_TABNOSWITCH_TAP;
+ if (active_tab->tab_activated_with_last_gesture_begin())
+ action = TouchUMA::GESTURE_TABSWITCH_TAP;
+ TouchUMA::GetInstance()->RecordGestureAction(action);
+ break;
+ }
+#endif
+
default:
break;
}
« chrome/browser/ui/views/tabs/tab.cc ('K') | « chrome/browser/ui/views/tabs/tab.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698