OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/aura/window_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 ui::EF_NONE); | 155 ui::EF_NONE); |
156 DispatchDetails details = | 156 DispatchDetails details = |
157 DispatchMouseEnterOrExit(event, ui::ET_MOUSE_EXITED); | 157 DispatchMouseEnterOrExit(event, ui::ET_MOUSE_EXITED); |
158 if (details.dispatcher_destroyed) | 158 if (details.dispatcher_destroyed) |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event, | 162 void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event, |
163 Window* window, | 163 Window* window, |
164 ui::EventResult result) { | 164 ui::EventResult result) { |
165 LOG(ERROR) << "WED::ProcessedTouchEvent, type=" << event->type(); | |
Daniel Erat
2014/04/18 00:44:08
delete, also below
| |
165 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; | 166 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; |
166 gestures.reset(ui::GestureRecognizer::Get()-> | 167 gestures.reset(ui::GestureRecognizer::Get()-> |
167 ProcessTouchEventForGesture(*event, result, window)); | 168 ProcessTouchEventForGesture(*event, result, window)); |
168 DispatchDetails details = ProcessGestures(gestures.get()); | 169 DispatchDetails details = ProcessGestures(gestures.get()); |
169 if (details.dispatcher_destroyed) | 170 if (details.dispatcher_destroyed) |
170 return; | 171 return; |
171 } | 172 } |
172 | 173 |
173 void WindowEventDispatcher::HoldPointerMoves() { | 174 void WindowEventDispatcher::HoldPointerMoves() { |
174 if (!move_hold_count_) | 175 if (!move_hold_count_) |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 void WindowEventDispatcher::PreDispatchMouseEvent(Window* target, | 726 void WindowEventDispatcher::PreDispatchMouseEvent(Window* target, |
726 ui::MouseEvent* event) { | 727 ui::MouseEvent* event) { |
727 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 728 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
728 // We allow synthesized mouse exit events through even if mouse events are | 729 // We allow synthesized mouse exit events through even if mouse events are |
729 // disabled. This ensures that hover state, etc on controls like buttons is | 730 // disabled. This ensures that hover state, etc on controls like buttons is |
730 // cleared. | 731 // cleared. |
731 if (cursor_client && | 732 if (cursor_client && |
732 !cursor_client->IsMouseEventsEnabled() && | 733 !cursor_client->IsMouseEventsEnabled() && |
733 (event->flags() & ui::EF_IS_SYNTHESIZED) && | 734 (event->flags() & ui::EF_IS_SYNTHESIZED) && |
734 (event->type() != ui::ET_MOUSE_EXITED)) { | 735 (event->type() != ui::ET_MOUSE_EXITED)) { |
736 LOG(ERROR) << "WindowEventDispatcher::PreDispatchMouseEvent - handled"; | |
735 event->SetHandled(); | 737 event->SetHandled(); |
736 return; | 738 return; |
737 } | 739 } |
738 | 740 |
739 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) { | 741 if (IsEventCandidateForHold(*event) && !dispatching_held_event_) { |
740 if (move_hold_count_) { | 742 if (move_hold_count_) { |
741 if (!(event->flags() & ui::EF_IS_SYNTHESIZED) && | 743 if (!(event->flags() & ui::EF_IS_SYNTHESIZED) && |
742 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) { | 744 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) { |
743 SetLastMouseLocation(window(), event->root_location()); | 745 SetLastMouseLocation(window(), event->root_location()); |
744 } | 746 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 break; | 855 break; |
854 | 856 |
855 default: | 857 default: |
856 NOTREACHED(); | 858 NOTREACHED(); |
857 break; | 859 break; |
858 } | 860 } |
859 PreDispatchLocatedEvent(target, event); | 861 PreDispatchLocatedEvent(target, event); |
860 } | 862 } |
861 | 863 |
862 } // namespace aura | 864 } // namespace aura |
OLD | NEW |