| Index: ui/wm/core/compound_event_filter.cc
|
| diff --git a/ui/wm/core/compound_event_filter.cc b/ui/wm/core/compound_event_filter.cc
|
| index 0e655257a32558c86f56f84a353eda1b35b61389..d487b1a7d1b6361e40aab901f4cd995400c35ef2 100644
|
| --- a/ui/wm/core/compound_event_filter.cc
|
| +++ b/ui/wm/core/compound_event_filter.cc
|
| @@ -129,29 +129,26 @@ void CompoundEventFilter::UpdateCursor(aura::Window* target,
|
| }
|
|
|
| void CompoundEventFilter::FilterKeyEvent(ui::KeyEvent* event) {
|
| - if (handlers_.might_have_observers()) {
|
| - base::ObserverListBase<ui::EventHandler>::Iterator it(&handlers_);
|
| - ui::EventHandler* handler;
|
| - while (!event->stopped_propagation() && (handler = it.GetNext()) != NULL)
|
| - handler->OnKeyEvent(event);
|
| + for (ui::EventHandler& handler : handlers_) {
|
| + if (event->stopped_propagation())
|
| + break;
|
| + handler.OnKeyEvent(event);
|
| }
|
| }
|
|
|
| void CompoundEventFilter::FilterMouseEvent(ui::MouseEvent* event) {
|
| - if (handlers_.might_have_observers()) {
|
| - base::ObserverListBase<ui::EventHandler>::Iterator it(&handlers_);
|
| - ui::EventHandler* handler;
|
| - while (!event->stopped_propagation() && (handler = it.GetNext()) != NULL)
|
| - handler->OnMouseEvent(event);
|
| + for (ui::EventHandler& handler : handlers_) {
|
| + if (event->stopped_propagation())
|
| + break;
|
| + handler.OnMouseEvent(event);
|
| }
|
| }
|
|
|
| void CompoundEventFilter::FilterTouchEvent(ui::TouchEvent* event) {
|
| - if (handlers_.might_have_observers()) {
|
| - base::ObserverListBase<ui::EventHandler>::Iterator it(&handlers_);
|
| - ui::EventHandler* handler;
|
| - while (!event->stopped_propagation() && (handler = it.GetNext()) != NULL)
|
| - handler->OnTouchEvent(event);
|
| + for (ui::EventHandler& handler : handlers_) {
|
| + if (event->stopped_propagation())
|
| + break;
|
| + handler.OnTouchEvent(event);
|
| }
|
| }
|
|
|
| @@ -240,11 +237,10 @@ void CompoundEventFilter::OnTouchEvent(ui::TouchEvent* event) {
|
| }
|
|
|
| void CompoundEventFilter::OnGestureEvent(ui::GestureEvent* event) {
|
| - if (handlers_.might_have_observers()) {
|
| - base::ObserverListBase<ui::EventHandler>::Iterator it(&handlers_);
|
| - ui::EventHandler* handler;
|
| - while (!event->stopped_propagation() && (handler = it.GetNext()) != NULL)
|
| - handler->OnGestureEvent(event);
|
| + for (ui::EventHandler& handler : handlers_) {
|
| + if (event->stopped_propagation())
|
| + break;
|
| + handler.OnGestureEvent(event);
|
| }
|
| }
|
|
|
|
|