Chromium Code Reviews| 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, |