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

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

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Use std::move instead of Clone() 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
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | ui/aura/mus/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index b75af49bd5a53f81d357dec13b367f902cab3220..ab1a67b302ed0827276714f8ea9cf8bf82646d0b 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -1705,13 +1705,17 @@ void WindowTree::CancelWindowMove(Id window_id) {
window_server_->GetCurrentMoveLoopChangeId());
}
-void WindowTree::AddAccelerator(uint32_t id,
- mojom::EventMatcherPtr event_matcher,
- const AddAcceleratorCallback& callback) {
+void WindowTree::AddAccelerators(
+ std::vector<mojom::AcceleratorPtr> accelerators,
+ const AddAcceleratorsCallback& callback) {
DCHECK(window_manager_state_);
- const bool success =
- window_manager_state_->event_dispatcher()->AddAccelerator(
- id, std::move(event_matcher));
+
+ bool success = true;
+ for (auto iter = accelerators.begin(); iter != accelerators.end(); ++iter) {
+ if (!window_manager_state_->event_dispatcher()->AddAccelerator(
+ iter->get()->id, std::move(iter->get()->event_matcher)))
+ success = false;
+ }
callback.Run(success);
}
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | ui/aura/mus/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698