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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.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_aurax11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index 5bad49a3bfda60fb4783aedf8e67fcec32dd3f88..a4957cbbbf23c85b464bf8cb63fb46a839475b14 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -9,6 +9,7 @@
#include "base/event_types.h"
#include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/window.h"
@@ -417,6 +418,7 @@ DesktopDragDropClientAuraX11::DesktopDragDropClientAuraX11(
source_current_window_(None),
source_state_(SOURCE_STATE_OTHER),
drag_operation_(0),
+ current_drag_event_source_(ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE),
negotiated_operation_(ui::DragDropTypes::DRAG_NONE),
weak_ptr_factory_(this) {
// Some tests change the DesktopDragDropClientAuraX11 associated with an
@@ -645,6 +647,12 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop(
const gfx::Point& root_location,
int operation,
ui::DragDropTypes::DragEventSource source) {
+ 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);
+ }
+
source_current_window_ = None;
DCHECK(!g_current_drag_drop_client);
g_current_drag_drop_client = this;
@@ -654,6 +662,7 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop(
source_state_ = SOURCE_STATE_OTHER;
drag_operation_ = operation;
negotiated_operation_ = ui::DragDropTypes::DRAG_NONE;
+ current_drag_event_source_ = source;
const ui::OSExchangeData::Provider* provider = &data.provider();
source_provider_ = static_cast<const ui::OSExchangeDataProviderAuraX11*>(
@@ -790,6 +799,13 @@ void DesktopDragDropClientAuraX11::OnMouseReleased() {
// We have negotiated an action with the other end.
source_state_ = SOURCE_STATE_DROPPED;
+ 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);
+ }
SendXdndDrop(source_current_window_);
return;
}

Powered by Google App Engine
This is Rietveld 408576698