Use Promise with RequestPointerLock calls

The Pointer Lock API used to use an even based system.  However, that
is an outdated system and the events do not give an reason in failures.
This change introduces a Promise to the call that adds reasons if the
request is rejected.

Bug: 1042289
Change-Id: I4c8cacac3db5d9dc8d2f3a09c663c2dfb5bdf89e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2069199
Commit-Queue: James Hollyer <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Yuki Shiino <[email protected]>
Cr-Commit-Position: refs/heads/master@{#748810}
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index cb39064..46f509c2 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -498,7 +498,8 @@
 void Shell::RequestToLockMouse(WebContents* web_contents,
                                bool user_gesture,
                                bool last_unlocked_by_target) {
-  web_contents->GotResponseToLockMouseRequest(true);
+  web_contents->GotResponseToLockMouseRequest(
+      blink::mojom::PointerLockResult::kSuccess);
 }
 
 void Shell::CloseContents(WebContents* source) {