Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / events / keyboard_driven_event_rewriter.h
blob69016d9c26a0f69bdebbfb99a1166e3110c287e2
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
6 #define CHROME_BROWSER_CHROMEOS_EVENTS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_
8 #include "ui/events/event_rewriter.h"
10 namespace chromeos {
12 // KeyboardDrivenEventRewriter removes the modifier flags from
13 // Shift+<Arrow keys|Enter|F6> key events. This mapping only happens
14 // on login screen and only when the keyboard driven oobe is enabled.
15 class KeyboardDrivenEventRewriter : public ui::EventRewriter {
16 public:
17 KeyboardDrivenEventRewriter();
18 ~KeyboardDrivenEventRewriter() override;
20 // Calls Rewrite for testing.
21 ui::EventRewriteStatus RewriteForTesting(const ui::Event& event,
22 scoped_ptr<ui::Event>* new_event);
24 // EventRewriter overrides:
25 ui::EventRewriteStatus RewriteEvent(
26 const ui::Event& event,
27 scoped_ptr<ui::Event>* new_event) override;
28 ui::EventRewriteStatus NextDispatchEvent(
29 const ui::Event& last_event,
30 scoped_ptr<ui::Event>* new_event) override;
32 private:
33 ui::EventRewriteStatus Rewrite(const ui::Event& event,
34 scoped_ptr<ui::Event>* new_event);
36 DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenEventRewriter);
39 } // namespace chromeos
41 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_