| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ | 5 #ifndef ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ |
| 6 #define ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ | 6 #define ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // with the WindowManager, as well as routing handling of accelerators to | 29 // with the WindowManager, as well as routing handling of accelerators to |
| 30 // the right place. | 30 // the right place. |
| 31 class AcceleratorControllerRegistrar : public AcceleratorHandler, | 31 class AcceleratorControllerRegistrar : public AcceleratorHandler, |
| 32 public ui::AcceleratorManagerDelegate { | 32 public ui::AcceleratorManagerDelegate { |
| 33 public: | 33 public: |
| 34 AcceleratorControllerRegistrar(WindowManager* window_manager, | 34 AcceleratorControllerRegistrar(WindowManager* window_manager, |
| 35 uint16_t id_namespace); | 35 uint16_t id_namespace); |
| 36 ~AcceleratorControllerRegistrar() override; | 36 ~AcceleratorControllerRegistrar() override; |
| 37 | 37 |
| 38 // AcceleratorHandler: | 38 // AcceleratorHandler: |
| 39 ui::mojom::EventResult OnAccelerator(uint32_t id, | 39 ui::mojom::EventResult OnAccelerator( |
| 40 const ui::Event& event) override; | 40 uint32_t id, |
| 41 const ui::Event& event, |
| 42 std::unordered_map<std::string, std::vector<uint8_t>>* properties) |
| 43 override; |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 friend class AcceleratorControllerRegistrarTestApi; | 46 friend class AcceleratorControllerRegistrarTestApi; |
| 44 | 47 |
| 45 // ui::AcceleratorManagerDelegate: | 48 // ui::AcceleratorManagerDelegate: |
| 46 void OnAcceleratorsRegistered( | 49 void OnAcceleratorsRegistered( |
| 47 const std::vector<ui::Accelerator>& accelerators) override; | 50 const std::vector<ui::Accelerator>& accelerators) override; |
| 48 void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override; | 51 void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override; |
| 49 | 52 |
| 50 // Generate id and add the corresponding accelerator to accelerator vector. | 53 // Generate id and add the corresponding accelerator to accelerator vector. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Maps from accelerator to the two ids registered for it. | 104 // Maps from accelerator to the two ids registered for it. |
| 102 std::map<ui::Accelerator, Ids> accelerator_to_ids_; | 105 std::map<ui::Accelerator, Ids> accelerator_to_ids_; |
| 103 | 106 |
| 104 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerRegistrar); | 107 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerRegistrar); |
| 105 }; | 108 }; |
| 106 | 109 |
| 107 } // namespace mus | 110 } // namespace mus |
| 108 } // namespace ash | 111 } // namespace ash |
| 109 | 112 |
| 110 #endif // ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ | 113 #endif // ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ |
| OLD | NEW |