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

Side by Side Diff: content/browser/renderer_host/input/touch_selection_controller.cc

Issue 482723002: Do not hide the selection handles on tap event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased my patch Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_selection_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/renderer_host/input/touch_selection_controller.h" 5 #include "content/browser/renderer_host/input/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 "third_party/WebKit/public/web/WebInputEvent.h" 9 #include "third_party/WebKit/public/web/WebInputEvent.h"
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 void TouchSelectionController::OnLongPressEvent() { 131 void TouchSelectionController::OnLongPressEvent() {
132 response_pending_input_event_ = LONG_PRESS; 132 response_pending_input_event_ = LONG_PRESS;
133 ShowSelectionHandlesAutomatically(); 133 ShowSelectionHandlesAutomatically();
134 ShowInsertionHandleAutomatically(); 134 ShowInsertionHandleAutomatically();
135 ResetCachedValuesIfInactive(); 135 ResetCachedValuesIfInactive();
136 } 136 }
137 137
138 void TouchSelectionController::OnTapEvent() { 138 void TouchSelectionController::OnTapEvent() {
139 response_pending_input_event_ = TAP; 139 response_pending_input_event_ = TAP;
140 activate_selection_automatically_ = false;
141 DeactivateSelection();
142 ShowInsertionHandleAutomatically(); 140 ShowInsertionHandleAutomatically();
143 if (selection_empty_) 141 if (selection_empty_)
144 DeactivateInsertion(); 142 DeactivateInsertion();
145 ResetCachedValuesIfInactive(); 143 ResetCachedValuesIfInactive();
146 } 144 }
147 145
148 void TouchSelectionController::HideAndDisallowShowingAutomatically() { 146 void TouchSelectionController::HideAndDisallowShowingAutomatically() {
149 response_pending_input_event_ = INPUT_EVENT_TYPE_NONE; 147 response_pending_input_event_ = INPUT_EVENT_TYPE_NONE;
150 DeactivateInsertion(); 148 DeactivateInsertion();
151 DeactivateSelection(); 149 DeactivateSelection();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 393 }
396 394
397 TouchHandle::AnimationStyle TouchSelectionController::GetAnimationStyle( 395 TouchHandle::AnimationStyle TouchSelectionController::GetAnimationStyle(
398 bool was_active) const { 396 bool was_active) const {
399 return was_active && client_->SupportsAnimation() 397 return was_active && client_->SupportsAnimation()
400 ? TouchHandle::ANIMATION_SMOOTH 398 ? TouchHandle::ANIMATION_SMOOTH
401 : TouchHandle::ANIMATION_NONE; 399 : TouchHandle::ANIMATION_NONE;
402 } 400 }
403 401
404 } // namespace content 402 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_selection_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698