| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 void WindowManagerState::ReleaseNativeCapture() { | 353 void WindowManagerState::ReleaseNativeCapture() { |
| 354 platform_display_->ReleaseCapture(); | 354 platform_display_->ReleaseCapture(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void WindowManagerState::OnServerWindowCaptureLost(ServerWindow* window) { | 357 void WindowManagerState::OnServerWindowCaptureLost(ServerWindow* window) { |
| 358 DCHECK(window); | 358 DCHECK(window); |
| 359 window_server()->ProcessLostCapture(window); | 359 window_server()->ProcessLostCapture(window); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void WindowManagerState::OnMouseCursorLocationChanged( |
| 363 const gfx::Point& location) { |
| 364 display_->display_manager()->GetUserDisplayManager(user_id_) |
| 365 ->OnMouseCursorLocationChanged(location); |
| 366 } |
| 367 |
| 362 void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target, | 368 void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target, |
| 363 bool in_nonclient_area, | 369 bool in_nonclient_area, |
| 364 const ui::Event& event, | 370 const ui::Event& event, |
| 365 Accelerator* accelerator) { | 371 Accelerator* accelerator) { |
| 366 DCHECK(IsActive()); | 372 DCHECK(IsActive()); |
| 367 // TODO(sky): this needs to see if another wms has capture and if so forward | 373 // TODO(sky): this needs to see if another wms has capture and if so forward |
| 368 // to it. | 374 // to it. |
| 369 if (event_ack_timer_.IsRunning()) { | 375 if (event_ack_timer_.IsRunning()) { |
| 370 scoped_ptr<ProcessedEventTarget> processed_event_target( | 376 scoped_ptr<ProcessedEventTarget> processed_event_target( |
| 371 new ProcessedEventTarget(target, in_nonclient_area, accelerator)); | 377 new ProcessedEventTarget(target, in_nonclient_area, accelerator)); |
| 372 QueueEvent(event, std::move(processed_event_target)); | 378 QueueEvent(event, std::move(processed_event_target)); |
| 373 return; | 379 return; |
| 374 } | 380 } |
| 375 | 381 |
| 376 base::WeakPtr<Accelerator> weak_accelerator; | 382 base::WeakPtr<Accelerator> weak_accelerator; |
| 377 if (accelerator) | 383 if (accelerator) |
| 378 weak_accelerator = accelerator->GetWeakPtr(); | 384 weak_accelerator = accelerator->GetWeakPtr(); |
| 379 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, | 385 DispatchInputEventToWindowImpl(target, in_nonclient_area, event, |
| 380 weak_accelerator); | 386 weak_accelerator); |
| 381 } | 387 } |
| 382 | 388 |
| 383 } // namespace ws | 389 } // namespace ws |
| 384 } // namespace mus | 390 } // namespace mus |
| OLD | NEW |