| 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(OS_MACOSX) | 40 #elif defined(OS_MACOSX) |
| 41 // TODO(dhollowa): Implement on Mac. http://crbug.com/109946 | 41 // TODO(dhollowa): Implement on Mac. http://crbug.com/109946 |
| 42 #elif defined(USE_AURA) | |
| 43 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | |
| 44 XEvent* xev) OVERRIDE; | |
| 45 #endif | 42 #endif |
| 46 | 43 |
| 47 private: | 44 private: |
| 48 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
| 49 // The keys currently pressed and consumed by the FocusManager. | 46 // The keys currently pressed and consumed by the FocusManager. |
| 50 std::set<WPARAM> pressed_keys_; | 47 std::set<WPARAM> pressed_keys_; |
| 51 #endif | 48 #endif |
| 52 | 49 |
| 53 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); | 50 DISALLOW_COPY_AND_ASSIGN(AcceleratorHandler); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 } // namespace views | 53 } // namespace views |
| 57 | 54 |
| 58 #endif // UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ | 55 #endif // UI_VIEWS_FOCUS_ACCELERATOR_HANDLER_H_ |
| OLD | NEW |