| 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 "components/mus/ws/window_manager_state.h" | 5 #include "components/mus/ws/window_manager_state.h" |
| 6 | 6 |
| 7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "components/mus/ws/accelerator.h" | 8 #include "components/mus/ws/accelerator.h" |
| 9 #include "components/mus/ws/display_manager.h" | 9 #include "components/mus/ws/display_manager.h" |
| 10 #include "components/mus/ws/platform_display.h" | 10 #include "components/mus/ws/platform_display.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (tree_awaiting_input_ack_ != tree) | 158 if (tree_awaiting_input_ack_ != tree) |
| 159 return; | 159 return; |
| 160 // The WindowTree is dying. So it's not going to ack the event. | 160 // The WindowTree is dying. So it's not going to ack the event. |
| 161 // If the dying tree matches the root |tree_| marked as handled so we don't | 161 // If the dying tree matches the root |tree_| marked as handled so we don't |
| 162 // notify it of accelerators. | 162 // notify it of accelerators. |
| 163 OnEventAck(tree_awaiting_input_ack_, tree == tree_ | 163 OnEventAck(tree_awaiting_input_ack_, tree == tree_ |
| 164 ? mojom::EventResult::HANDLED | 164 ? mojom::EventResult::HANDLED |
| 165 : mojom::EventResult::UNHANDLED); | 165 : mojom::EventResult::UNHANDLED); |
| 166 } | 166 } |
| 167 | 167 |
| 168 gfx::Point WindowManagerState::GetCursorLocation() const { |
| 169 return event_dispatcher_.mouse_pointer_last_location(); |
| 170 } |
| 171 |
| 168 WindowManagerState::WindowManagerState(Display* display, | 172 WindowManagerState::WindowManagerState(Display* display, |
| 169 PlatformDisplay* platform_display, | 173 PlatformDisplay* platform_display, |
| 170 cc::SurfaceId surface_id, | 174 cc::SurfaceId surface_id, |
| 171 bool is_user_id_valid, | 175 bool is_user_id_valid, |
| 172 const UserId& user_id) | 176 const UserId& user_id) |
| 173 : display_(display), | 177 : display_(display), |
| 174 platform_display_(platform_display), | 178 platform_display_(platform_display), |
| 175 is_user_id_valid_(is_user_id_valid), | 179 is_user_id_valid_(is_user_id_valid), |
| 176 user_id_(user_id), | 180 user_id_(user_id), |
| 177 event_dispatcher_(this) { | 181 event_dispatcher_(this) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 382 |
| 379 base::WeakPtr<Accelerator> weak_accelerator; | 383 base::WeakPtr<Accelerator> weak_accelerator; |
| 380 if (accelerator) | 384 if (accelerator) |
| 381 weak_accelerator = accelerator->GetWeakPtr(); | 385 weak_accelerator = accelerator->GetWeakPtr(); |
| 382 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, | 386 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, |
| 383 weak_accelerator); | 387 weak_accelerator); |
| 384 } | 388 } |
| 385 | 389 |
| 386 } // namespace ws | 390 } // namespace ws |
| 387 } // namespace mus | 391 } // namespace mus |
| OLD | NEW |