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 | |
101 void WindowEventDispatcher::RepostEvent(const ui::LocatedEvent& event) { | 95 void WindowEventDispatcher::RepostEvent(const ui::LocatedEvent& event) { |
102 DCHECK(event.type() == ui::ET_MOUSE_PRESSED || | 96 DCHECK(event.type() == ui::ET_MOUSE_PRESSED || |
103 event.type() == ui::ET_GESTURE_TAP_DOWN); | 97 event.type() == ui::ET_GESTURE_TAP_DOWN); |
104 // We allow for only one outstanding repostable event. This is used | 98 // We allow for only one outstanding repostable event. This is used |
105 // in exiting context menus. A dropped repost request is allowed. | 99 // in exiting context menus. A dropped repost request is allowed. |
106 if (event.type() == ui::ET_MOUSE_PRESSED) { | 100 if (event.type() == ui::ET_MOUSE_PRESSED) { |
107 held_repostable_event_.reset( | 101 held_repostable_event_.reset( |
108 new ui::MouseEvent( | 102 new ui::MouseEvent( |
109 static_cast<const ui::MouseEvent&>(event), | 103 static_cast<const ui::MouseEvent&>(event), |
110 static_cast<aura::Window*>(event.target()), | 104 static_cast<aura::Window*>(event.target()), |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 break; | 789 break; |
796 | 790 |
797 default: | 791 default: |
798 NOTREACHED(); | 792 NOTREACHED(); |
799 break; | 793 break; |
800 } | 794 } |
801 PreDispatchLocatedEvent(target, event); | 795 PreDispatchLocatedEvent(target, event); |
802 } | 796 } |
803 | 797 |
804 } // namespace aura | 798 } // namespace aura |
OLD | NEW |