| 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 "components/mus/public/cpp/lib/window_tree_client_impl.h" | 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 void WindowTreeClientImpl::SetBounds(Window* window, | 234 void WindowTreeClientImpl::SetBounds(Window* window, |
| 235 const gfx::Rect& old_bounds, | 235 const gfx::Rect& old_bounds, |
| 236 const gfx::Rect& bounds) { | 236 const gfx::Rect& bounds) { |
| 237 DCHECK(tree_); | 237 DCHECK(tree_); |
| 238 const uint32_t change_id = ScheduleInFlightChange( | 238 const uint32_t change_id = ScheduleInFlightChange( |
| 239 make_scoped_ptr(new InFlightBoundsChange(window, old_bounds))); | 239 make_scoped_ptr(new InFlightBoundsChange(window, old_bounds))); |
| 240 tree_->SetWindowBounds(change_id, window->id(), mojo::Rect::From(bounds)); | 240 tree_->SetWindowBounds(change_id, window->id(), mojo::Rect::From(bounds)); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void WindowTreeClientImpl::SetCapture(Window* window) { |
| 244 NOTIMPLEMENTED(); |
| 245 } |
| 246 |
| 247 void WindowTreeClientImpl::ReleaseCapture(Window* window) { |
| 248 NOTIMPLEMENTED(); |
| 249 } |
| 250 |
| 243 void WindowTreeClientImpl::SetClientArea( | 251 void WindowTreeClientImpl::SetClientArea( |
| 244 Id window_id, | 252 Id window_id, |
| 245 const gfx::Insets& client_area, | 253 const gfx::Insets& client_area, |
| 246 const std::vector<gfx::Rect>& additional_client_areas) { | 254 const std::vector<gfx::Rect>& additional_client_areas) { |
| 247 DCHECK(tree_); | 255 DCHECK(tree_); |
| 248 tree_->SetClientArea( | 256 tree_->SetClientArea( |
| 249 window_id, mojo::Insets::From(client_area), | 257 window_id, mojo::Insets::From(client_area), |
| 250 mojo::Array<mojo::RectPtr>::From(additional_client_areas)); | 258 mojo::Array<mojo::RectPtr>::From(additional_client_areas)); |
| 251 } | 259 } |
| 252 | 260 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 552 |
| 545 void WindowTreeClientImpl::OnUnembed(Id window_id) { | 553 void WindowTreeClientImpl::OnUnembed(Id window_id) { |
| 546 Window* window = GetWindowById(window_id); | 554 Window* window = GetWindowById(window_id); |
| 547 if (!window) | 555 if (!window) |
| 548 return; | 556 return; |
| 549 | 557 |
| 550 delegate_->OnUnembed(window); | 558 delegate_->OnUnembed(window); |
| 551 WindowPrivate(window).LocalDestroy(); | 559 WindowPrivate(window).LocalDestroy(); |
| 552 } | 560 } |
| 553 | 561 |
| 562 void WindowTreeClientImpl::OnLostCapture(Id window_id) { |
| 563 NOTIMPLEMENTED(); |
| 564 } |
| 565 |
| 554 void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id, | 566 void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id, |
| 555 mojom::WindowDataPtr data) { | 567 mojom::WindowDataPtr data) { |
| 556 // The server ack'd the top level window we created and supplied the state | 568 // The server ack'd the top level window we created and supplied the state |
| 557 // of the window at the time the server created it. For properties we do not | 569 // of the window at the time the server created it. For properties we do not |
| 558 // have changes in flight for we can update them immediately. For properties | 570 // have changes in flight for we can update them immediately. For properties |
| 559 // with changes in flight we set the revert value from the server. | 571 // with changes in flight we set the revert value from the server. |
| 560 | 572 |
| 561 if (!in_flight_map_.count(change_id)) { | 573 if (!in_flight_map_.count(change_id)) { |
| 562 // The window may have been destroyed locally before the server could finish | 574 // The window may have been destroyed locally before the server could finish |
| 563 // creating the window, and before the server received the notification that | 575 // creating the window, and before the server received the notification that |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 | 941 |
| 930 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 942 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 931 Window* window, | 943 Window* window, |
| 932 const gfx::Vector2d& offset, | 944 const gfx::Vector2d& offset, |
| 933 const gfx::Insets& hit_area) { | 945 const gfx::Insets& hit_area) { |
| 934 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 946 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 935 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); | 947 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); |
| 936 } | 948 } |
| 937 | 949 |
| 938 } // namespace mus | 950 } // namespace mus |
| OLD | NEW |