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

Unified Diff: ash/wm/workspace/workspace_event_handler.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
Index: ash/wm/workspace/workspace_event_handler.cc
diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc
index 828f0245c5a29500266ceb616668849c30e1f63e..f85939fb93d8ba2097f441c86fd1ebd56c1acb24 100644
--- a/ash/wm/workspace/workspace_event_handler.cc
+++ b/ash/wm/workspace/workspace_event_handler.cc
@@ -7,6 +7,7 @@
#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
+#include "ash/touch/touch_uma.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/property_util.h"
#include "ash/wm/window_util.h"
@@ -119,14 +120,21 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
if (event->type() == ui::ET_GESTURE_TAP &&
- event->details().tap_count() == 2 &&
target->delegate()->GetNonClientComponent(event->location()) ==
HTCAPTION) {
- ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
- ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
- ToggleMaximizedState(target); // |this| may be destroyed from here.
- event->StopPropagation();
- return;
+ // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap.
+ TouchUMA::GetInstance()->RecordGestureAction(
+ TouchUMA::GESTURE_FRAMEVIEW_TAP);
+
+ if (event->details().tap_count() == 2) {
+ ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
+ ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
+ TouchUMA::GetInstance()->RecordGestureAction(
+ TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP);
+ ToggleMaximizedState(target); // |this| may be destroyed from here.
+ event->StopPropagation();
+ return;
+ }
}
ToplevelWindowEventHandler::OnGestureEvent(event);
}

Powered by Google App Engine
This is Rietveld 408576698