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

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: Fix tests 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
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 static_cast<aura::Window*>(nullptr),
154 false); 154 static_cast<aura::Window*>(nullptr));
sadrul 2014/12/15 17:40:46 Can you just do: mutable_touch_event = touch_event
jdduke (slow) 2014/12/15 18:37:37 Hmm, much better, I guess assignment works but not
155 gesture_provider_->OnTouchEvent(&mutable_touch_event);
156 gesture_provider_->OnSyncTouchEventAck(
157 mutable_touch_event.unique_event_id(), false);
155 ProcessGestureEvents(); 158 ProcessGestureEvents();
156 } 159 }
157 160
158 // The rest of the processing depends on what state we're in. 161 // The rest of the processing depends on what state we're in.
159 switch (state_) { 162 switch (state_) {
160 case NO_FINGERS_DOWN: 163 case NO_FINGERS_DOWN:
161 return InNoFingersDown(touch_event, rewritten_event); 164 return InNoFingersDown(touch_event, rewritten_event);
162 case SINGLE_TAP_PRESSED: 165 case SINGLE_TAP_PRESSED:
163 return InSingleTapPressed(touch_event, rewritten_event); 166 return InSingleTapPressed(touch_event, rewritten_event);
164 case SINGLE_TAP_RELEASED: 167 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); 1151 up_swipe_gestures_[4] = BindKeyEventWithFlags(VKEY_BROWSER_HOME, ui::EF_NONE);
1149 down_swipe_gestures_[4] = 1152 down_swipe_gestures_[4] =
1150 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE); 1153 BindKeyEventWithFlags(VKEY_BROWSER_REFRESH, ui::EF_NONE);
1151 } 1154 }
1152 1155
1153 float TouchExplorationController::GetSplitTapTouchSlop() { 1156 float TouchExplorationController::GetSplitTapTouchSlop() {
1154 return gesture_detector_config_.touch_slop * 3; 1157 return gesture_detector_config_.touch_slop * 3;
1155 } 1158 }
1156 1159
1157 } // namespace ui 1160 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698