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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 OnSelectionChanged(); | 125 OnSelectionChanged(); |
126 return; | 126 return; |
127 } | 127 } |
128 | 128 |
129 if (start_orientation_ == TouchHandleOrientation::CENTER && | 129 if (start_orientation_ == TouchHandleOrientation::CENTER && |
130 selection_editable_) { | 130 selection_editable_) { |
131 OnInsertionChanged(); | 131 OnInsertionChanged(); |
132 return; | 132 return; |
133 } | 133 } |
134 | 134 |
135 if (start_orientation_ == TouchHandleOrientation::UNDEFINED) { | |
jdduke (slow)
2015/07/15 20:33:24
I'm confused, why would we try to activate inserti
Donn Denman
2015/07/15 20:48:03
For a tap-triggered selection there are no handles
| |
136 OnInsertionChanged(); | |
137 } | |
138 | |
135 HideAndDisallowShowingAutomatically(); | 139 HideAndDisallowShowingAutomatically(); |
136 } | 140 } |
137 | 141 |
138 bool TouchSelectionController::WillHandleTouchEvent(const MotionEvent& event) { | 142 bool TouchSelectionController::WillHandleTouchEvent(const MotionEvent& event) { |
139 if (config_.enable_longpress_drag_selection && | 143 if (config_.enable_longpress_drag_selection && |
140 longpress_drag_selector_.WillHandleTouchEvent(event)) { | 144 longpress_drag_selector_.WillHandleTouchEvent(event)) { |
141 return true; | 145 return true; |
142 } | 146 } |
143 | 147 |
144 if (active_status_ == INSERTION_ACTIVE) { | 148 if (active_status_ == INSERTION_ACTIVE) { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
588 base::TimeDelta duration = base::TimeTicks::Now() - selection_start_time_; | 592 base::TimeDelta duration = base::TimeTicks::Now() - selection_start_time_; |
589 UMA_HISTOGRAM_CUSTOM_TIMES("Event.TouchSelection.WasDraggedDuration", | 593 UMA_HISTOGRAM_CUSTOM_TIMES("Event.TouchSelection.WasDraggedDuration", |
590 duration, | 594 duration, |
591 base::TimeDelta::FromMilliseconds(500), | 595 base::TimeDelta::FromMilliseconds(500), |
592 base::TimeDelta::FromSeconds(60), | 596 base::TimeDelta::FromSeconds(60), |
593 60); | 597 60); |
594 } | 598 } |
595 } | 599 } |
596 | 600 |
597 } // namespace ui | 601 } // namespace ui |
OLD | NEW |