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

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

Issue 2036493002: Handle touch accessibility in PageWidgetDelegate instead of WebViewImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@touch_exploration_test
Patch Set: Created 4 years, 6 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 void PageWidgetDelegate::paintIgnoringCompositing(Page& page, WebCanvas* canvas, 103 void PageWidgetDelegate::paintIgnoringCompositing(Page& page, WebCanvas* canvas,
104 const WebRect& rect, LocalFrame& root) 104 const WebRect& rect, LocalFrame& root)
105 { 105 {
106 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers) ; 106 paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers) ;
107 } 107 }
108 108
109 WebInputEventResult PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const WebInputEvent& event, LocalFrame* root) 109 WebInputEventResult PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const WebInputEvent& event, LocalFrame* root)
110 { 110 {
111 if (event.modifiers & WebInputEvent::IsTouchAccessibility
112 && WebInputEvent::isMouseEventType(event.type)) {
113 PlatformMouseEventBuilder pme(root->view(), static_cast<const WebMouseEv ent&>(event));
114
115 IntPoint docPoint(root->view()->rootFrameToContents(pme.position()));
116 HitTestResult result = root->eventHandler().hitTestResultAtPoint(docPoin t, HitTestRequest::ReadOnly | HitTestRequest::Active);
117 result.setToShadowHostIfInUserAgentShadowRoot();
118 if (result.innerNodeFrame()) {
119 Document* document = result.innerNodeFrame()->document();
120 if (document) {
121 AXObjectCache* cache = document->existingAXObjectCache();
122 if (cache)
123 cache->onTouchAccessibilityHover(result.roundedPointInInnerN odeFrame());
124 }
125 }
126 }
127
111 switch (event.type) { 128 switch (event.type) {
112 129
113 // FIXME: WebKit seems to always return false on mouse events processing 130 // FIXME: WebKit seems to always return false on mouse events processing
114 // methods. For now we'll assume it has processed them (as we are only 131 // methods. For now we'll assume it has processed them (as we are only
115 // interested in whether keyboard events are processed). 132 // interested in whether keyboard events are processed).
116 // FIXME: Why do we return HandleSuppressed when there is no root or 133 // FIXME: Why do we return HandleSuppressed when there is no root or
117 // the root is detached? 134 // the root is detached?
118 case WebInputEvent::MouseMove: 135 case WebInputEvent::MouseMove:
119 if (!root || !root->view()) 136 if (!root || !root->view())
120 return WebInputEventResult::HandledSuppressed; 137 return WebInputEventResult::HandledSuppressed;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 WEBINPUT_EVENT_CASE(TouchEnd) 270 WEBINPUT_EVENT_CASE(TouchEnd)
254 WEBINPUT_EVENT_CASE(TouchCancel) 271 WEBINPUT_EVENT_CASE(TouchCancel)
255 WEBINPUT_EVENT_CASE(TouchScrollStarted) 272 WEBINPUT_EVENT_CASE(TouchScrollStarted)
256 default: 273 default:
257 NOTREACHED(); 274 NOTREACHED();
258 return ""; 275 return "";
259 } 276 }
260 } 277 }
261 278
262 } // namespace blink 279 } // namespace blink
OLDNEW
« no previous file with comments | « content/browser/accessibility/touch_accessibility_aura_browsertest.cc ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698