| Index: third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl
|
| diff --git a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..060ae03572d6ff6efe0c676d3a22497444509813
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl
|
| @@ -0,0 +1,28 @@
|
| +// 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.
|
| +
|
| +// The supplement of Navigator to process navigator.requestKeyLock() and
|
| +// navigator.cancelKeyLock() web APIs. See http://crbug.com/680809.
|
| +partial interface Navigator {
|
| + // Requests to receive a set of key codes
|
| + // (https://www.w3.org/TR/uievents/#interface-keyboardevent) in string
|
| + // format.
|
| + // The Promise will be rejected if the user or browser do not allow the web
|
| + // page to use this API. Otherwise, web page should expect to receive the
|
| + // key presses once the Promise has been resolved. This API does best effort
|
| + // to deliver the key codes: due to the platform restrictions, some keys or
|
| + // key combinations may not be able to receive or intercept by the user
|
| + // agent.
|
| + // - Making two requests concurrently without waiting for one Promise to
|
| + // finish is disallowed, the second Promise will be rejected immediately.
|
| + // - Making a second request after the Promise of the first one has finished
|
| + // is allowed; the second request will overwrite the key codes reserved.
|
| + // - Passing in an empty keyCodes array will reserve all keys.
|
| + [RuntimeEnabled=KeyboardLock, CallWith=ScriptState] Promise<void> requestKeyLock(DOMString[] keyCodes);
|
| +
|
| + // Removes all reserved keys. This function is also asynchronized, the web
|
| + // page may still receive reserved keys after this function has finished.
|
| + // Once the web page is closed, the user agent implictly executes this API.
|
| + [RuntimeEnabled=KeyboardLock] void cancelKeyLock();
|
| +};
|
|
|