Chromium Code Reviews| Index: services/ui/ws/event_dispatcher.cc |
| diff --git a/services/ui/ws/event_dispatcher.cc b/services/ui/ws/event_dispatcher.cc |
| index 18d3dafec9e8931a6c7d07153eea00cb36ce9e12..252f519856142eebf6cf8f50d001b104dde273cb 100644 |
| --- a/services/ui/ws/event_dispatcher.cc |
| +++ b/services/ui/ws/event_dispatcher.cc |
| @@ -254,8 +254,17 @@ bool EventDispatcher::AddAccelerator(uint32_t id, |
| std::unique_ptr<Accelerator> accelerator(new Accelerator(id, *event_matcher)); |
| // If an accelerator with the same id or matcher already exists, then abort. |
| for (const auto& pair : accelerators_) { |
| - if (pair.first == id || accelerator->EqualEventMatcher(pair.second.get())) |
| + if (pair.first == id) { |
| + DVLOG(1) << "duplicate accelerator. Accelerator id=" << accelerator->id() |
|
mfomitchev
2017/01/24 22:56:03
duplicate accelerator -> duplicate accelerator id
thanhph1
2017/01/25 20:12:37
Done.
|
| + << " type=" << event_matcher->type_matcher->type |
| + << " flags=" << event_matcher->flags_matcher->flags; |
| return false; |
| + } else if (accelerator->EqualEventMatcher(pair.second.get())) { |
| + DVLOG(1) << "duplicate matcher. Accelerator id=" << accelerator->id() |
|
mfomitchev
2017/01/24 22:56:03
duplicate matcher -> duplicate accelerator matcher
mfomitchev
2017/01/24 22:56:03
Can we get rid of the duplicate code here? The onl
thanhph1
2017/01/25 20:12:37
Done.
thanhph1
2017/01/25 20:12:37
Done.
|
| + << " type=" << event_matcher->type_matcher->type |
| + << " flags=" << event_matcher->flags_matcher->flags; |
| + return false; |
| + } |
| } |
| accelerators_.insert(Entry(id, std::move(accelerator))); |
| return true; |