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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1980133002: Implement pointer lock API for out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebViewClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8371a6b88bb4d0b1fa797aeed1fe282af5a6dcfc..2f7ac22ca4d5685ff8502f958404e9e750e1bedc 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;
+ if (WebFrameWidget* widget = mainFrameImpl()->frameWidget()) {
+ if (WebWidgetClient* client = widget->client())
+ isPointerLocked = client->isPointerLocked();
+ }
+
+ if (isPointerLocked && WebInputEvent::isMouseEventType(inputEvent.type)) {
pointerLockMouseEvent(inputEvent);
return WebInputEventResult::HandledSystem;
}
@@ -4465,22 +4472,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;
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebViewClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698