| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/events/event_dispatcher.h" | 5 #include "ui/base/events/event_dispatcher.h" |
| 6 | 6 |
| 7 namespace ui { | 7 namespace ui { |
| 8 | 8 |
| 9 EventDispatcher::EventDispatcher() | 9 EventDispatcher::EventDispatcher() |
| 10 : set_on_destroy_(NULL), | 10 : set_on_destroy_(NULL), |
| 11 current_event_(NULL) { | 11 current_event_(NULL) { |
| 12 } | 12 } |
| 13 | 13 |
| 14 EventDispatcher::~EventDispatcher() { | 14 EventDispatcher::~EventDispatcher() { |
| 15 if (set_on_destroy_) | 15 if (set_on_destroy_) |
| 16 *set_on_destroy_ = true; | 16 *set_on_destroy_ = true; |
| 17 } | 17 } |
| 18 | 18 |
| 19 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 20 // EventDispatcher, private: | 20 // EventDispatcher, private: |
| 21 | 21 |
| 22 EventResult EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, | 22 void EventDispatcher::DispatchEventToSingleHandler(EventHandler* handler, |
| 23 Event* event) { | 23 Event* event) { |
| 24 return handler->OnEvent(event); | 24 handler->OnEvent(event); |
| 25 } | 25 } |
| 26 | 26 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 28 // EventDispatcher::ScopedDispatchHelper | 28 // EventDispatcher::ScopedDispatchHelper |
| 29 | 29 |
| 30 EventDispatcher::ScopedDispatchHelper::ScopedDispatchHelper(Event* event) | 30 EventDispatcher::ScopedDispatchHelper::ScopedDispatchHelper(Event* event) |
| 31 : Event::DispatcherApi(event) { | 31 : Event::DispatcherApi(event) { |
| 32 set_result(ui::ER_UNHANDLED); |
| 32 } | 33 } |
| 33 | 34 |
| 34 EventDispatcher::ScopedDispatchHelper::~ScopedDispatchHelper() { | 35 EventDispatcher::ScopedDispatchHelper::~ScopedDispatchHelper() { |
| 35 set_phase(EP_POSTDISPATCH); | 36 set_phase(EP_POSTDISPATCH); |
| 36 } | 37 } |
| 37 | 38 |
| 38 } // namespace ui | 39 } // namespace ui |
| OLD | NEW |