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

Unified Diff: services/ui/ws/event_dispatcher.cc

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Use AddAccelerator() in AddAccelerators(). 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: services/ui/ws/event_dispatcher.cc
diff --git a/services/ui/ws/event_dispatcher.cc b/services/ui/ws/event_dispatcher.cc
index d6536cc9c8c5f50dd0a89caa1f0adcf42e9ded33..837cd3275ebbbde8c48cde803e02373588c3281d 100644
--- a/services/ui/ws/event_dispatcher.cc
+++ b/services/ui/ws/event_dispatcher.cc
@@ -256,6 +256,16 @@ bool EventDispatcher::AddAccelerator(uint32_t id,
return true;
}
+bool EventDispatcher::AddAccelerators(
+ std::vector<ui::mojom::AcceleratorPtr> accelerators) {
+ bool all_new_accelerators = true;
+ for (auto iter = accelerators.begin(); iter != accelerators.end(); ++iter) {
+ if (!AddAccelerator(iter->get()->id, iter->get()->event_matcher.Clone()))
+ all_new_accelerators = false;
+ }
+ return all_new_accelerators;
+}
+
void EventDispatcher::RemoveAccelerator(uint32_t id) {
auto it = accelerators_.find(id);
// Clients may pass bogus ids.

Powered by Google App Engine
This is Rietveld 408576698