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

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

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (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) 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 if (m_closing || !m_page || !m_page->mainFrame() || 457 if (m_closing || !m_page || !m_page->mainFrame() ||
458 !toLocalFrame(m_page->mainFrame())->view()) 458 !toLocalFrame(m_page->mainFrame())->view())
459 return WebInputEventResult::NotHandled; 459 return WebInputEventResult::NotHandled;
460 if ((event.type == WebInputEvent::GestureTap || 460 if ((event.type == WebInputEvent::GestureTap ||
461 event.type == WebInputEvent::GestureTapDown) && 461 event.type == WebInputEvent::GestureTapDown) &&
462 !isViewportPointInWindow(event.x, event.y)) { 462 !isViewportPointInWindow(event.x, event.y)) {
463 cancel(); 463 cancel();
464 return WebInputEventResult::NotHandled; 464 return WebInputEventResult::NotHandled;
465 } 465 }
466 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); 466 LocalFrame& frame = *toLocalFrame(m_page->mainFrame());
467 return frame.eventHandler().handleGestureEvent( 467 WebGestureEvent scaledEvent = ScaleWebGestureEvent(frame.view(), event);
468 PlatformGestureEventBuilder(frame.view(), event)); 468 return frame.eventHandler().handleGestureEvent(scaledEvent);
469 } 469 }
470 470
471 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame, 471 void WebPagePopupImpl::handleMouseDown(LocalFrame& mainFrame,
472 const WebMouseEvent& event) { 472 const WebMouseEvent& event) {
473 if (isViewportPointInWindow(event.x, event.y)) 473 if (isViewportPointInWindow(event.x, event.y))
474 PageWidgetEventHandler::handleMouseDown(mainFrame, event); 474 PageWidgetEventHandler::handleMouseDown(mainFrame, event);
475 else 475 else
476 cancel(); 476 cancel();
477 } 477 }
478 478
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // A WebPagePopupImpl instance usually has two references. 583 // A WebPagePopupImpl instance usually has two references.
584 // - One owned by the instance itself. It represents the visible widget. 584 // - One owned by the instance itself. It represents the visible widget.
585 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 585 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
586 // WebPagePopupImpl to close. 586 // WebPagePopupImpl to close.
587 // We need them because the closing operation is asynchronous and the widget 587 // We need them because the closing operation is asynchronous and the widget
588 // can be closed while the WebViewImpl is unaware of it. 588 // can be closed while the WebViewImpl is unaware of it.
589 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 589 return adoptRef(new WebPagePopupImpl(client)).leakRef();
590 } 590 }
591 591
592 } // namespace blink 592 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698