Home | History | Annotate | Download | only in chromeos
      1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
      6 #define CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
      7 
      8 #include "base/basictypes.h"
      9 
     10 namespace ui {
     11 class KeyEvent;
     12 }
     13 
     14 namespace chromeos {
     15 
     16 // KeyboardDrivenEventRewriter removes the modifier flags from
     17 // Ctrl+Alt+Shift+<Arrow keys|Enter> key events. This mapping only happens
     18 // on login screen and only when the keyboard driven oobe flag is enabled in the
     19 // OEM manifest.
     20 class KeyboardDrivenEventRewriter {
     21  public:
     22   KeyboardDrivenEventRewriter();
     23   ~KeyboardDrivenEventRewriter();
     24 
     25   // Calls RewriteEvent to modify |event| if it is on login screen and the
     26   // keyboard driven flag is enabled.
     27   void RewriteIfKeyboardDrivenOnLoginScreen(ui::KeyEvent* event);
     28 
     29   // Calls RewriteEvent for testing.
     30   void RewriteForTesting(ui::KeyEvent* event);
     31 
     32  private:
     33   void RewriteEvent(ui::KeyEvent* event);
     34 
     35   DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenEventRewriter);
     36 };
     37 
     38 }  // namespace chromeos
     39 
     40 #endif  // CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
     41