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

Unified Diff: ui/base/accelerators/accelerator_manager.h

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: fix nits/format and refactor AcceleratorControllerTest.Register. 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/accelerators/accelerator_manager.h
diff --git a/ui/base/accelerators/accelerator_manager.h b/ui/base/accelerators/accelerator_manager.h
index 9db9629fd8ecc8a9aabf7fa974fe15f1af2cdd75..42ab5d5a02bb377aaf023f2d2553723be27b1d2e 100644
--- a/ui/base/accelerators/accelerator_manager.h
+++ b/ui/base/accelerators/accelerator_manager.h
@@ -8,6 +8,7 @@
#include <list>
#include <map>
#include <utility>
+#include <vector>
#include "base/macros.h"
#include "ui/base/accelerators/accelerator.h"
@@ -30,10 +31,10 @@ class UI_BASE_EXPORT AcceleratorManager {
explicit AcceleratorManager(AcceleratorManagerDelegate* = nullptr);
~AcceleratorManager();
- // Register a keyboard accelerator for the specified target. If multiple
+ // Register keyboard accelerators for the specified target. If multiple
// targets are registered for an accelerator, a target registered later has
// higher priority.
- // |accelerator| is the accelerator to register.
+ // |accelerators| contain accelerators to register.
// |priority| denotes the priority of the handler.
// NOTE: In almost all cases, you should specify kNormalPriority for this
// parameter. Setting it to kHighPriority prevents Chrome from sending the
@@ -47,7 +48,7 @@ class UI_BASE_EXPORT AcceleratorManager {
// - the enter key
// - any F key (F1, F2, F3 ...)
// - any browser specific keys (as available on special keyboards)
- void Register(const Accelerator& accelerator,
+ void Register(const std::vector<ui::Accelerator>& accelerators,
HandlerPriority priority,
sky 2017/01/27 19:11:14 Each accelerator may want a different priority, so
mfomitchev 2017/01/27 23:12:01 We don't currently have a use case for registering
sky 2017/01/28 00:09:15 Given we don't have a need for it now, I'm ok with
thanhph1 2017/01/30 16:37:54 I can't use the same name Register for inline func
AcceleratorTarget* target);

Powered by Google App Engine
This is Rietveld 408576698