OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 tree_->Embed(window_id, std::move(client), flags, callback); | 388 tree_->Embed(window_id, std::move(client), flags, callback); |
389 } | 389 } |
390 | 390 |
391 void WindowTreeClient::RequestClose(Window* window) { | 391 void WindowTreeClient::RequestClose(Window* window) { |
392 if (window_manager_internal_client_) | 392 if (window_manager_internal_client_) |
393 window_manager_internal_client_->WmRequestClose(server_id(window)); | 393 window_manager_internal_client_->WmRequestClose(server_id(window)); |
394 } | 394 } |
395 | 395 |
396 void WindowTreeClient::AttachCompositorFrameSink( | 396 void WindowTreeClient::AttachCompositorFrameSink( |
397 Id window_id, | 397 Id window_id, |
398 mojom::CompositorFrameSinkType type, | |
399 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, | 398 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, |
400 cc::mojom::MojoCompositorFrameSinkClientPtr client) { | 399 cc::mojom::MojoCompositorFrameSinkClientPtr client) { |
401 DCHECK(tree_); | 400 DCHECK(tree_); |
402 tree_->AttachCompositorFrameSink( | 401 tree_->AttachCompositorFrameSink(window_id, std::move(compositor_frame_sink), |
403 window_id, type, std::move(compositor_frame_sink), std::move(client)); | 402 std::move(client)); |
404 } | 403 } |
405 | 404 |
406 void WindowTreeClient::LocalSetCapture(Window* window) { | 405 void WindowTreeClient::LocalSetCapture(Window* window) { |
407 if (capture_window_ == window) | 406 if (capture_window_ == window) |
408 return; | 407 return; |
409 Window* lost_capture = capture_window_; | 408 Window* lost_capture = capture_window_; |
410 capture_window_ = window; | 409 capture_window_ = window; |
411 if (lost_capture) { | 410 if (lost_capture) { |
412 for (auto& observer : *WindowPrivate(lost_capture).observers()) | 411 for (auto& observer : *WindowPrivate(lost_capture).observers()) |
413 observer.OnWindowLostCapture(lost_capture); | 412 observer.OnWindowLostCapture(lost_capture); |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 // TODO(riajiang): Figure out if |offset| needs to be converted. | 1471 // TODO(riajiang): Figure out if |offset| needs to be converted. |
1473 // (http://crbugs.com/646932) | 1472 // (http://crbugs.com/646932) |
1474 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1473 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
1475 server_id(window), offset.x(), offset.y(), | 1474 server_id(window), offset.x(), offset.y(), |
1476 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1475 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
1477 hit_area)); | 1476 hit_area)); |
1478 } | 1477 } |
1479 } | 1478 } |
1480 | 1479 |
1481 } // namespace ui | 1480 } // namespace ui |
OLD | NEW |