Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index fad565d27c6eaef57d89c1087056567fb40a7363..f9d6ba4c9a69789e1517cdd8cc0337ced0339b92 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -140,6 +140,7 @@ |
| #include "public/web/WebElement.h" |
| #include "public/web/WebFrame.h" |
| #include "public/web/WebFrameClient.h" |
| +#include "public/web/WebFrameWidget.h" |
| #include "public/web/WebHitTestResult.h" |
| #include "public/web/WebInputElement.h" |
| #include "public/web/WebMeaningfulLayout.h" |
| @@ -2170,7 +2171,13 @@ WebInputEventResult WebViewImpl::handleInputEvent(const WebInputEvent& inputEven |
| TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent, &inputEvent); |
| UIEventWithKeyState::clearNewTabModifierSetFromIsolatedWorld(); |
| - if (isPointerLocked() && WebInputEvent::isMouseEventType(inputEvent.type)) { |
| + bool isPointerLocked = false; |
|
dcheng
2016/06/07 05:07:55
Sigh. One day we won't need this I guess =)
|
| + if (WebFrameWidget* widget = mainFrameImpl()->frameWidget()) { |
| + if (WebWidgetClient* client = widget->client()) |
| + isPointerLocked = client->isPointerLocked(); |
| + } |
| + |
| + if (isPointerLocked && WebInputEvent::isMouseEventType(inputEvent.type)) { |
| pointerLockMouseEvent(inputEvent); |
| return WebInputEventResult::HandledSystem; |
| } |
| @@ -4443,22 +4450,6 @@ void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, |
| m_scheduler->setPageVisible(visible); |
| } |
| -bool WebViewImpl::requestPointerLock() |
| -{ |
| - return m_client && m_client->requestPointerLock(); |
| -} |
| - |
| -void WebViewImpl::requestPointerUnlock() |
| -{ |
| - if (m_client) |
| - m_client->requestPointerUnlock(); |
| -} |
| - |
| -bool WebViewImpl::isPointerLocked() |
| -{ |
| - return m_client && m_client->isPointerLocked(); |
| -} |
| - |
| void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) |
| { |
| OwnPtr<UserGestureIndicator> gestureIndicator; |