OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 pref_service_for_testing_ = pref_service; | 68 pref_service_for_testing_ = pref_service; |
69 } | 69 } |
70 void set_ime_keyboard_for_testing( | 70 void set_ime_keyboard_for_testing( |
71 chromeos::input_method::ImeKeyboard* ime_keyboard) { | 71 chromeos::input_method::ImeKeyboard* ime_keyboard) { |
72 ime_keyboard_for_testing_ = ime_keyboard; | 72 ime_keyboard_for_testing_ = ime_keyboard; |
73 } | 73 } |
74 | 74 |
75 // EventRewriter overrides: | 75 // EventRewriter overrides: |
76 virtual ui::EventRewriteStatus RewriteEvent( | 76 virtual ui::EventRewriteStatus RewriteEvent( |
77 const ui::Event& event, | 77 const ui::Event& event, |
78 scoped_ptr<ui::Event>* rewritten_event) OVERRIDE; | 78 scoped_ptr<ui::Event>* rewritten_event) override; |
79 virtual ui::EventRewriteStatus NextDispatchEvent( | 79 virtual ui::EventRewriteStatus NextDispatchEvent( |
80 const ui::Event& last_event, | 80 const ui::Event& last_event, |
81 scoped_ptr<ui::Event>* new_event) OVERRIDE; | 81 scoped_ptr<ui::Event>* new_event) override; |
82 | 82 |
83 // Generate a new key event from an original key event and the replacement | 83 // Generate a new key event from an original key event and the replacement |
84 // key code and flags determined by a key rewriter. | 84 // key code and flags determined by a key rewriter. |
85 static void BuildRewrittenKeyEvent(const ui::KeyEvent& key_event, | 85 static void BuildRewrittenKeyEvent(const ui::KeyEvent& key_event, |
86 ui::KeyboardCode key_code, | 86 ui::KeyboardCode key_code, |
87 int flags, | 87 int flags, |
88 scoped_ptr<ui::Event>* rewritten_event); | 88 scoped_ptr<ui::Event>* rewritten_event); |
89 | 89 |
90 private: | 90 private: |
91 // Things that keyboard-related rewriter phases can change about an Event. | 91 // Things that keyboard-related rewriter phases can change about an Event. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // While the Diamond key is down, this holds the corresponding modifier | 188 // While the Diamond key is down, this holds the corresponding modifier |
189 // ui::EventFlags; otherwise it is EF_NONE. | 189 // ui::EventFlags; otherwise it is EF_NONE. |
190 int current_diamond_key_modifier_flags_; | 190 int current_diamond_key_modifier_flags_; |
191 | 191 |
192 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 192 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
193 }; | 193 }; |
194 | 194 |
195 } // namespace chromeos | 195 } // namespace chromeos |
196 | 196 |
197 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 197 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
OLD | NEW |