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

Unified Diff: ash/drag_drop/drag_drop_controller.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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 1c7b819177667b8aec8476aee8334c61cd65f5dd..154247edc2600a1fe067fba95f1fcdb47731950e 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram.h"
#include "base/run_loop.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/env.h"
@@ -159,6 +160,12 @@ int DragDropController::StartDragAndDrop(
provider->GetDragImage().size().IsEmpty())
return 0;
+ if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Touch.Start", 1);
mfomitchev 2015/01/08 23:30:59 I think a single shared UMA_HISTOGRAM_ENUMERATION
caelyn 2015/01/12 22:43:10 I made the changes in histograms.xml and elsewhere
+ } else if (source == ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Mouse.Start", 1);
+ }
+
current_drag_event_source_ = source;
DragDropTracker* tracker =
new DragDropTracker(root_window, drag_drop_window_delegate_.get());
@@ -310,10 +317,18 @@ void DragDropController::Drop(aura::Window* target,
*drag_data_, event.location(), event.root_location(), drag_operation_);
e.set_flags(event.flags());
drag_operation_ = delegate->OnPerformDrop(e);
- if (drag_operation_ == 0)
+ if (drag_operation_ == 0) {
StartCanceledAnimation(kCancelAnimationDuration);
mfomitchev 2015/01/08 23:30:59 don't we need to log a Cancel here?
caelyn 2015/01/12 22:43:10 Done. This changes the semantics of cancel to be l
- else
+ } else {
+ if (current_drag_event_source_ ==
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Touch.Drop", 1);
+ } else if (current_drag_event_source_ ==
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Mouse.Drop", 1);
+ }
drag_image_.reset();
+ }
} else {
drag_image_.reset();
}
@@ -324,6 +339,13 @@ void DragDropController::Drop(aura::Window* target,
}
void DragDropController::DragCancel() {
+ if (current_drag_event_source_ ==
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Touch.Cancel", 1);
+ } else if (current_drag_event_source_ ==
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE) {
+ UMA_HISTOGRAM_COUNTS("DragDrop.Mouse.Cancel", 1);
+ }
DoDragCancel(kCancelAnimationDuration);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698