| 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/events/event_target.h" | 5 #include "ui/events/event_target.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 void EventTarget::RemovePostTargetHandler(EventHandler* handler) { | 42 void EventTarget::RemovePostTargetHandler(EventHandler* handler) { |
| 43 EventHandlerList::iterator find = | 43 EventHandlerList::iterator find = |
| 44 std::find(post_target_list_.begin(), | 44 std::find(post_target_list_.begin(), |
| 45 post_target_list_.end(), | 45 post_target_list_.end(), |
| 46 handler); | 46 handler); |
| 47 if (find != post_target_list_.end()) | 47 if (find != post_target_list_.end()) |
| 48 post_target_list_.erase(find); | 48 post_target_list_.erase(find); |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool EventTarget::IsPreTargetListEmpty() const { |
| 52 return pre_target_list_.empty(); |
| 53 } |
| 54 |
| 51 void EventTarget::OnEvent(Event* event) { | 55 void EventTarget::OnEvent(Event* event) { |
| 52 CHECK_EQ(this, event->target()); | 56 CHECK_EQ(this, event->target()); |
| 53 if (target_handler_) | 57 if (target_handler_) |
| 54 target_handler_->OnEvent(event); | 58 target_handler_->OnEvent(event); |
| 55 else | 59 else |
| 56 EventHandler::OnEvent(event); | 60 EventHandler::OnEvent(event); |
| 57 } | 61 } |
| 58 | 62 |
| 59 void EventTarget::OnKeyEvent(KeyEvent* event) { | 63 void EventTarget::OnKeyEvent(KeyEvent* event) { |
| 60 CHECK_EQ(this, event->target()); | 64 CHECK_EQ(this, event->target()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 while (target) { | 109 while (target) { |
| 106 for (EventHandlerList::iterator it = target->post_target_list_.begin(), | 110 for (EventHandlerList::iterator it = target->post_target_list_.begin(), |
| 107 end = target->post_target_list_.end(); it != end; ++it) { | 111 end = target->post_target_list_.end(); it != end; ++it) { |
| 108 list->push_back(*it); | 112 list->push_back(*it); |
| 109 } | 113 } |
| 110 target = target->GetParentTarget(); | 114 target = target->GetParentTarget(); |
| 111 } | 115 } |
| 112 } | 116 } |
| 113 | 117 |
| 114 } // namespace ui | 118 } // namespace ui |
| OLD | NEW |