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

Unified Diff: third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.h

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/modules/keyboard_lock/NavigatorKeyboardLock.h
diff --git a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.h b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1abc4766b1d23ea37643fc8d26dd84e4d9e4a1e
--- /dev/null
+++ b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.h
@@ -0,0 +1,54 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NavigatorKeyboardLock_h
+#define NavigatorKeyboardLock_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "core/frame/Navigator.h"
+#include "platform/KeyboardLocker.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+#include "platform/heap/Member.h"
+#include "wtf/Forward.h"
+
+namespace blink {
+
+class ChromeClient;
+class ScriptPromiseResolver;
+
+class CORE_EXPORT NavigatorKeyboardLock final
+ : public GarbageCollectedFinalized<NavigatorKeyboardLock>,
+ public Supplement<Navigator>,
+ private KeyboardLockerClient {
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorKeyboardLock);
+
+ public:
+ static NavigatorKeyboardLock& From(Navigator&);
+
+ static ScriptPromise requestKeyLock(ScriptState*,
+ Navigator&,
+ const Vector<String>&);
+ ScriptPromise requestKeyLock(ScriptState*, const Vector<String>&);
+
+ static void cancelKeyLock(Navigator&);
+ void cancelKeyLock();
+
+ DECLARE_TRACE();
+
+ private:
+ explicit NavigatorKeyboardLock(Navigator&);
+ static const char* SupplementName();
+
+ // KeyboardLockerClient
+ void LockRequestFinished(bool, const String&) override;
+
+ bool RetrieveChromeClient(ChromeClient*&, String&) const;
whywhat 2017/04/11 14:52:33 I don't think you need ChromeClient plumbing at al
Hzj_jie 2017/04/12 02:51:06 Yes, I just found this solution: my solution seems
+
+ Member<ScriptPromiseResolver> request_keylock_resolver_;
+};
+
+} // namespace blink
+
+#endif // NavigatorKeyboardLock_h

Powered by Google App Engine
This is Rietveld 408576698