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..0adf5275442cd8b1b48fdb0f9f18031919e15066 |
--- /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/Supplementable.h" |
+#include "platform/heap/Handle.h" |
+#include "platform/heap/Member.h" |
+#include "public/platform/modules/keyboard_lock/keyboard_lock.mojom-blink.h" |
+#include "wtf/Forward.h" |
+ |
+namespace blink { |
+ |
+class ChromeClient; |
+class ScriptPromiseResolver; |
+ |
+class CORE_EXPORT NavigatorKeyboardLock final |
whywhat
2017/04/12 16:02:13
nit: A class level comment would be nice to have (
Hzj_jie
2017/04/13 00:38:54
Done.
|
+ : public GarbageCollectedFinalized<NavigatorKeyboardLock>, |
+ public Supplement<Navigator> { |
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorKeyboardLock); |
+ |
+ public: |
+ static NavigatorKeyboardLock& From(Navigator&); |
+ |
+ static ScriptPromise requestKeyLock(ScriptState*, |
whywhat
2017/04/12 16:02:13
do you need both the static and non-static version
Hzj_jie
2017/04/13 00:38:54
I followed some other examples, which public both
|
+ 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(); |
+ |
+ void LockRequestFinished(bool, const String&); |
+ void CancelRequestFinished(); |
+ |
+ // bool RetrieveChromeClient(ChromeClient*&, String&) const; |
whywhat
2017/04/12 16:02:13
nit: remove with a blank line under it?
Hzj_jie
2017/04/13 00:38:54
Sorry, I have not noticed this commented line.
|
+ |
+ mojom::blink::KeyboardLockServicePtr service_; |
+ Member<ScriptPromiseResolver> request_keylock_resolver_; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // NavigatorKeyboardLock_h |