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

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: Adressing nit re: unnecessary else statement 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') | no next file with comments »
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 695c7737865c0919e3f86337ba8d7f80e870aa1b..1c53068521297533c0cb5dfd9b26d33d57c38139 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_macros.h"
#include "base/run_loop.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/env.h"
@@ -159,6 +160,9 @@ int DragDropController::StartDragAndDrop(
provider->GetDragImage().size().IsEmpty())
return 0;
+ UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Start", source,
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_COUNT);
+
current_drag_event_source_ = source;
DragDropTracker* tracker =
new DragDropTracker(root_window, drag_drop_window_delegate_.get());
@@ -222,6 +226,14 @@ int DragDropController::StartDragAndDrop(
run_loop.Run();
}
+ if (drag_operation_ == 0) {
+ UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Cancel", source,
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_COUNT);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Drop", source,
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_COUNT);
+ }
+
if (!cancel_animation_.get() || !cancel_animation_->is_animating() ||
!pending_long_tap_.get()) {
// If drag cancel animation is running, this cleanup is done when the
@@ -482,9 +494,9 @@ void DragDropController::AnimationEnded(const gfx::Animation* animation) {
drag_image_.reset();
if (pending_long_tap_) {
// If not in a nested message loop, we can forward the long tap right now.
- if (!should_block_during_drag_drop_)
+ if (!should_block_during_drag_drop_) {
ForwardPendingLongTap();
- else {
+ } else {
// See comment about this in OnGestureEvent().
base::MessageLoopForUI::current()->PostTask(
FROM_HERE,
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698