forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscoped_simple_keyboard_hook.h
41 lines (31 loc) · 1.27 KB
/
scoped_simple_keyboard_hook.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2018 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 UI_AURA_SCOPED_SIMPLE_KEYBOARD_HOOK_H_
#define UI_AURA_SCOPED_SIMPLE_KEYBOARD_HOOK_H_
#include "base/containers/flat_set.h"
#include "base/macros.h"
#include "base/optional.h"
#include "ui/aura/scoped_keyboard_hook.h"
namespace ui {
enum class DomCode;
}
namespace aura {
// This subclass of ScopedKeyboardHook will not set up a system-level keyboard
// hook or call into any WindowTreeHost methods for lock state or cleanup.
// It allows for disabling system-level keyboard lock functionality while
// continuing to support browser-level keyboard lock.
// TODO(joedow): Remove this class after 'system-keyboard-lock' is removed.
class ScopedSimpleKeyboardHook : public ScopedKeyboardHook {
public:
explicit ScopedSimpleKeyboardHook(
base::Optional<base::flat_set<ui::DomCode>> dom_codes);
~ScopedSimpleKeyboardHook() override;
// ScopedKeyboardHook override.
bool IsKeyLocked(ui::DomCode dom_code) override;
private:
base::Optional<base::flat_set<ui::DomCode>> dom_codes_;
DISALLOW_COPY_AND_ASSIGN(ScopedSimpleKeyboardHook);
};
} // namespace aura
#endif // UI_AURA_SCOPED_SIMPLE_KEYBOARD_HOOK_H_