Chromium Code Reviews| 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..7405932301d2c24a171031f9497bd606d5803e4f 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, iter->get()->event_matcher.Clone())) |
|
mfomitchev
2016/12/02 22:19:02
use std::move instead of Clone()
thanhph
2016/12/02 22:26:21
Done, thanks!
|
| + success = false; |
| + } |
| callback.Run(success); |
| } |