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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 2591783003: Implement pointer lock across outer/inner WebContents. (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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/guest_view/web_view/web_view_guest.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index 4276b3c9af6e79f98dbc8a99223c0b5b795a0ea8..6bcb5b8c8f3b2c55d812b22ade2a4136e9ad578d 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -1375,6 +1375,18 @@ bool WebViewGuest::IsFullscreenForTabOrPending(
return is_guest_fullscreen_;
}
+void WebViewGuest::RequestToLockMouse(WebContents* web_contents,
+ bool user_gesture,
+ bool last_unlocked_by_target) {
+ RequestPointerLockPermission(
+ user_gesture, last_unlocked_by_target,
+ base::Bind(
+ [](WebContents* web_contents, bool allowed) {
ncarter (slow) 2016/12/22 00:01:07 Why not: base::Bind(base::IgnoreResult(&WebConten
lfg 2016/12/22 19:23:55 Oh, that's nice, I wasn't aware of base::IgnoreRes
+ web_contents->GotResponseToLockMouseRequest(allowed);
+ },
+ web_contents));
+}
+
void WebViewGuest::LoadURLWithParams(
const GURL& url,
const content::Referrer& referrer,

Powered by Google App Engine
This is Rietveld 408576698