| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 void WindowManagerState::ReleaseNativeCapture() { | 363 void WindowManagerState::ReleaseNativeCapture() { |
| 364 platform_display_->ReleaseCapture(); | 364 platform_display_->ReleaseCapture(); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void WindowManagerState::OnServerWindowCaptureLost(ServerWindow* window) { | 367 void WindowManagerState::OnServerWindowCaptureLost(ServerWindow* window) { |
| 368 DCHECK(window); | 368 DCHECK(window); |
| 369 window_server()->ProcessLostCapture(window); | 369 window_server()->ProcessLostCapture(window); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void WindowManagerState::OnMouseCursorLocationChanged(const gfx::Point& point) { |
| 373 window_server()->display_manager()->GetUserDisplayManager(user_id_)-> |
| 374 OnMouseCursorLocationChanged(point); |
| 375 } |
| 376 |
| 372 void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target, | 377 void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target, |
| 373 bool in_nonclient_area, | 378 bool in_nonclient_area, |
| 374 const ui::Event& event, | 379 const ui::Event& event, |
| 375 Accelerator* accelerator) { | 380 Accelerator* accelerator) { |
| 376 DCHECK(IsActive()); | 381 DCHECK(IsActive()); |
| 377 // TODO(sky): this needs to see if another wms has capture and if so forward | 382 // TODO(sky): this needs to see if another wms has capture and if so forward |
| 378 // to it. | 383 // to it. |
| 379 if (event_ack_timer_.IsRunning()) { | 384 if (event_ack_timer_.IsRunning()) { |
| 380 std::unique_ptr<ProcessedEventTarget> processed_event_target( | 385 std::unique_ptr<ProcessedEventTarget> processed_event_target( |
| 381 new ProcessedEventTarget(target, in_nonclient_area, accelerator)); | 386 new ProcessedEventTarget(target, in_nonclient_area, accelerator)); |
| 382 QueueEvent(event, std::move(processed_event_target)); | 387 QueueEvent(event, std::move(processed_event_target)); |
| 383 return; | 388 return; |
| 384 } | 389 } |
| 385 | 390 |
| 386 base::WeakPtr<Accelerator> weak_accelerator; | 391 base::WeakPtr<Accelerator> weak_accelerator; |
| 387 if (accelerator) | 392 if (accelerator) |
| 388 weak_accelerator = accelerator->GetWeakPtr(); | 393 weak_accelerator = accelerator->GetWeakPtr(); |
| 389 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, | 394 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, |
| 390 weak_accelerator); | 395 weak_accelerator); |
| 391 } | 396 } |
| 392 | 397 |
| 393 void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) { | 398 void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) { |
| 394 window_server()->SendToEventObservers(event, user_id_, | 399 window_server()->SendToEventObservers(event, user_id_, |
| 395 nullptr /* ignore_tree */); | 400 nullptr /* ignore_tree */); |
| 396 } | 401 } |
| 397 | 402 |
| 398 } // namespace ws | 403 } // namespace ws |
| 399 } // namespace mus | 404 } // namespace mus |
| OLD | NEW |