OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/views/mus/pointer_watcher_event_router.h" | 5 #include "ui/views/mus/pointer_watcher_event_router.h" |
6 | 6 |
7 #include "ui/aura/client/capture_client.h" | 7 #include "ui/aura/client/capture_client.h" |
8 #include "ui/aura/mus/window_tree_client.h" | 8 #include "ui/aura/mus/window_tree_client.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/display/screen.h" | 10 #include "ui/display/screen.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 gfx::Point(), ui::EventTimeForNow(), 0, 0); | 156 gfx::Point(), ui::EventTimeForNow(), 0, 0); |
157 const ui::PointerEvent event(mouse_event); | 157 const ui::PointerEvent event(mouse_event); |
158 gfx::Point location_in_screen = | 158 gfx::Point location_in_screen = |
159 display::Screen::GetScreen()->GetCursorScreenPoint(); | 159 display::Screen::GetScreen()->GetCursorScreenPoint(); |
160 for (PointerWatcher& observer : move_watchers_) | 160 for (PointerWatcher& observer : move_watchers_) |
161 observer.OnPointerEventObserved(event, location_in_screen, nullptr); | 161 observer.OnPointerEventObserved(event, location_in_screen, nullptr); |
162 for (PointerWatcher& observer : non_move_watchers_) | 162 for (PointerWatcher& observer : non_move_watchers_) |
163 observer.OnPointerEventObserved(event, location_in_screen, nullptr); | 163 observer.OnPointerEventObserved(event, location_in_screen, nullptr); |
164 } | 164 } |
165 | 165 |
166 void PointerWatcherEventRouter::OnDidDestroyClient( | 166 void PointerWatcherEventRouter::OnWillDestroyClient( |
167 aura::WindowTreeClient* client) { | 167 aura::WindowTreeClient* client) { |
168 // We expect that all observers have been removed by this time. | 168 // We expect that all observers have been removed by this time. |
169 DCHECK_EQ(event_types_, EventTypes::NONE); | 169 DCHECK_EQ(event_types_, EventTypes::NONE); |
170 DCHECK_EQ(client, window_tree_client_); | 170 DCHECK_EQ(client, window_tree_client_); |
171 window_tree_client_->RemoveObserver(this); | 171 window_tree_client_->RemoveObserver(this); |
172 window_tree_client_ = nullptr; | 172 window_tree_client_ = nullptr; |
173 } | 173 } |
174 | 174 |
175 } // namespace views | 175 } // namespace views |
OLD | NEW |