OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/touch_selection/touch_selection_controller.h" | 5 #include "ui/touch_selection/touch_selection_controller.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 activate_insertion_automatically_ = true; | 166 activate_insertion_automatically_ = true; |
167 if (GetStartPosition() != GetEndPosition()) | 167 if (GetStartPosition() != GetEndPosition()) |
168 OnSelectionChanged(); | 168 OnSelectionChanged(); |
169 else if (start_orientation_ == TouchHandleOrientation::CENTER && | 169 else if (start_orientation_ == TouchHandleOrientation::CENTER && |
170 selection_editable_) | 170 selection_editable_) |
171 OnInsertionChanged(); | 171 OnInsertionChanged(); |
172 } | 172 } |
173 | 173 |
174 void TouchSelectionController::OnTapEvent() { | 174 void TouchSelectionController::OnTapEvent() { |
175 response_pending_input_event_ = TAP; | 175 response_pending_input_event_ = TAP; |
| 176 activate_selection_automatically_ = false; |
176 ShowInsertionHandleAutomatically(); | 177 ShowInsertionHandleAutomatically(); |
177 if (selection_empty_ && !show_on_tap_for_empty_editable_) | 178 if (selection_empty_ && !show_on_tap_for_empty_editable_) |
178 DeactivateInsertion(); | 179 DeactivateInsertion(); |
179 ResetCachedValuesIfInactive(); | 180 ResetCachedValuesIfInactive(); |
180 } | 181 } |
181 | 182 |
182 void TouchSelectionController::HideAndDisallowShowingAutomatically() { | 183 void TouchSelectionController::HideAndDisallowShowingAutomatically() { |
183 response_pending_input_event_ = INPUT_EVENT_TYPE_NONE; | 184 response_pending_input_event_ = INPUT_EVENT_TYPE_NONE; |
184 DeactivateInsertion(); | 185 DeactivateInsertion(); |
185 DeactivateSelection(); | 186 DeactivateSelection(); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 base::TimeDelta duration = base::TimeTicks::Now() - selection_start_time_; | 502 base::TimeDelta duration = base::TimeTicks::Now() - selection_start_time_; |
502 UMA_HISTOGRAM_CUSTOM_TIMES("Event.TouchSelection.WasDraggedDuration", | 503 UMA_HISTOGRAM_CUSTOM_TIMES("Event.TouchSelection.WasDraggedDuration", |
503 duration, | 504 duration, |
504 base::TimeDelta::FromMilliseconds(500), | 505 base::TimeDelta::FromMilliseconds(500), |
505 base::TimeDelta::FromSeconds(60), | 506 base::TimeDelta::FromSeconds(60), |
506 60); | 507 60); |
507 } | 508 } |
508 } | 509 } |
509 | 510 |
510 } // namespace ui | 511 } // namespace ui |
OLD | NEW |