| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/event_source.h" | 5 #include "ui/events/event_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/events/event_processor.h" | 9 #include "ui/events/event_processor.h" |
| 10 #include "ui/events/event_rewriter.h" | 10 #include "ui/events/event_rewriter.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 while (status == EVENT_REWRITE_DISPATCH_ANOTHER) { | 55 while (status == EVENT_REWRITE_DISPATCH_ANOTHER) { |
| 56 std::unique_ptr<Event> new_event; | 56 std::unique_ptr<Event> new_event; |
| 57 status = (*it)->NextDispatchEvent(*rewritten_event, &new_event); | 57 status = (*it)->NextDispatchEvent(*rewritten_event, &new_event); |
| 58 if (status == EVENT_REWRITE_DISCARD) | 58 if (status == EVENT_REWRITE_DISCARD) |
| 59 return EventDispatchDetails(); | 59 return EventDispatchDetails(); |
| 60 CHECK_NE(EVENT_REWRITE_CONTINUE, status); | 60 CHECK_NE(EVENT_REWRITE_CONTINUE, status); |
| 61 CHECK(new_event); | 61 CHECK(new_event); |
| 62 details = DeliverEventToProcessor(new_event.get()); | 62 details = DeliverEventToProcessor(new_event.get()); |
| 63 if (details.dispatcher_destroyed) | 63 if (details.dispatcher_destroyed) |
| 64 return details; | 64 return details; |
| 65 rewritten_event.reset(new_event.release()); | 65 rewritten_event = std::move(new_event); |
| 66 } | 66 } |
| 67 return EventDispatchDetails(); | 67 return EventDispatchDetails(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 EventDispatchDetails EventSource::DeliverEventToProcessor(Event* event) { | 70 EventDispatchDetails EventSource::DeliverEventToProcessor(Event* event) { |
| 71 EventProcessor* processor = GetEventProcessor(); | 71 EventProcessor* processor = GetEventProcessor(); |
| 72 CHECK(processor); | 72 CHECK(processor); |
| 73 return processor->OnEventFromSource(event); | 73 return processor->OnEventFromSource(event); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace ui | 76 } // namespace ui |
| OLD | NEW |