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

Unified Diff: content/browser/renderer_host/input/touch_selection_controller.cc

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase by Mikhail Created 6 years, 1 month 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
Index: content/browser/renderer_host/input/touch_selection_controller.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller.cc b/content/browser/renderer_host/input/touch_selection_controller.cc
index 4c8807d0fccb149a08ab403fd83e3863cc8b521f..0d83ed8c5b905020f84425257bc966473b6ef57a 100644
--- a/content/browser/renderer_host/input/touch_selection_controller.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller.cc
@@ -46,7 +46,7 @@ TouchSelectionController::TouchSelectionController(
selection_editable_(false),
temporarily_hidden_(false) {
DCHECK(client_);
- HideAndDisallowShowingAutomatically();
+ HideAndDisallowShowingAutomatically(); // XXX: needed?
jdduke (slow) 2014/11/13 15:18:55 Probably not =/
mohsen 2015/02/22 23:23:09 Removed.
}
TouchSelectionController::~TouchSelectionController() {
@@ -203,6 +203,15 @@ bool TouchSelectionController::Animate(base::TimeTicks frame_time) {
return false;
}
+void TouchSelectionController::ActivateSelection(
+ const cc::ViewportSelectionBound& start,
+ const cc::ViewportSelectionBound& end) {
+ if (start.edge_bottom != end.edge_bottom) {
+ ShowSelectionHandlesAutomatically();
+ OnSelectionBoundsChanged(start, end);
+ }
+}
+
void TouchSelectionController::OnHandleDragBegin(const TouchHandle& handle) {
if (&handle == insertion_handle_.get()) {
client_->OnSelectionEvent(INSERTION_DRAG_STARTED, handle.position());
@@ -306,7 +315,7 @@ void TouchSelectionController::OnInsertionChanged() {
void TouchSelectionController::OnSelectionChanged() {
DeactivateInsertion();
- if (!activate_selection_automatically_)
+ if (!activate_selection_automatically_) // XXX: needed?
jdduke (slow) 2014/11/13 15:18:55 Yes, else the handles would be shown for programma
return;
const bool was_active = is_selection_active_;

Powered by Google App Engine
This is Rietveld 408576698