summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/keyboard_driven_event_rewriter.h
blob: be274c07b6fbb6e0dcd68b6fac26c855609b8820 (plain)
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
// Copyright 2013 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 CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
#define CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_

#include "base/basictypes.h"

namespace ui {
class KeyEvent;
}

namespace chromeos {

// KeyboardDrivenEventRewriter removes the modifier flags from
// Ctrl+Alt+Shift+<Arrow keys|Enter> key events. This mapping only happens
// on login screen and only when the keyboard driven oobe flag is enabled in the
// OEM manifest.
class KeyboardDrivenEventRewriter {
 public:
  KeyboardDrivenEventRewriter();
  ~KeyboardDrivenEventRewriter();

  // Calls RewriteEvent to modify |event| if it is on login screen and the
  // keyboard driven flag is enabled.
  void RewriteIfKeyboardDrivenOnLoginScreen(ui::KeyEvent* event);

  // Calls RewriteEvent for testing.
  void RewriteForTesting(ui::KeyEvent* event);

 private:
  void RewriteEvent(ui::KeyEvent* event);

  DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenEventRewriter);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_