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

Side by Side Diff: ui/chromeos/touch_exploration_controller.cc

Issue 679633005: Expose native, desktop and mobile gesture detection defaults (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 6 years 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 | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/events/BUILD.gn » ('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 "ui/chromeos/touch_exploration_controller.h" 5 #include "ui/chromeos/touch_exploration_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return ui::EVENT_REWRITE_DISCARD; 142 return ui::EVENT_REWRITE_DISCARD;
143 } 143 }
144 } 144 }
145 145
146 // If the user is in a gesture state, or if there is a possiblity that the 146 // If the user is in a gesture state, or if there is a possiblity that the
147 // user will enter it in the future, we send the event to the gesture 147 // user will enter it in the future, we send the event to the gesture
148 // provider so it can keep track of the state of the fingers. When the user 148 // provider so it can keep track of the state of the fingers. When the user
149 // leaves one of these states, SET_STATE will set the gesture provider to 149 // leaves one of these states, SET_STATE will set the gesture provider to
150 // NULL. 150 // NULL.
151 if (gesture_provider_.get()) { 151 if (gesture_provider_.get()) {
152 gesture_provider_->OnTouchEvent(touch_event); 152 ui::TouchEvent mutable_touch_event = touch_event;
153 gesture_provider_->OnSyncTouchEventAck(touch_event.unique_event_id(), 153 gesture_provider_->OnTouchEvent(&mutable_touch_event);
154 false); 154 gesture_provider_->OnSyncTouchEventAck(
155 mutable_touch_event.unique_event_id(), false);
155 ProcessGestureEvents(); 156 ProcessGestureEvents();
156 } 157 }
157 158
158 // The rest of the processing depends on what state we're in. 159 // The rest of the processing depends on what state we're in.
159 switch (state_) { 160 switch (state_) {
160 case NO_FINGERS_DOWN: 161 case NO_FINGERS_DOWN:
161 return InNoFingersDown(touch_event, rewritten_event); 162 return InNoFingersDown(touch_event, rewritten_event);
162 case SINGLE_TAP_PRESSED: 163 case SINGLE_TAP_PRESSED:
163 return InSingleTapPressed(touch_event, rewritten_event); 164 return InSingleTapPressed(touch_event, rewritten_event);
164 case SINGLE_TAP_RELEASED: 165 case SINGLE_TAP_RELEASED:
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 up_swipe_gestures_[4] = BindKeyEventWithFlags(VKEY_BROWSER_HOME, ui::EF_NONE); 1149 up_swipe_gestures_[4] = BindKeyEventWithFlags(VKEY_BROWSER_HOME, ui::EF_NONE);
1149 down_swipe_gestures_[4] = 1150 down_swipe_gestures_[4] =
1150 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE); 1151 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE);
1151 } 1152 }
1152 1153
1153 float TouchExplorationController::GetSplitTapTouchSlop() { 1154 float TouchExplorationController::GetSplitTapTouchSlop() {
1154 return gesture_detector_config_.touch_slop * 3; 1155 return gesture_detector_config_.touch_slop * 3;
1155 } 1156 }
1156 1157
1157 } // namespace ui 1158 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698