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