OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/view.h" | 9 #include "views/view.h" |
10 #include "chrome/common/native_web_keyboard_event.h" | 10 #include "content/common/native_web_keyboard_event.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 class FocusManager; | 13 class FocusManager; |
14 } // namespace views | 14 } // namespace views |
15 | 15 |
16 // This class handles unhandled keyboard messages coming back from the renderer | 16 // This class handles unhandled keyboard messages coming back from the renderer |
17 // process. | 17 // process. |
18 class UnhandledKeyboardEventHandler { | 18 class UnhandledKeyboardEventHandler { |
19 public: | 19 public: |
20 UnhandledKeyboardEventHandler(); | 20 UnhandledKeyboardEventHandler(); |
21 ~UnhandledKeyboardEventHandler(); | 21 ~UnhandledKeyboardEventHandler(); |
22 | 22 |
23 void HandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 23 void HandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
24 views::FocusManager* focus_manager); | 24 views::FocusManager* focus_manager); |
25 | 25 |
26 private: | 26 private: |
27 // Whether to ignore the next Char keyboard event. | 27 // Whether to ignore the next Char keyboard event. |
28 // If a RawKeyDown event was handled as a shortcut key, then we're done | 28 // If a RawKeyDown event was handled as a shortcut key, then we're done |
29 // handling it and should eat any Char event that the translate phase may | 29 // handling it and should eat any Char event that the translate phase may |
30 // have produced from it. (Handling this event may cause undesirable effects, | 30 // have produced from it. (Handling this event may cause undesirable effects, |
31 // such as a beep if DefWindowProc() has no default handling for the given | 31 // such as a beep if DefWindowProc() has no default handling for the given |
32 // Char.) | 32 // Char.) |
33 bool ignore_next_char_event_; | 33 bool ignore_next_char_event_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(UnhandledKeyboardEventHandler); | 35 DISALLOW_COPY_AND_ASSIGN(UnhandledKeyboardEventHandler); |
36 }; | 36 }; |
37 | 37 |
38 #endif // CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ | 38 #endif // CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ |
OLD | NEW |