| 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/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 | 1408 |
| 1409 void WindowTree::SetWindowOpacity(uint32_t change_id, | 1409 void WindowTree::SetWindowOpacity(uint32_t change_id, |
| 1410 Id window_id, | 1410 Id window_id, |
| 1411 float opacity) { | 1411 float opacity) { |
| 1412 client()->OnChangeCompleted( | 1412 client()->OnChangeCompleted( |
| 1413 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity)); | 1413 change_id, SetWindowOpacity(ClientWindowId(window_id), opacity)); |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 void WindowTree::AttachCompositorFrameSink( | 1416 void WindowTree::AttachCompositorFrameSink( |
| 1417 Id transport_window_id, | 1417 Id transport_window_id, |
| 1418 mojom::CompositorFrameSinkType type, | |
| 1419 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, | 1418 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink, |
| 1420 cc::mojom::MojoCompositorFrameSinkClientPtr client) { | 1419 cc::mojom::MojoCompositorFrameSinkClientPtr client) { |
| 1421 ServerWindow* window = | 1420 ServerWindow* window = |
| 1422 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1421 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1423 const bool success = | 1422 const bool success = |
| 1424 window && access_policy_->CanSetWindowCompositorFrameSink(window, type); | 1423 window && access_policy_->CanSetWindowCompositorFrameSink(window); |
| 1425 if (!success) { | 1424 if (!success) { |
| 1426 DVLOG(1) << "request to AttachCompositorFrameSink failed"; | 1425 DVLOG(1) << "request to AttachCompositorFrameSink failed"; |
| 1427 return; | 1426 return; |
| 1428 } | 1427 } |
| 1429 window->CreateOffscreenCompositorFrameSink( | 1428 window->CreateOffscreenCompositorFrameSink(std::move(compositor_frame_sink), |
| 1430 type, std::move(compositor_frame_sink), std::move(client)); | 1429 std::move(client)); |
| 1431 } | 1430 } |
| 1432 | 1431 |
| 1433 void WindowTree::SetWindowTextInputState(Id transport_window_id, | 1432 void WindowTree::SetWindowTextInputState(Id transport_window_id, |
| 1434 mojo::TextInputStatePtr state) { | 1433 mojo::TextInputStatePtr state) { |
| 1435 ServerWindow* window = | 1434 ServerWindow* window = |
| 1436 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1435 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1437 bool success = window && access_policy_->CanSetWindowTextInputState(window); | 1436 bool success = window && access_policy_->CanSetWindowTextInputState(window); |
| 1438 if (success) | 1437 if (success) |
| 1439 window->SetTextInputState(state.To<ui::TextInputState>()); | 1438 window->SetTextInputState(state.To<ui::TextInputState>()); |
| 1440 } | 1439 } |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2010 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2012 effect_bitmask, callback); | 2011 effect_bitmask, callback); |
| 2013 } | 2012 } |
| 2014 | 2013 |
| 2015 void WindowTree::PerformOnDragDropDone() { | 2014 void WindowTree::PerformOnDragDropDone() { |
| 2016 client()->OnDragDropDone(); | 2015 client()->OnDragDropDone(); |
| 2017 } | 2016 } |
| 2018 | 2017 |
| 2019 } // namespace ws | 2018 } // namespace ws |
| 2020 } // namespace ui | 2019 } // namespace ui |
| OLD | NEW |