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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 repost_event_factory_(this), | 85 repost_event_factory_(this), |
86 held_event_factory_(this) { | 86 held_event_factory_(this) { |
87 ui::GestureRecognizer::Get()->AddGestureEventHelper(this); | 87 ui::GestureRecognizer::Get()->AddGestureEventHelper(this); |
88 } | 88 } |
89 | 89 |
90 WindowEventDispatcher::~WindowEventDispatcher() { | 90 WindowEventDispatcher::~WindowEventDispatcher() { |
91 TRACE_EVENT0("shutdown", "WindowEventDispatcher::Destructor"); | 91 TRACE_EVENT0("shutdown", "WindowEventDispatcher::Destructor"); |
92 ui::GestureRecognizer::Get()->RemoveGestureEventHelper(this); | 92 ui::GestureRecognizer::Get()->RemoveGestureEventHelper(this); |
93 } | 93 } |
94 | 94 |
| 95 void WindowEventDispatcher::PrepareForShutdown() { |
| 96 host_->PrepareForShutdown(); |
| 97 // discard synthesize event request as well. |
| 98 synthesize_mouse_move_ = false; |
| 99 } |
| 100 |
95 void WindowEventDispatcher::RepostEvent(const ui::LocatedEvent& event) { | 101 void WindowEventDispatcher::RepostEvent(const ui::LocatedEvent& event) { |
96 DCHECK(event.type() == ui::ET_MOUSE_PRESSED || | 102 DCHECK(event.type() == ui::ET_MOUSE_PRESSED || |
97 event.type() == ui::ET_GESTURE_TAP_DOWN); | 103 event.type() == ui::ET_GESTURE_TAP_DOWN); |
98 // We allow for only one outstanding repostable event. This is used | 104 // We allow for only one outstanding repostable event. This is used |
99 // in exiting context menus. A dropped repost request is allowed. | 105 // in exiting context menus. A dropped repost request is allowed. |
100 if (event.type() == ui::ET_MOUSE_PRESSED) { | 106 if (event.type() == ui::ET_MOUSE_PRESSED) { |
101 held_repostable_event_.reset( | 107 held_repostable_event_.reset( |
102 new ui::MouseEvent( | 108 new ui::MouseEvent( |
103 static_cast<const ui::MouseEvent&>(event), | 109 static_cast<const ui::MouseEvent&>(event), |
104 static_cast<aura::Window*>(event.target()), | 110 static_cast<aura::Window*>(event.target()), |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 break; | 795 break; |
790 | 796 |
791 default: | 797 default: |
792 NOTREACHED(); | 798 NOTREACHED(); |
793 break; | 799 break; |
794 } | 800 } |
795 PreDispatchLocatedEvent(target, event); | 801 PreDispatchLocatedEvent(target, event); |
796 } | 802 } |
797 | 803 |
798 } // namespace aura | 804 } // namespace aura |
OLD | NEW |