OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 5 #ifndef VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 6 #define VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_LINUX) | 11 #if defined(OS_LINUX) |
12 #include <gdk/gdk.h> | 12 #include <gdk/gdk.h> |
13 #endif | 13 #endif |
14 | 14 |
15 #include <set> | 15 #include <set> |
16 | 16 |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 | 18 |
19 namespace views { | 19 namespace views { |
20 | 20 |
| 21 #if defined(TOUCH_UI) |
| 22 // Dispatch an XEvent to the RootView. Return true if the event was dispatched |
| 23 // and handled, false otherwise. |
| 24 bool DispatchXEvent(XEvent* xevent); |
| 25 #endif |
| 26 |
21 // This class delegates the key messages to the associated FocusManager class | 27 // This class delegates the key messages to the associated FocusManager class |
22 // for the window that is receiving these messages for accelerator processing. | 28 // for the window that is receiving these messages for accelerator processing. |
23 class AcceleratorHandler : public MessageLoopForUI::Dispatcher { | 29 class AcceleratorHandler : public MessageLoopForUI::Dispatcher { |
24 public: | 30 public: |
25 AcceleratorHandler(); | 31 AcceleratorHandler(); |
26 // Dispatcher method. This returns true if an accelerator was processed by the | 32 // Dispatcher method. This returns true if an accelerator was processed by the |
27 // focus manager | 33 // focus manager |
28 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
29 virtual bool Dispatch(const MSG& msg); | 35 virtual bool Dispatch(const MSG& msg); |
30 #else | 36 #else |
31 virtual bool Dispatch(GdkEvent* event); | 37 virtual bool Dispatch(GdkEvent* event); |
| 38 #if defined(TOUCH_UI) |
| 39 virtual bool Dispatch(XEvent* xev); |
| 40 #endif |
32 #endif | 41 #endif |
33 | 42 |
34 private: | 43 private: |
35 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
36 // The keys currently pressed and consumed by the FocusManager. | 45 // The keys currently pressed and consumed by the FocusManager. |
37 std::set<WPARAM> pressed_keys_; | 46 std::set<WPARAM> pressed_keys_; |
38 #endif | 47 #endif |
39 | 48 |
40 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); | 49 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); |
41 }; | 50 }; |
42 | 51 |
43 } // namespace views | 52 } // namespace views |
44 | 53 |
45 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 54 #endif // VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
OLD | NEW |