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 UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 5 #ifndef UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
6 #define UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 6 #define UI_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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
29 class VIEWS_EXPORT AcceleratorHandler { | 29 class VIEWS_EXPORT AcceleratorHandler { |
30 #else | 30 #else |
31 class VIEWS_EXPORT AcceleratorHandler : public MessageLoop::Dispatcher { | 31 class VIEWS_EXPORT AcceleratorHandler : public MessageLoop::Dispatcher { |
32 #endif // defined(OS_MACOSX) | 32 #endif // defined(OS_MACOSX) |
33 public: | 33 public: |
34 AcceleratorHandler(); | 34 AcceleratorHandler(); |
35 | 35 |
36 // Dispatcher method. This returns true if an accelerator was processed by the | 36 // Dispatcher method. This returns true if an accelerator was processed by the |
37 // focus manager | 37 // focus manager |
38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) || defined(USE_AURA) |
39 virtual bool Dispatch(const MSG& msg) OVERRIDE; | 39 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
40 #elif defined(USE_WAYLAND) | 40 #elif defined(USE_WAYLAND) |
41 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | 41 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( |
42 base::wayland::WaylandEvent* ev) OVERRIDE; | 42 base::wayland::WaylandEvent* ev) OVERRIDE; |
43 #elif defined(OS_MACOSX) | 43 #elif defined(OS_MACOSX) |
44 // TODO(dhollowa): Implement on Mac. http://crbug.com/109946 | 44 // TODO(dhollowa): Implement on Mac. http://crbug.com/109946 |
45 #elif defined(USE_AURA) | |
46 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | |
47 XEvent* xev) OVERRIDE; | |
48 #endif | 45 #endif |
49 | 46 |
50 private: | 47 private: |
51 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
52 // The keys currently pressed and consumed by the FocusManager. | 49 // The keys currently pressed and consumed by the FocusManager. |
53 std::set<WPARAM> pressed_keys_; | 50 std::set<WPARAM> pressed_keys_; |
54 #endif | 51 #endif |
55 | 52 |
56 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); | 53 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); |
57 }; | 54 }; |
58 | 55 |
59 } // namespace views | 56 } // namespace views |
60 | 57 |
61 #endif // UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 58 #endif // UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
OLD | NEW |