| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 void WindowTreeClient::AttachSurface( | 350 void WindowTreeClient::AttachSurface( |
| 351 Id window_id, | 351 Id window_id, |
| 352 mojom::SurfaceType type, | 352 mojom::SurfaceType type, |
| 353 mojo::InterfaceRequest<mojom::Surface> surface, | 353 mojo::InterfaceRequest<mojom::Surface> surface, |
| 354 mojom::SurfaceClientPtr client) { | 354 mojom::SurfaceClientPtr client) { |
| 355 DCHECK(tree_); | 355 DCHECK(tree_); |
| 356 tree_->AttachSurface(window_id, type, std::move(surface), std::move(client)); | 356 tree_->AttachSurface(window_id, type, std::move(surface), std::move(client)); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void WindowTreeClient::ReturnSurfaceReference( |
| 360 Id window_id, |
| 361 const cc::SurfaceSequence& sequence) { |
| 362 DCHECK(tree_); |
| 363 tree_->ReturnSurfaceReference(window_id, sequence); |
| 364 } |
| 365 |
| 359 void WindowTreeClient::LocalSetCapture(Window* window) { | 366 void WindowTreeClient::LocalSetCapture(Window* window) { |
| 360 if (capture_window_ == window) | 367 if (capture_window_ == window) |
| 361 return; | 368 return; |
| 362 Window* lost_capture = capture_window_; | 369 Window* lost_capture = capture_window_; |
| 363 capture_window_ = window; | 370 capture_window_ = window; |
| 364 if (lost_capture) { | 371 if (lost_capture) { |
| 365 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(lost_capture).observers(), | 372 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(lost_capture).observers(), |
| 366 OnWindowLostCapture(lost_capture)); | 373 OnWindowLostCapture(lost_capture)); |
| 367 } | 374 } |
| 368 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, | 375 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 if (!window) | 1092 if (!window) |
| 1086 return; | 1093 return; |
| 1087 | 1094 |
| 1088 InFlightPredefinedCursorChange new_change(window, cursor); | 1095 InFlightPredefinedCursorChange new_change(window, cursor); |
| 1089 if (ApplyServerChangeToExistingInFlightChange(new_change)) | 1096 if (ApplyServerChangeToExistingInFlightChange(new_change)) |
| 1090 return; | 1097 return; |
| 1091 | 1098 |
| 1092 WindowPrivate(window).LocalSetPredefinedCursor(cursor); | 1099 WindowPrivate(window).LocalSetPredefinedCursor(cursor); |
| 1093 } | 1100 } |
| 1094 | 1101 |
| 1102 void WindowTreeClient::OnWindowSurfaceCreated( |
| 1103 Id window_id, |
| 1104 const cc::SurfaceId& surface_id, |
| 1105 const cc::SurfaceSequence& surface_sequence, |
| 1106 const gfx::Size& frame_size, |
| 1107 float device_scale_factor) { |
| 1108 Window* window = GetWindowByServerId(window_id); |
| 1109 if (!window) |
| 1110 return; |
| 1111 WindowPrivate(window).LocalSetSurfaceId(surface_id, surface_sequence, |
| 1112 frame_size, device_scale_factor); |
| 1113 } |
| 1114 |
| 1095 void WindowTreeClient::OnDragDropStart( | 1115 void WindowTreeClient::OnDragDropStart( |
| 1096 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data) { | 1116 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data) { |
| 1097 mime_drag_data_ = std::move(mime_data); | 1117 mime_drag_data_ = std::move(mime_data); |
| 1098 } | 1118 } |
| 1099 | 1119 |
| 1100 void WindowTreeClient::OnDragEnter(Id window_id, | 1120 void WindowTreeClient::OnDragEnter(Id window_id, |
| 1101 uint32_t key_state, | 1121 uint32_t key_state, |
| 1102 const gfx::Point& position, | 1122 const gfx::Point& position, |
| 1103 uint32_t effect_bitmask, | 1123 uint32_t effect_bitmask, |
| 1104 const OnDragEnterCallback& callback) { | 1124 const OnDragEnterCallback& callback) { |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 Window* window, | 1426 Window* window, |
| 1407 const gfx::Vector2d& offset, | 1427 const gfx::Vector2d& offset, |
| 1408 const gfx::Insets& hit_area) { | 1428 const gfx::Insets& hit_area) { |
| 1409 if (window_manager_internal_client_) { | 1429 if (window_manager_internal_client_) { |
| 1410 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1430 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1411 server_id(window), offset.x(), offset.y(), hit_area); | 1431 server_id(window), offset.x(), offset.y(), hit_area); |
| 1412 } | 1432 } |
| 1413 } | 1433 } |
| 1414 | 1434 |
| 1415 } // namespace ui | 1435 } // namespace ui |
| OLD | NEW |