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

Side by Side Diff: third_party/WebKit/Source/web/PageWidgetDelegate.cpp

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 void PageWidgetDelegate::paintIgnoringCompositing(Page& page, 108 void PageWidgetDelegate::paintIgnoringCompositing(Page& page,
109 WebCanvas* canvas, 109 WebCanvas* canvas,
110 const WebRect& rect, 110 const WebRect& rect,
111 LocalFrame& root) { 111 LocalFrame& root) {
112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers); 112 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers);
113 } 113 }
114 114
115 WebInputEventResult PageWidgetDelegate::handleInputEvent( 115 WebInputEventResult PageWidgetDelegate::handleInputEvent(
116 PageWidgetEventHandler& handler, 116 PageWidgetEventHandler& handler,
117 const WebInputEvent& event, 117 const WebCoalescedInputEvent& coalescedEvent,
118 LocalFrame* root) { 118 LocalFrame* root) {
119 const WebInputEvent& event = coalescedEvent.event();
119 if (event.modifiers & WebInputEvent::IsTouchAccessibility && 120 if (event.modifiers & WebInputEvent::IsTouchAccessibility &&
120 WebInputEvent::isMouseEventType(event.type)) { 121 WebInputEvent::isMouseEventType(event.type)) {
121 PlatformMouseEventBuilder pme(root->view(), 122 PlatformMouseEventBuilder pme(root->view(),
122 static_cast<const WebMouseEvent&>(event)); 123 static_cast<const WebMouseEvent&>(event));
123 124
124 IntPoint docPoint(root->view()->rootFrameToContents(pme.position())); 125 IntPoint docPoint(root->view()->rootFrameToContents(pme.position()));
125 HitTestResult result = root->eventHandler().hitTestResultAtPoint( 126 HitTestResult result = root->eventHandler().hitTestResultAtPoint(
126 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); 127 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
127 result.setToShadowHostIfInUserAgentShadowRoot(); 128 result.setToShadowHostIfInUserAgentShadowRoot();
128 if (result.innerNodeFrame()) { 129 if (result.innerNodeFrame()) {
(...skipping 10 matching lines...) Expand all
139 switch (event.type) { 140 switch (event.type) {
140 // FIXME: WebKit seems to always return false on mouse events processing 141 // FIXME: WebKit seems to always return false on mouse events processing
141 // methods. For now we'll assume it has processed them (as we are only 142 // methods. For now we'll assume it has processed them (as we are only
142 // interested in whether keyboard events are processed). 143 // interested in whether keyboard events are processed).
143 // FIXME: Why do we return HandleSuppressed when there is no root or 144 // FIXME: Why do we return HandleSuppressed when there is no root or
144 // the root is detached? 145 // the root is detached?
145 case WebInputEvent::MouseMove: 146 case WebInputEvent::MouseMove:
146 if (!root || !root->view()) 147 if (!root || !root->view())
147 return WebInputEventResult::HandledSuppressed; 148 return WebInputEventResult::HandledSuppressed;
148 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event), 149 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event),
149 std::vector<const WebInputEvent*>()); 150 coalescedEvent.getCoalescedEventsPointers());
150 return WebInputEventResult::HandledSystem; 151 return WebInputEventResult::HandledSystem;
151 case WebInputEvent::MouseLeave: 152 case WebInputEvent::MouseLeave:
152 if (!root || !root->view()) 153 if (!root || !root->view())
153 return WebInputEventResult::HandledSuppressed; 154 return WebInputEventResult::HandledSuppressed;
154 handler.handleMouseLeave(*root, static_cast<const WebMouseEvent&>(event)); 155 handler.handleMouseLeave(*root, static_cast<const WebMouseEvent&>(event));
155 return WebInputEventResult::HandledSystem; 156 return WebInputEventResult::HandledSystem;
156 case WebInputEvent::MouseDown: 157 case WebInputEvent::MouseDown:
157 if (!root || !root->view()) 158 if (!root || !root->view())
158 return WebInputEventResult::HandledSuppressed; 159 return WebInputEventResult::HandledSuppressed;
159 handler.handleMouseDown(*root, static_cast<const WebMouseEvent&>(event)); 160 handler.handleMouseDown(*root, static_cast<const WebMouseEvent&>(event));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 return handler.handleGestureEvent( 196 return handler.handleGestureEvent(
196 static_cast<const WebGestureEvent&>(event)); 197 static_cast<const WebGestureEvent&>(event));
197 198
198 case WebInputEvent::TouchStart: 199 case WebInputEvent::TouchStart:
199 case WebInputEvent::TouchMove: 200 case WebInputEvent::TouchMove:
200 case WebInputEvent::TouchEnd: 201 case WebInputEvent::TouchEnd:
201 case WebInputEvent::TouchCancel: 202 case WebInputEvent::TouchCancel:
202 case WebInputEvent::TouchScrollStarted: 203 case WebInputEvent::TouchScrollStarted:
203 if (!root || !root->view()) 204 if (!root || !root->view())
204 return WebInputEventResult::NotHandled; 205 return WebInputEventResult::NotHandled;
205 return handler.handleTouchEvent(*root, 206 return handler.handleTouchEvent(
206 static_cast<const WebTouchEvent&>(event), 207 *root, static_cast<const WebTouchEvent&>(event),
207 std::vector<const WebInputEvent*>()); 208 coalescedEvent.getCoalescedEventsPointers());
208 case WebInputEvent::GesturePinchBegin: 209 case WebInputEvent::GesturePinchBegin:
209 case WebInputEvent::GesturePinchEnd: 210 case WebInputEvent::GesturePinchEnd:
210 case WebInputEvent::GesturePinchUpdate: 211 case WebInputEvent::GesturePinchUpdate:
211 // Touchscreen pinch events are currently not handled in main thread. 212 // Touchscreen pinch events are currently not handled in main thread.
212 // Once they are, these should be passed to |handleGestureEvent| similar 213 // Once they are, these should be passed to |handleGestureEvent| similar
213 // to gesture scroll events. 214 // to gesture scroll events.
214 return WebInputEventResult::NotHandled; 215 return WebInputEventResult::NotHandled;
215 default: 216 default:
216 return WebInputEventResult::NotHandled; 217 return WebInputEventResult::NotHandled;
217 } 218 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( 258 WebInputEventResult PageWidgetEventHandler::handleTouchEvent(
258 LocalFrame& mainFrame, 259 LocalFrame& mainFrame,
259 const WebTouchEvent& event, 260 const WebTouchEvent& event,
260 const std::vector<const WebInputEvent*>& coalescedEvents) { 261 const std::vector<const WebInputEvent*>& coalescedEvents) {
261 return mainFrame.eventHandler().handleTouchEvent( 262 return mainFrame.eventHandler().handleTouchEvent(
262 PlatformTouchEventBuilder(mainFrame.view(), event), 263 PlatformTouchEventBuilder(mainFrame.view(), event),
263 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents)); 264 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents));
264 } 265 }
265 266
266 } // namespace blink 267 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698