Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp |
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp |
index cb86012f4d29646ccb0a0b7ef3909360290d9518..38730ab5ba942c3591ced82faa9a86ba3243a987 100644 |
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp |
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp |
@@ -32,6 +32,8 @@ |
#include "web/ChromeClientImpl.h" |
#include <memory> |
+#include <utility> |
+ |
#include "bindings/core/v8/ScriptController.h" |
#include "core/HTMLNames.h" |
#include "core/dom/AXObjectCache.h" |
@@ -120,6 +122,7 @@ |
#include "web/WebFileChooserCompletionImpl.h" |
#include "web/WebFrameWidgetImpl.h" |
#include "web/WebInputEventConversion.h" |
+#include "web/WebKeyLockRequestCompletionImpl.h" |
#include "web/WebLocalFrameImpl.h" |
#include "web/WebPluginContainerImpl.h" |
#include "web/WebSettingsImpl.h" |
@@ -946,6 +949,33 @@ WebLayerTreeView* ChromeClientImpl::GetWebLayerTreeView(LocalFrame* frame) { |
return web_frame->LocalRoot()->FrameWidget()->GetLayerTreeView(); |
} |
+void ChromeClientImpl::RequestKeyLock(LocalFrame* frame, |
+ PassRefPtr<KeyboardLocker> locker) { |
+ // The request always comes from a valid page: the page should always has its |
+ // LocalFrame. |
+ DCHECK(frame); |
+ DCHECK(locker); |
+ WebFrameClient* client = WebLocalFrameImpl::FromFrame(frame)->Client(); |
+ if (!client) { |
+ locker->FinishLockRequest(false, WebString::FromASCII("Invalid client.")); |
+ return; |
+ } |
+ |
+ client->RequestKeyLock( |
+ locker->web_keycodes(), |
+ new WebKeyLockRequestCompletionImpl(std::move(locker))); |
+} |
+ |
+void ChromeClientImpl::CancelKeyLock(LocalFrame* frame) { |
+ DCHECK(frame); |
+ WebFrameClient* client = WebLocalFrameImpl::FromFrame(frame)->Client(); |
+ if (!client) { |
+ return; |
+ } |
+ |
+ client->CancelKeyLock(); |
+} |
+ |
void ChromeClientImpl::SetEventListenerProperties( |
LocalFrame* frame, |
WebEventListenerClass event_class, |