Chromium Code Reviews| Index: ui/views/touchui/touch_selection_controller_impl.cc |
| diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc |
| index 3ed8c0b388a13f595a20c1c04366ca391c2f899e..11d6251afc0282459428b9ff627739b9710a14bb 100644 |
| --- a/ui/views/touchui/touch_selection_controller_impl.cc |
| +++ b/ui/views/touchui/touch_selection_controller_impl.cc |
| @@ -4,6 +4,7 @@ |
| #include "ui/views/touchui/touch_selection_controller_impl.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/time/time.h" |
| #include "ui/aura/client/cursor_client.h" |
| #include "ui/aura/env.h" |
| @@ -415,7 +416,9 @@ TouchSelectionControllerImpl::TouchSelectionControllerImpl( |
| client_view->GetNativeView(), |
| true)), |
| context_menu_(nullptr), |
| + command_executed_(false), |
| dragging_handle_(nullptr) { |
| + selection_start_time_ = base::TimeTicks::Now(); |
| aura::Window* client_window = client_view_->GetNativeView(); |
| client_window->AddObserver(this); |
| client_widget_ = Widget::GetTopLevelWidgetForNativeView(client_window); |
| @@ -425,6 +428,9 @@ TouchSelectionControllerImpl::TouchSelectionControllerImpl( |
| } |
| TouchSelectionControllerImpl::~TouchSelectionControllerImpl() { |
| + if (!command_executed_) { |
| + UMA_HISTOGRAM_BOOLEAN("Event.TouchSelectionEndedWithAction", false); |
|
jdduke (slow)
2015/02/09 16:10:56
So the only time there's no action is when this is
mfomitchev
2015/02/09 17:09:32
Yes and yes.
|
| + } |
| HideContextMenu(); |
| aura::Env::GetInstance()->RemovePreTargetHandler(this); |
| if (client_widget_) |
| @@ -594,6 +600,14 @@ bool TouchSelectionControllerImpl::IsCommandIdEnabled(int command_id) const { |
| void TouchSelectionControllerImpl::ExecuteCommand(int command_id, |
| int event_flags) { |
| + command_executed_ = true; |
| + UMA_HISTOGRAM_BOOLEAN("Event.TouchSelectionEndedWithAction", true); |
| + base::TimeDelta duration = base::TimeTicks::Now() - selection_start_time_; |
| + UMA_HISTOGRAM_CUSTOM_TIMES("Event.TouchSelectionDuration", |
|
jdduke (slow)
2015/02/09 16:10:56
Will this be changing in the near future when we u
mfomitchev
2015/02/09 17:09:32
Yes. The logic for command execution in the unifie
|
| + duration, |
| + base::TimeDelta::FromMilliseconds(1), |
| + base::TimeDelta::FromSeconds(60), |
| + 50); |
| HideContextMenu(); |
| client_view_->ExecuteCommand(command_id, event_flags); |
| } |