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

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

Issue 613373004: Adopt ui::GestureConfiguration on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move all the methods to superclass 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 unified diff | Download patch
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/gesture_text_selector.h" 5 #include "content/browser/renderer_host/input/gesture_text_selector.h"
6 6
7 #include "ui/events/event_constants.h" 7 #include "ui/events/event_constants.h"
8 #include "ui/events/gesture_detection/gesture_config_helper.h" 8 #include "ui/events/gesture_detection/gesture_configuration.h"
9 #include "ui/events/gesture_detection/gesture_detector.h" 9 #include "ui/events/gesture_detection/gesture_detector.h"
10 #include "ui/events/gesture_detection/motion_event.h" 10 #include "ui/events/gesture_detection/motion_event.h"
11 11
12 using ui::GestureDetector; 12 using ui::GestureDetector;
13 using ui::MotionEvent; 13 using ui::MotionEvent;
14 14
15 namespace content { 15 namespace content {
16 namespace { 16 namespace {
17 scoped_ptr<GestureDetector> CreateGestureDetector( 17 scoped_ptr<GestureDetector> CreateGestureDetector(
18 ui::GestureListener* listener) { 18 ui::GestureListener* listener) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 bool GestureTextSelector::ShouldStartTextSelection(const MotionEvent& event) { 106 bool GestureTextSelector::ShouldStartTextSelection(const MotionEvent& event) {
107 DCHECK_GT(event.GetPointerCount(), 0u); 107 DCHECK_GT(event.GetPointerCount(), 0u);
108 // Currently we are supporting stylus-only cases. 108 // Currently we are supporting stylus-only cases.
109 const bool is_stylus = event.GetToolType(0) == MotionEvent::TOOL_TYPE_STYLUS; 109 const bool is_stylus = event.GetToolType(0) == MotionEvent::TOOL_TYPE_STYLUS;
110 const bool is_only_secondary_button_pressed = 110 const bool is_only_secondary_button_pressed =
111 event.GetButtonState() == MotionEvent::BUTTON_SECONDARY; 111 event.GetButtonState() == MotionEvent::BUTTON_SECONDARY;
112 return is_stylus && is_only_secondary_button_pressed; 112 return is_stylus && is_only_secondary_button_pressed;
113 } 113 }
114 114
115 } // namespace content 115 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698