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

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

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 void WebFrameWidgetImpl::themeChanged() { 315 void WebFrameWidgetImpl::themeChanged() {
316 FrameView* view = m_localRoot->frameView(); 316 FrameView* view = m_localRoot->frameView();
317 317
318 WebRect damagedRect(0, 0, m_size.width, m_size.height); 318 WebRect damagedRect(0, 0, m_size.width, m_size.height);
319 view->invalidateRect(damagedRect); 319 view->invalidateRect(damagedRect);
320 } 320 }
321 321
322 const WebInputEvent* WebFrameWidgetImpl::m_currentInputEvent = nullptr; 322 const WebInputEvent* WebFrameWidgetImpl::m_currentInputEvent = nullptr;
323 323
324 WebInputEventResult WebFrameWidgetImpl::handleInputEvent( 324 WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
325 const WebInputEvent& inputEvent) { 325 const CoalescedWebInputEvent& coalescedEvent) {
326 const WebInputEvent& inputEvent = coalescedEvent.event();
326 TRACE_EVENT1("input", "WebFrameWidgetImpl::handleInputEvent", "type", 327 TRACE_EVENT1("input", "WebFrameWidgetImpl::handleInputEvent", "type",
327 WebInputEvent::GetName(inputEvent.type)); 328 WebInputEvent::GetName(inputEvent.type));
328 329
329 // Don't handle events once we've started shutting down. 330 // Don't handle events once we've started shutting down.
330 if (!page()) 331 if (!page())
331 return WebInputEventResult::NotHandled; 332 return WebInputEventResult::NotHandled;
332 333
333 if (InspectorOverlay* overlay = inspectorOverlay()) { 334 if (InspectorOverlay* overlay = inspectorOverlay()) {
334 if (overlay->handleInputEvent(inputEvent)) 335 if (overlay->handleInputEvent(coalescedEvent))
335 return WebInputEventResult::HandledSuppressed; 336 return WebInputEventResult::HandledSuppressed;
336 } 337 }
337 338
338 // Report the event to be NOT processed by WebKit, so that the browser can 339 // Report the event to be NOT processed by WebKit, so that the browser can
339 // handle it appropriately. 340 // handle it appropriately.
340 if (m_ignoreInputEvents) 341 if (m_ignoreInputEvents)
341 return WebInputEventResult::NotHandled; 342 return WebInputEventResult::NotHandled;
342 343
343 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available. 344 // FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available.
344 345
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 382 }
382 383
383 node->dispatchMouseEvent( 384 node->dispatchMouseEvent(
384 PlatformMouseEventBuilder( 385 PlatformMouseEventBuilder(
385 m_localRoot->frameView(), 386 m_localRoot->frameView(),
386 static_cast<const WebMouseEvent&>(inputEvent)), 387 static_cast<const WebMouseEvent&>(inputEvent)),
387 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount); 388 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount);
388 return WebInputEventResult::HandledSystem; 389 return WebInputEventResult::HandledSystem;
389 } 390 }
390 391
391 return PageWidgetDelegate::handleInputEvent(*this, inputEvent, 392 return PageWidgetDelegate::handleInputEvent(*this, coalescedEvent,
392 m_localRoot->frame()); 393 m_localRoot->frame());
393 } 394 }
394 395
395 void WebFrameWidgetImpl::setCursorVisibilityState(bool isVisible) { 396 void WebFrameWidgetImpl::setCursorVisibilityState(bool isVisible) {
396 page()->setIsCursorVisible(isVisible); 397 page()->setIsCursorVisible(isVisible);
397 } 398 }
398 399
399 bool WebFrameWidgetImpl::hasTouchEventHandlersAt(const WebPoint& point) { 400 bool WebFrameWidgetImpl::hasTouchEventHandlersAt(const WebPoint& point) {
400 // FIXME: Implement this. Note that the point must be divided by 401 // FIXME: Implement this. Note that the point must be divided by
401 // pageScaleFactor. 402 // pageScaleFactor.
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 return nullptr; 1147 return nullptr;
1147 } 1148 }
1148 1149
1149 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1150 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1150 if (!m_imeAcceptEvents) 1151 if (!m_imeAcceptEvents)
1151 return nullptr; 1152 return nullptr;
1152 return focusedLocalFrameInWidget(); 1153 return focusedLocalFrameInWidget();
1153 } 1154 }
1154 1155
1155 } // namespace blink 1156 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698