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); |
} |