Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NavigatorKeyboardLock_h | |
| 6 #define NavigatorKeyboardLock_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptPromise.h" | |
| 9 #include "core/frame/Navigator.h" | |
| 10 #include "platform/Supplementable.h" | |
| 11 #include "platform/heap/Handle.h" | |
| 12 #include "platform/heap/Member.h" | |
| 13 #include "public/platform/modules/keyboard_lock/keyboard_lock.mojom-blink.h" | |
| 14 #include "wtf/Forward.h" | |
| 15 | |
| 16 namespace blink { | |
| 17 | |
| 18 class ChromeClient; | |
| 19 class ScriptPromiseResolver; | |
| 20 | |
| 21 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.
| |
| 22 : public GarbageCollectedFinalized<NavigatorKeyboardLock>, | |
| 23 public Supplement<Navigator> { | |
| 24 USING_GARBAGE_COLLECTED_MIXIN(NavigatorKeyboardLock); | |
| 25 | |
| 26 public: | |
| 27 static NavigatorKeyboardLock& From(Navigator&); | |
| 28 | |
| 29 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
| |
| 30 Navigator&, | |
| 31 const Vector<String>&); | |
| 32 ScriptPromise requestKeyLock(ScriptState*, const Vector<String>&); | |
| 33 | |
| 34 static void cancelKeyLock(Navigator&); | |
| 35 void cancelKeyLock(); | |
| 36 | |
| 37 DECLARE_TRACE(); | |
| 38 | |
| 39 private: | |
| 40 explicit NavigatorKeyboardLock(Navigator&); | |
| 41 static const char* SupplementName(); | |
| 42 | |
| 43 void LockRequestFinished(bool, const String&); | |
| 44 void CancelRequestFinished(); | |
| 45 | |
| 46 // 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.
| |
| 47 | |
| 48 mojom::blink::KeyboardLockServicePtr service_; | |
| 49 Member<ScriptPromiseResolver> request_keylock_resolver_; | |
| 50 }; | |
| 51 | |
| 52 } // namespace blink | |
| 53 | |
| 54 #endif // NavigatorKeyboardLock_h | |
| OLD | NEW |