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

Side by Side Diff: components/html_viewer/touch_handler.cc

Issue 1463823003: Return a enumeration of the state of handling of InputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/html_viewer/touch_handler.h" 5 #include "components/html_viewer/touch_handler.h"
6 6
7 #include "components/mus/public/interfaces/input_events.mojom.h" 7 #include "components/mus/public/interfaces/input_events.mojom.h"
8 #include "third_party/WebKit/public/web/WebInputEvent.h" 8 #include "third_party/WebKit/public/web/WebInputEvent.h"
9 #include "third_party/WebKit/public/web/WebWidget.h" 9 #include "third_party/WebKit/public/web/WebWidget.h"
10 #include "ui/events/base_event_utils.h" 10 #include "ui/events/base_event_utils.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 void TouchHandler::SendMotionEventToGestureProvider() { 178 void TouchHandler::SendMotionEventToGestureProvider() {
179 ui::FilteredGestureProvider::TouchHandlingResult result = 179 ui::FilteredGestureProvider::TouchHandlingResult result =
180 gesture_provider_.OnTouchEvent(*current_motion_event_); 180 gesture_provider_.OnTouchEvent(*current_motion_event_);
181 if (!result.succeeded) 181 if (!result.succeeded)
182 return; 182 return;
183 183
184 blink::WebTouchEvent web_event = ui::CreateWebTouchEventFromMotionEvent( 184 blink::WebTouchEvent web_event = ui::CreateWebTouchEventFromMotionEvent(
185 *current_motion_event_, result.did_generate_scroll); 185 *current_motion_event_, result.did_generate_scroll);
186 gesture_provider_.OnTouchEventAck(web_event.uniqueTouchEventId, 186 gesture_provider_.OnTouchEventAck(web_event.uniqueTouchEventId,
187 web_widget_->handleInputEvent(web_event)); 187 web_widget_->handleInputEvent(web_event) !=
188 blink::WebInputEventResult::NotHandled);
188 } 189 }
189 190
190 void TouchHandler::PostProcessMotionEvent(const mus::mojom::Event& event) { 191 void TouchHandler::PostProcessMotionEvent(const mus::mojom::Event& event) {
191 switch (event.action) { 192 switch (event.action) {
192 case mus::mojom::EVENT_TYPE_POINTER_UP: { 193 case mus::mojom::EVENT_TYPE_POINTER_UP: {
193 if (event.pointer_data) { 194 if (event.pointer_data) {
194 const int index = current_motion_event_->FindPointerIndexOfId( 195 const int index = current_motion_event_->FindPointerIndexOfId(
195 event.pointer_data->pointer_id); 196 event.pointer_data->pointer_id);
196 current_motion_event_->RemovePointerAt(index); 197 current_motion_event_->RemovePointerAt(index);
197 } 198 }
198 if (current_motion_event_->GetPointerCount() == 0) 199 if (current_motion_event_->GetPointerCount() == 0)
199 current_motion_event_.reset(); 200 current_motion_event_.reset();
200 break; 201 break;
201 } 202 }
202 203
203 case mus::mojom::EVENT_TYPE_POINTER_CANCEL: 204 case mus::mojom::EVENT_TYPE_POINTER_CANCEL:
204 current_motion_event_.reset(); 205 current_motion_event_.reset();
205 break; 206 break;
206 207
207 default: 208 default:
208 break; 209 break;
209 } 210 }
210 } 211 }
211 212
212 } // namespace html_viewer 213 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | components/plugins/renderer/webview_plugin.h » ('j') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698