blob: 826d8f9342f8e8b93ecd6b6d166e056d64551350 [file] [log] [blame]
// 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.
module blink.mojom;
enum KeyboardLockRequestResult {
kSuccess = 0,
kFrameDetachedError = 1,
kNoValidKeyCodesError = 2,
kChildFrameError = 3,
kRequestFailedError = 4
};
enum GetKeyboardLayoutMapStatus {
kSuccess = 0,
kFail = 1,
};
struct GetKeyboardLayoutMapResult {
GetKeyboardLayoutMapStatus status;
// A map of KeyboardEvent code to KeyboardEvent key values.
map<string, string> layout_map;
};
// The browser side service to process navigator.keyboard.lock() and
// navigator.keyboard.unlock() web APIs. See http://crbug.com/680809.
interface KeyboardLockService {
// Registers a set of string-formatted key codes
// (https://www.w3.org/TR/uievents/#interface-keyboardevent) to the platform
// dependent native API, so the web page can receive these key codes
// thereafter.
RequestKeyboardLock(array<string> key_codes)
=> (KeyboardLockRequestResult result);
// Removes all reserved keys. This function is expected to never fail.
CancelKeyboardLock();
// Requests the keyboard layout mapping for the highest-priority ASCII-capable
// installed layout.
GetKeyboardLayoutMap() => (GetKeyboardLayoutMapResult result);
};