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

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

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Created 4 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 bool WebViewImpl::hasVerticalScrollbar() { 2099 bool WebViewImpl::hasVerticalScrollbar() {
2100 return mainFrameImpl() 2100 return mainFrameImpl()
2101 ->frameView() 2101 ->frameView()
2102 ->layoutViewportScrollableArea() 2102 ->layoutViewportScrollableArea()
2103 ->verticalScrollbar(); 2103 ->verticalScrollbar();
2104 } 2104 }
2105 2105
2106 const WebInputEvent* WebViewImpl::m_currentInputEvent = nullptr; 2106 const WebInputEvent* WebViewImpl::m_currentInputEvent = nullptr;
2107 2107
2108 WebInputEventResult WebViewImpl::handleInputEvent( 2108 WebInputEventResult WebViewImpl::handleInputEvent(
2109 const WebInputEvent& inputEvent) { 2109 const WebCoalescedInputEvent& coalescedEvent) {
2110 const WebInputEvent& inputEvent = coalescedEvent.event();
2110 // TODO(dcheng): The fact that this is getting called when there is no local 2111 // TODO(dcheng): The fact that this is getting called when there is no local
2111 // main frame is problematic and probably indicates a bug in the input event 2112 // main frame is problematic and probably indicates a bug in the input event
2112 // routing code. 2113 // routing code.
2113 if (!mainFrameImpl()) 2114 if (!mainFrameImpl())
2114 return WebInputEventResult::NotHandled; 2115 return WebInputEventResult::NotHandled;
2115 2116
2116 WebAutofillClient* autofillClient = mainFrameImpl()->autofillClient(); 2117 WebAutofillClient* autofillClient = mainFrameImpl()->autofillClient();
2117 UserGestureNotifier notifier(this); 2118 UserGestureNotifier notifier(this);
2118 // On the first input event since page load, |notifier| instructs the 2119 // On the first input event since page load, |notifier| instructs the
2119 // autofill client to unblock values of password input fields of any forms 2120 // autofill client to unblock values of password input fields of any forms
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
2202 node->dispatchMouseEvent( 2203 node->dispatchMouseEvent(
2203 PlatformMouseEventBuilder( 2204 PlatformMouseEventBuilder(
2204 mainFrameImpl()->frameView(), 2205 mainFrameImpl()->frameView(),
2205 static_cast<const WebMouseEvent&>(inputEvent)), 2206 static_cast<const WebMouseEvent&>(inputEvent)),
2206 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount); 2207 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount);
2207 return WebInputEventResult::HandledSystem; 2208 return WebInputEventResult::HandledSystem;
2208 } 2209 }
2209 2210
2210 // FIXME: This should take in the intended frame, not the local frame root. 2211 // FIXME: This should take in the intended frame, not the local frame root.
2211 WebInputEventResult result = PageWidgetDelegate::handleInputEvent( 2212 WebInputEventResult result = PageWidgetDelegate::handleInputEvent(
2212 *this, inputEvent, mainFrameImpl()->frame()); 2213 *this, coalescedEvent, mainFrameImpl()->frame());
2213 if (result != WebInputEventResult::NotHandled) 2214 if (result != WebInputEventResult::NotHandled)
2214 return result; 2215 return result;
2215 2216
2216 // Unhandled pinch events should adjust the scale. 2217 // Unhandled pinch events should adjust the scale.
2217 if (inputEvent.type == WebInputEvent::GesturePinchUpdate) { 2218 if (inputEvent.type == WebInputEvent::GesturePinchUpdate) {
2218 const WebGestureEvent& pinchEvent = 2219 const WebGestureEvent& pinchEvent =
2219 static_cast<const WebGestureEvent&>(inputEvent); 2220 static_cast<const WebGestureEvent&>(inputEvent);
2220 2221
2221 // For touchpad gestures synthesize a Windows-like wheel event 2222 // For touchpad gestures synthesize a Windows-like wheel event
2222 // to send to any handlers that may exist. Not necessary for touchscreen 2223 // to send to any handlers that may exist. Not necessary for touchscreen
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
4204 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4205 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4205 return nullptr; 4206 return nullptr;
4206 return focusedFrame; 4207 return focusedFrame;
4207 } 4208 }
4208 4209
4209 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4210 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4210 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4211 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4211 } 4212 }
4212 4213
4213 } // namespace blink 4214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698