Chromium Code Reviews| 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 UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ | 5 #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ |
| 6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ | 6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ui/base/ui_base_export.h" | 8 #include "ui/base/ui_base_export.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 class Accelerator; | 12 class Accelerator; |
| 13 | 13 |
| 14 class UI_BASE_EXPORT AcceleratorManagerDelegate { | 14 class UI_BASE_EXPORT AcceleratorManagerDelegate { |
| 15 public: | 15 public: |
| 16 // Called the first time a target is registered for |accelerator|. This is | 16 // Called the first time a target is registered for |accelerator|. This is |
| 17 // only called the first time a target is registered for a unique accelerator. | 17 // only called the first time a target is registered for a unique accelerator. |
| 18 // For example, if Register() is called twice with the same accelerator | 18 // For example, if Register() is called twice with the same accelerator |
| 19 // this is called only for the first call. | 19 // this is called only for the first call. |
| 20 virtual void OnAcceleratorRegistered(const Accelerator& accelerator) = 0; | 20 virtual void OnAcceleratorRegistered(const Accelerator& accelerator, |
| 21 bool add_accelerator_immediately) = 0; | |
| 21 | 22 |
| 22 // Called when there no more targets are registered for |accelerator|. | 23 // Called when there no more targets are registered for |accelerator|. |
| 23 virtual void OnAcceleratorUnregistered(const Accelerator& accelerator) = 0; | 24 virtual void OnAcceleratorUnregistered(const Accelerator& accelerator) = 0; |
| 24 | 25 |
| 26 virtual void OnAcceleratorsRegistered( | |
|
mfomitchev
2016/12/22 01:04:50
comment
thanhph
2016/12/22 20:36:02
Done.
| |
| 27 const std::vector<ui::Accelerator>& accelerators) = 0; | |
| 28 virtual void OnAcceleratorsUnregistered( | |
| 29 std::vector<ui::Accelerator>& accelerators) = 0; | |
| 30 | |
| 25 protected: | 31 protected: |
| 26 virtual ~AcceleratorManagerDelegate() {} | 32 virtual ~AcceleratorManagerDelegate() {} |
| 27 }; | 33 }; |
| 28 | 34 |
| 29 } // namespace ui | 35 } // namespace ui |
| 30 | 36 |
| 31 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ | 37 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ |
| OLD | NEW |