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

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: Moving location where x11 DragDrop drop/cancel events are logged. Changed DragDrop.X to Event.DragD… 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 | « ui/base/dragdrop/drag_drop_types.h ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8a56b8de9689f8132adc9f2190b3154f4dced4b0..49448203374729953e0630c7da9f6be50a45ccae 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_macros.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/window.h"
@@ -610,6 +611,10 @@ void DesktopDragDropClientAuraX11::OnXdndDrop(
event.set_flags(XGetModifiers());
}
+ if (!IsDragDropInProgress()) {
+ UMA_HISTOGRAM_COUNTS("Event.DragDrop.ExternalOriginDrop", 1);
+ }
+
drag_operation = delegate->OnPerformDrop(event);
}
@@ -646,6 +651,9 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop(
const gfx::Point& root_location,
int operation,
ui::DragDropTypes::DragEventSource source) {
+ UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Start", source,
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_COUNT);
+
source_current_window_ = None;
DCHECK(!g_current_drag_drop_client);
g_current_drag_drop_client = this;
@@ -699,6 +707,13 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop(
cursor_manager_->GetInitializedCursor(ui::kCursorGrabbing));
if (alive) {
+ if (negotiated_operation_ == ui::DragDropTypes::DRAG_NONE) {
+ 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);
+ }
drag_widget_.reset();
source_provider_ = NULL;
@@ -708,8 +723,11 @@ int DesktopDragDropClientAuraX11::StartDragAndDrop(
XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0));
return negotiated_operation_;
+ } else {
pkotwicz 2015/01/22 21:48:34 Nit: No need for the "else" if (alive) { ...
caelyn 2015/01/22 23:46:31 Nit addressed. Thanks for giving them! :-)
+ UMA_HISTOGRAM_ENUMERATION("Event.DragDrop.Cancel", source,
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_COUNT);
+ return ui::DragDropTypes::DRAG_NONE;
}
- return ui::DragDropTypes::DRAG_NONE;
}
void DesktopDragDropClientAuraX11::DragUpdate(aura::Window* target,
« no previous file with comments | « ui/base/dragdrop/drag_drop_types.h ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698