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

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

Issue 2805763004: [System-Keyboard-Lock] Forward navigator functions to RenderFrameHost (Closed)
Patch Set: Resolve review comments Created 3 years, 8 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
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,

Powered by Google App Engine
This is Rietveld 408576698