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

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

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Truncated to int on input, git cl format Created 3 years, 8 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) 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 // FIXME: WebWidget doesn't have the method below. 734 // FIXME: WebWidget doesn't have the method below.
735 // m_client->setMouseOverURL(WebURL()); 735 // m_client->setMouseOverURL(WebURL());
736 PageWidgetEventHandler::handleMouseLeave(mainFrame, event); 736 PageWidgetEventHandler::handleMouseLeave(mainFrame, event);
737 } 737 }
738 738
739 void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame, 739 void WebFrameWidgetImpl::handleMouseDown(LocalFrame& mainFrame,
740 const WebMouseEvent& event) { 740 const WebMouseEvent& event) {
741 // Take capture on a mouse down on a plugin so we can send it mouse events. 741 // Take capture on a mouse down on a plugin so we can send it mouse events.
742 // If the hit node is a plugin but a scrollbar is over it don't start mouse 742 // If the hit node is a plugin but a scrollbar is over it don't start mouse
743 // capture because it will interfere with the scrollbar receiving events. 743 // capture because it will interfere with the scrollbar receiving events.
744 IntPoint point(event.x, event.y); 744 IntPoint point(event.positionInWidget().x, event.positionInWidget().y);
745 if (event.button == WebMouseEvent::Button::Left) { 745 if (event.button == WebMouseEvent::Button::Left) {
746 point = m_localRoot->frameView()->rootFrameToContents(point); 746 point = m_localRoot->frameView()->rootFrameToContents(point);
747 HitTestResult result( 747 HitTestResult result(
748 m_localRoot->frame()->eventHandler().hitTestResultAtPoint(point)); 748 m_localRoot->frame()->eventHandler().hitTestResultAtPoint(point));
749 result.setToShadowHostIfInRestrictedShadowRoot(); 749 result.setToShadowHostIfInRestrictedShadowRoot();
750 Node* hitNode = result.innerNode(); 750 Node* hitNode = result.innerNode();
751 751
752 if (!result.scrollbar() && hitNode && hitNode->layoutObject() && 752 if (!result.scrollbar() && hitNode && hitNode->layoutObject() &&
753 hitNode->layoutObject()->isEmbeddedObject()) { 753 hitNode->layoutObject()->isEmbeddedObject()) {
754 m_mouseCaptureNode = hitNode; 754 m_mouseCaptureNode = hitNode;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 return nullptr; 1129 return nullptr;
1130 } 1130 }
1131 1131
1132 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1132 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1133 if (!m_imeAcceptEvents) 1133 if (!m_imeAcceptEvents)
1134 return nullptr; 1134 return nullptr;
1135 return focusedLocalFrameInWidget(); 1135 return focusedLocalFrameInWidget();
1136 } 1136 }
1137 1137
1138 } // namespace blink 1138 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698