OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/view_manager/view_tree_impl.h" | 5 #include "services/ui/view_manager/view_tree_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "services/ui/view_manager/view_registry.h" | 8 #include "services/ui/view_manager/view_registry.h" |
9 #include "services/ui/view_manager/view_tree_state.h" | 9 #include "services/ui/view_manager/view_tree_state.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 void ViewTreeImpl::RequestLayout() { | 33 void ViewTreeImpl::RequestLayout() { |
34 registry_->RequestLayout(state_); | 34 registry_->RequestLayout(state_); |
35 } | 35 } |
36 | 36 |
37 void ViewTreeImpl::SetRoot( | 37 void ViewTreeImpl::SetRoot( |
38 uint32_t root_key, | 38 uint32_t root_key, |
39 mojo::InterfaceHandle<mojo::ui::ViewOwner> root_view_owner) { | 39 mojo::InterfaceHandle<mojo::ui::ViewOwner> root_view_owner) { |
40 registry_->SetRoot(state_, root_key, root_view_owner.Pass()); | 40 registry_->SetRoot(state_, root_key, root_view_owner.Pass()); |
41 } | 41 } |
42 | 42 |
43 void ViewTreeImpl::ResetRoot(mojo::InterfaceRequest<mojo::ui::ViewOwner> | 43 void ViewTreeImpl::ClearRoot(mojo::InterfaceRequest<mojo::ui::ViewOwner> |
44 transferred_view_owner_request) { | 44 transferred_view_owner_request) { |
45 registry_->ResetRoot(state_, transferred_view_owner_request.Pass()); | 45 registry_->ClearRoot(state_, transferred_view_owner_request.Pass()); |
46 } | 46 } |
47 | 47 |
48 static void RunLayoutRootCallback( | 48 static void RunLayoutRootCallback( |
49 const ViewTreeImpl::LayoutRootCallback& callback, | 49 const ViewTreeImpl::LayoutRootCallback& callback, |
50 mojo::ui::ViewLayoutInfoPtr info) { | 50 mojo::ui::ViewLayoutInfoPtr info) { |
51 callback.Run(info.Pass()); | 51 callback.Run(info.Pass()); |
52 } | 52 } |
53 | 53 |
54 void ViewTreeImpl::LayoutRoot(mojo::ui::ViewLayoutParamsPtr root_layout_params, | 54 void ViewTreeImpl::LayoutRoot(mojo::ui::ViewLayoutParamsPtr root_layout_params, |
55 const LayoutRootCallback& callback) { | 55 const LayoutRootCallback& callback) { |
56 registry_->LayoutRoot(state_, root_layout_params.Pass(), | 56 registry_->LayoutRoot(state_, root_layout_params.Pass(), |
57 base::Bind(&RunLayoutRootCallback, callback)); | 57 base::Bind(&RunLayoutRootCallback, callback)); |
58 } | 58 } |
59 | 59 |
60 void ViewTreeImpl::ConnectToService( | 60 void ViewTreeImpl::ConnectToService( |
61 const mojo::String& service_name, | 61 const mojo::String& service_name, |
62 mojo::ScopedMessagePipeHandle client_handle) { | 62 mojo::ScopedMessagePipeHandle client_handle) { |
63 registry_->ConnectToViewTreeService(state_, service_name, | 63 registry_->ConnectToViewTreeService(state_, service_name, |
64 client_handle.Pass()); | 64 client_handle.Pass()); |
65 } | 65 } |
66 | 66 |
67 } // namespace view_manager | 67 } // namespace view_manager |
OLD | NEW |