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

Unified Diff: ui/views/widget/desktop_aura/desktop_drop_target_win.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 | « ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_drop_target_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
index 1369b62eb799c6eebe9265d683e7558907dff198..f10fc1fc34b3b4e2573478c1710c62cb0ae84f91 100644
--- a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
@@ -4,6 +4,7 @@
#include "ui/views/widget/desktop_aura/desktop_drop_target_win.h"
+#include "base/metrics/histogram.h"
#include "base/win/win_util.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
@@ -14,6 +15,7 @@
#include "ui/wm/public/drag_drop_client.h"
#include "ui/wm/public/drag_drop_delegate.h"
+using aura::client::DragDropClient;
using aura::client::DragDropDelegate;
using ui::OSExchangeData;
using ui::OSExchangeDataProviderWin;
@@ -72,8 +74,14 @@ DWORD DesktopDropTargetWin::OnDrop(IDataObject* data_object,
scoped_ptr<ui::DropTargetEvent> event;
DragDropDelegate* delegate;
Translate(data_object, key_state, position, effect, &data, &event, &delegate);
- if (delegate)
+ if (delegate) {
drag_operation = delegate->OnPerformDrop(*event);
+ DragDropClient* client = aura::client::GetDragDropClient(root_window_);
+ if (client && !client->IsDragDropInProgress() &&
+ drag_operation != ui::DragDropTypes::DRAG_NONE) {
+ UMA_HISTOGRAM_COUNTS("Event.DragDrop.ExternalOriginDrop", 1);
+ }
+ }
if (target_window_) {
target_window_->RemoveObserver(this);
target_window_ = NULL;
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698