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

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

Issue 2586333003: Make mash register initial batch of accelerators in single shot. (Closed)
Patch Set: Fix comments. Move inline function to .h 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: 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..19075df17fe7b1820b3042b4e80478cf2d05e548 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"
@@ -38,12 +39,20 @@ class AcceleratorControllerRegistrar : public AcceleratorHandler,
ui::mojom::EventResult OnAccelerator(uint32_t id,
const ui::Event& event) override;
+ private:
+ friend class AcceleratorControllerRegistrarTestApi;
+
// ui::AcceleratorManagerDelegate:
- void OnAcceleratorRegistered(const ui::Accelerator& accelerator) override;
+ void OnAcceleratorsRegistered(
+ const std::vector<ui::Accelerator>& accelerators) override;
void OnAcceleratorUnregistered(const ui::Accelerator& accelerator) override;
- private:
- friend class AcceleratorControllerRegistrarTestApi;
+ // Generate id and add the corresponding accelerator to accelerator vector.
+ // Creates a PRE_TARGET and POST_TARGET mojom accelerators for the provided
+ // |accelerator| and adds them to the provided |accelerator_vector|.
+ void AddAcceleratorToVector(
+ const ui::Accelerator& accelerator,
+ std::vector<ui::mojom::AcceleratorPtr>& accelerator_vector);
// The flow of accelerators in ash is:
// . wm::AcceleratorFilter() sees events first as it's a pre-target handler.
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/mus/accelerators/accelerator_controller_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698