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

Unified Diff: ash/mus/accelerators/accelerator_controller_registrar.h

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: Change register to use accelerator vector. Created 4 years 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: ash/mus/accelerators/accelerator_controller_registrar.h
diff --git a/ash/mus/accelerators/accelerator_controller_registrar.h b/ash/mus/accelerators/accelerator_controller_registrar.h
index da2841f6979bc5b64bcfcb49f710e495ba346a34..8b8b2f26acf1cdd50303d7db19f3fc4fbd86a1af 100644
--- a/ash/mus/accelerators/accelerator_controller_registrar.h
+++ b/ash/mus/accelerators/accelerator_controller_registrar.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <map>
+#include <vector>
#include "ash/mus/accelerators/accelerator_handler.h"
#include "base/macros.h"
@@ -39,9 +40,17 @@ class AcceleratorControllerRegistrar : public AcceleratorHandler,
const ui::Event& event) override;
// ui::AcceleratorManagerDelegate:
- void OnAcceleratorRegistered(const ui::Accelerator& accelerator) override;
+ // default add_accelerator_immediately = true
mfomitchev 2016/12/22 01:04:50 The comment doesn't add value - this is clear from
thanhph 2016/12/22 20:36:01 Done.
+ void OnAcceleratorRegistered(
+ const ui::Accelerator& accelerator,
+ bool add_accelerator_immediately = true) override;
void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override;
+ void OnAcceleratorsRegistered(
+ const std::vector<ui::Accelerator>& accelerators) override;
+ void OnAcceleratorsUnregistered(
mfomitchev 2016/12/22 01:04:50 Where is this actually called from?
thanhph 2016/12/22 20:36:01 This is called in accelerator_manager_unittest.cc
mfomitchev 2016/12/22 21:18:55 Line 99 is an implementation of OnAcceleratorsUnre
thanhph 2016/12/24 18:52:16 Done, thanks! I've removed it for now because it s
+ std::vector<ui::Accelerator>& accelerators) override;
+
private:
friend class AcceleratorControllerRegistrarTestApi;
@@ -86,6 +95,8 @@ class AcceleratorControllerRegistrar : public AcceleratorHandler,
std::unique_ptr<AcceleratorRouter> router_;
+ std::vector<ui::mojom::AcceleratorPtr> accelerator_ptrs_;
+
// Set of registered local ids.
std::set<uint16_t> ids_;

Powered by Google App Engine
This is Rietveld 408576698