OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/browser/native_web_keyboard_event.h" | 9 #include "content/public/browser/native_web_keyboard_event.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.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 content::NativeWebKeyboardEvent& event, |
24 views::FocusManager* focus_manager); | 24 views::FocusManager* focus_manager); |
25 | 25 |
26 private: | 26 private: |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 // Whether to ignore the next Char keyboard event. | 28 // Whether to ignore the next Char keyboard event. |
29 // If a RawKeyDown event was handled as a shortcut key, then we're done | 29 // If a RawKeyDown event was handled as a shortcut key, then we're done |
30 // handling it and should eat any Char event that the translate phase may | 30 // handling it and should eat any Char event that the translate phase may |
31 // have produced from it. (Handling this event may cause undesirable effects, | 31 // have produced from it. (Handling this event may cause undesirable effects, |
32 // such as a beep if DefWindowProc() has no default handling for the given | 32 // such as a beep if DefWindowProc() has no default handling for the given |
33 // Char.) | 33 // Char.) |
34 bool ignore_next_char_event_; | 34 bool ignore_next_char_event_; |
35 #endif | 35 #endif |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(UnhandledKeyboardEventHandler); | 37 DISALLOW_COPY_AND_ASSIGN(UnhandledKeyboardEventHandler); |
38 }; | 38 }; |
39 | 39 |
40 #endif // CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ | 40 #endif // CHROME_BROWSER_UI_VIEWS_UNHANDLED_KEYBOARD_EVENT_HANDLER_H_ |
OLD | NEW |