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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WebCoalescedInputEvent& coalescedEvent, 117 const WebCoalescedInputEvent& coalescedEvent,
118 LocalFrame* root) { 118 LocalFrame* root) {
119 const WebInputEvent& event = coalescedEvent.event(); 119 const WebInputEvent& event = coalescedEvent.event();
120 if (event.modifiers & WebInputEvent::IsTouchAccessibility && 120 if (event.modifiers() & WebInputEvent::IsTouchAccessibility &&
121 WebInputEvent::isMouseEventType(event.type)) { 121 WebInputEvent::isMouseEventType(event.type())) {
122 PlatformMouseEventBuilder pme(root->view(), 122 PlatformMouseEventBuilder pme(root->view(),
123 static_cast<const WebMouseEvent&>(event)); 123 static_cast<const WebMouseEvent&>(event));
124 124
125 IntPoint docPoint(root->view()->rootFrameToContents(pme.position())); 125 IntPoint docPoint(root->view()->rootFrameToContents(pme.position()));
126 HitTestResult result = root->eventHandler().hitTestResultAtPoint( 126 HitTestResult result = root->eventHandler().hitTestResultAtPoint(
127 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); 127 docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
128 result.setToShadowHostIfInUserAgentShadowRoot(); 128 result.setToShadowHostIfInUserAgentShadowRoot();
129 if (result.innerNodeFrame()) { 129 if (result.innerNodeFrame()) {
130 Document* document = result.innerNodeFrame()->document(); 130 Document* document = result.innerNodeFrame()->document();
131 if (document) { 131 if (document) {
132 AXObjectCache* cache = document->existingAXObjectCache(); 132 AXObjectCache* cache = document->existingAXObjectCache();
133 if (cache) 133 if (cache)
134 cache->onTouchAccessibilityHover( 134 cache->onTouchAccessibilityHover(
135 result.roundedPointInInnerNodeFrame()); 135 result.roundedPointInInnerNodeFrame());
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 switch (event.type) { 140 switch (event.type()) {
141 // FIXME: WebKit seems to always return false on mouse events processing 141 // FIXME: WebKit seems to always return false on mouse events processing
142 // 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
143 // interested in whether keyboard events are processed). 143 // interested in whether keyboard events are processed).
144 // 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
145 // the root is detached? 145 // the root is detached?
146 case WebInputEvent::MouseMove: 146 case WebInputEvent::MouseMove:
147 if (!root || !root->view()) 147 if (!root || !root->view())
148 return WebInputEventResult::HandledSuppressed; 148 return WebInputEventResult::HandledSuppressed;
149 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event), 149 handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event),
150 coalescedEvent.getCoalescedEventsPointers()); 150 coalescedEvent.getCoalescedEventsPointers());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 WebInputEventResult PageWidgetEventHandler::handleTouchEvent( 259 WebInputEventResult PageWidgetEventHandler::handleTouchEvent(
260 LocalFrame& mainFrame, 260 LocalFrame& mainFrame,
261 const WebTouchEvent& event, 261 const WebTouchEvent& event,
262 const std::vector<const WebInputEvent*>& coalescedEvents) { 262 const std::vector<const WebInputEvent*>& coalescedEvents) {
263 return mainFrame.eventHandler().handleTouchEvent( 263 return mainFrame.eventHandler().handleTouchEvent(
264 PlatformTouchEventBuilder(mainFrame.view(), event), 264 PlatformTouchEventBuilder(mainFrame.view(), event),
265 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents)); 265 createPlatformTouchEventVector(mainFrame.view(), coalescedEvents));
266 } 266 }
267 267
268 } // namespace blink 268 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('k') | third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698