| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // ui::AcceleratorManagerDelegate: | 45 // ui::AcceleratorManagerDelegate: |
| 46 void OnAcceleratorsRegistered( | 46 void OnAcceleratorsRegistered( |
| 47 const std::vector<ui::Accelerator>& accelerators) override; | 47 const std::vector<ui::Accelerator>& accelerators) override; |
| 48 void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override; | 48 void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override; |
| 49 | 49 |
| 50 // Generate id and add the corresponding accelerator to accelerator vector. | 50 // Generate id and add the corresponding accelerator to accelerator vector. |
| 51 // Creates a PRE_TARGET and POST_TARGET mojom accelerators for the provided | 51 // Creates a PRE_TARGET and POST_TARGET mojom accelerators for the provided |
| 52 // |accelerator| and adds them to the provided |accelerator_vector|. | 52 // |accelerator| and adds them to the provided |accelerator_vector|. |
| 53 void AddAcceleratorToVector( | 53 void AddAcceleratorToVector( |
| 54 const ui::Accelerator& accelerator, | 54 const ui::Accelerator& accelerator, |
| 55 std::vector<ui::mojom::AcceleratorPtr>& accelerator_vector); | 55 std::vector<ui::mojom::WmAcceleratorPtr>& accelerator_vector); |
| 56 | 56 |
| 57 // The flow of accelerators in ash is: | 57 // The flow of accelerators in ash is: |
| 58 // . wm::AcceleratorFilter() sees events first as it's a pre-target handler. | 58 // . wm::AcceleratorFilter() sees events first as it's a pre-target handler. |
| 59 // . AcceleratorFilter forwards to its delegate, which indirectly is | 59 // . AcceleratorFilter forwards to its delegate, which indirectly is |
| 60 // implemented by AcceleratorRouter. | 60 // implemented by AcceleratorRouter. |
| 61 // . AcceleratorRouter may early out, if not it calls through to | 61 // . AcceleratorRouter may early out, if not it calls through to |
| 62 // AcceleratorController. This stop may stop propagation entirely. | 62 // AcceleratorController. This stop may stop propagation entirely. |
| 63 // . If focus is on a Widget, then NativeWidgetAura gets the key event, calls | 63 // . If focus is on a Widget, then NativeWidgetAura gets the key event, calls |
| 64 // to Widget::OnKeyEvent(), which calls to FocusManager::OnKeyEvent(), which | 64 // to Widget::OnKeyEvent(), which calls to FocusManager::OnKeyEvent(), which |
| 65 // calls to AshFocusManagerFactory::Delegate::ProcessAccelerator() finally | 65 // calls to AshFocusManagerFactory::Delegate::ProcessAccelerator() finally |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Maps from accelerator to the two ids registered for it. | 101 // Maps from accelerator to the two ids registered for it. |
| 102 std::map<ui::Accelerator, Ids> accelerator_to_ids_; | 102 std::map<ui::Accelerator, Ids> accelerator_to_ids_; |
| 103 | 103 |
| 104 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerRegistrar); | 104 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerRegistrar); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace mus | 107 } // namespace mus |
| 108 } // namespace ash | 108 } // namespace ash |
| 109 | 109 |
| 110 #endif // ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ | 110 #endif // ASH_MUS_ACCELERATORS_ACCELERATOR_CONTROLLER_REGISTRAR_H_ |
| OLD | NEW |