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

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

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Keep coalesced events in main thread event queue unittests 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 bool WebPagePopupImpl::isViewportPointInWindow(int x, int y) { 503 bool WebPagePopupImpl::isViewportPointInWindow(int x, int y) {
504 WebRect pointInWindow(x, y, 0, 0); 504 WebRect pointInWindow(x, y, 0, 0);
505 widgetClient()->convertViewportToWindow(&pointInWindow); 505 widgetClient()->convertViewportToWindow(&pointInWindow);
506 WebRect windowRect = windowRectInScreen(); 506 WebRect windowRect = windowRectInScreen();
507 return IntRect(0, 0, windowRect.width, windowRect.height) 507 return IntRect(0, 0, windowRect.width, windowRect.height)
508 .contains(IntPoint(pointInWindow.x, pointInWindow.y)); 508 .contains(IntPoint(pointInWindow.x, pointInWindow.y));
509 } 509 }
510 510
511 WebInputEventResult WebPagePopupImpl::handleInputEvent( 511 WebInputEventResult WebPagePopupImpl::handleInputEvent(
512 const WebInputEvent& event) { 512 const WebCoalescedInputEvent& event) {
513 if (m_closing) 513 if (m_closing)
514 return WebInputEventResult::NotHandled; 514 return WebInputEventResult::NotHandled;
515 return PageWidgetDelegate::handleInputEvent( 515 return PageWidgetDelegate::handleInputEvent(
516 *this, WebCoalescedInputEvent(event), m_page->deprecatedLocalMainFrame()); 516 *this, event, m_page->deprecatedLocalMainFrame());
517 } 517 }
518 518
519 void WebPagePopupImpl::setFocus(bool enable) { 519 void WebPagePopupImpl::setFocus(bool enable) {
520 if (!m_page) 520 if (!m_page)
521 return; 521 return;
522 m_page->focusController().setFocused(enable); 522 m_page->focusController().setFocused(enable);
523 if (enable) 523 if (enable)
524 m_page->focusController().setActive(true); 524 m_page->focusController().setActive(true);
525 } 525 }
526 526
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 // A WebPagePopupImpl instance usually has two references. 598 // A WebPagePopupImpl instance usually has two references.
599 // - One owned by the instance itself. It represents the visible widget. 599 // - One owned by the instance itself. It represents the visible widget.
600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
601 // WebPagePopupImpl to close. 601 // WebPagePopupImpl to close.
602 // We need them because the closing operation is asynchronous and the widget 602 // We need them because the closing operation is asynchronous and the widget
603 // can be closed while the WebViewImpl is unaware of it. 603 // can be closed while the WebViewImpl is unaware of it.
604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 604 return adoptRef(new WebPagePopupImpl(client)).leakRef();
605 } 605 }
606 606
607 } // namespace blink 607 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698