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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc

Issue 800183005: Adding UMA stats for dragdrop events for both touch and mouse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding UMA stats to track usage of DragAndDrop, on Chromeos, X11 and Windows. Created 5 years, 11 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: ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
index d135a8977a06f88374a331a3990b12e4922d0f54..3d1f89b955be990c63475feacf6e55c3ec6cb24c 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc
@@ -4,6 +4,7 @@
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h"
+#include "base/metrics/histogram.h"
#include "base/tracked_objects.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drag_source_win.h"
@@ -38,6 +39,12 @@ int DesktopDragDropClientWin::StartDragAndDrop(
drag_source_ = new ui::DragSourceWin;
DWORD effect;
+ if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Touch.Start", 1);
+ } else if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Mouse.Start", 1);
+ }
+
// Use task stopwatch to exclude the drag-drop time current task, if any.
tracked_objects::TaskStopwatch stopwatch;
stopwatch.Start();
@@ -51,7 +58,18 @@ int DesktopDragDropClientWin::StartDragAndDrop(
if (result != DRAGDROP_S_DROP)
effect = DROPEFFECT_NONE;
- return ui::DragDropTypes::DropEffectToDragOperation(effect);
+ ui::DragDropTypes::DragOperation drag_operation =
+ ui::DragDropTypes::DropEffectToDragOperation(effect);
+
+ if (drag_operation != ui::DragDropTypes::DRAG_NONE) {
mfomitchev 2015/01/08 23:30:59 If the operation is not NONE, shouldn't we log a c
caelyn 2015/01/12 22:43:10 If the drag_operation is DRAG_NONE, then we know t
+ if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Touch.Drop", 1);
+ } else if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Mouse.Drop", 1);
+ }
+ }
+
+ return drag_operation;
}
void DesktopDragDropClientWin::DragUpdate(aura::Window* target,

Powered by Google App Engine
This is Rietveld 408576698