| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_ |
| 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "mojo/services/ui/views/interfaces/view_trees.mojom.h" |
| 11 #include "services/ui/view_manager/view_registry.h" |
| 12 #include "services/ui/view_manager/view_tree_state.h" |
| 13 |
| 14 namespace view_manager { |
| 15 |
| 16 // ViewTreeHost interface implementation. |
| 17 // This object is owned by its associated ViewTreeState. |
| 18 class ViewTreeHostImpl : public mojo::ui::ViewTreeHost { |
| 19 public: |
| 20 ViewTreeHostImpl( |
| 21 ViewRegistry* registry, |
| 22 ViewTreeState* state, |
| 23 mojo::InterfaceRequest<mojo::ui::ViewTreeHost> view_tree_host_request); |
| 24 ~ViewTreeHostImpl() override; |
| 25 |
| 26 void set_view_tree_host_connection_error_handler( |
| 27 const base::Closure& handler) { |
| 28 binding_.set_connection_error_handler(handler); |
| 29 } |
| 30 |
| 31 private: |
| 32 // |ViewTreeHost|: |
| 33 void RequestLayout() override; |
| 34 void SetRoot(uint32_t root_key, |
| 35 mojo::ui::ViewTokenPtr root_view_token) override; |
| 36 void ResetRoot() override; |
| 37 void LayoutRoot(mojo::ui::ViewLayoutParamsPtr root_layout_params, |
| 38 const LayoutRootCallback& callback) override; |
| 39 |
| 40 ViewRegistry* const registry_; |
| 41 ViewTreeState* const state_; |
| 42 mojo::Binding<mojo::ui::ViewTreeHost> binding_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ViewTreeHostImpl); |
| 45 }; |
| 46 |
| 47 } // namespace view_manager |
| 48 |
| 49 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_TREE_HOST_IMPL_H_ |
| OLD | NEW |