Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: ui/base/accelerators/accelerator_manager_delegate.h

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: remove unnecessary std::vector. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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) = 0;
mfomitchev 2017/01/24 22:56:03 This doesn't actually seem to be called anywhere a
thanhph1 2017/01/25 20:12:37 This is used in accelerator_controller_registrar.c
mfomitchev 2017/01/26 16:03:36 We don't call this method in accelerator_controlle
thanhph1 2017/01/26 19:33:38 Cool, thanks! I removed this function.
21 21
22 // Called when there no more targets are registered for |accelerator|. 22 // Called when there no more targets are registered for |accelerator|.
23 virtual void OnAcceleratorUnregistered(const Accelerator& accelerator) = 0; 23 virtual void OnAcceleratorUnregistered(const Accelerator& accelerator) = 0;
24 24
25 // Called when a number of accelerators are registered at once. An accelerator
26 // is only included in the |accelerators| vector when the first time a target
27 // for the accelerator is registered. For example, if Register() is called
28 // twice with the same accelerator, this is called only for the first call.
29 virtual void OnAcceleratorVectorRegistered(
30 const std::vector<ui::Accelerator>& accelerators) = 0;
31
25 protected: 32 protected:
26 virtual ~AcceleratorManagerDelegate() {} 33 virtual ~AcceleratorManagerDelegate() {}
27 }; 34 };
28 35
29 } // namespace ui 36 } // namespace ui
30 37
31 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_ 38 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698