Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: ui/views/mus/pointer_watcher_event_router.cc

Issue 2696573003: Have WindowTreeClient detect error state earlier (Closed)
Patch Set: Fix test exposed by new check Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/mus/pointer_watcher_event_router.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/views/mus/pointer_watcher_event_router.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698