| 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_HOST_IMPL_H_ |
| 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_HOST_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "mojo/services/ui/views/interfaces/views.mojom.h" |
| 11 #include "services/ui/view_manager/view_registry.h" |
| 12 #include "services/ui/view_manager/view_state.h" |
| 13 |
| 14 namespace view_manager { |
| 15 |
| 16 // ViewHost interface implementation. |
| 17 // This object is owned by its associated ViewState. |
| 18 class ViewHostImpl : public mojo::ui::ViewHost { |
| 19 public: |
| 20 ViewHostImpl(ViewRegistry* registry, |
| 21 ViewState* state, |
| 22 mojo::InterfaceRequest<mojo::ui::ViewHost> view_host_request); |
| 23 ~ViewHostImpl() override; |
| 24 |
| 25 void set_view_host_connection_error_handler(const base::Closure& handler) { |
| 26 binding_.set_connection_error_handler(handler); |
| 27 } |
| 28 |
| 29 private: |
| 30 // |ViewHost|: |
| 31 void GetServiceProvider( |
| 32 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) override; |
| 33 void RequestLayout() override; |
| 34 void AddChild(uint32_t child_key, |
| 35 mojo::ui::ViewTokenPtr child_view_token) override; |
| 36 void RemoveChild(uint32_t child_key) override; |
| 37 void LayoutChild(uint32_t child_key, |
| 38 mojo::ui::ViewLayoutParamsPtr child_layout_params, |
| 39 const LayoutChildCallback& callback) override; |
| 40 |
| 41 ViewRegistry* const registry_; |
| 42 ViewState* const state_; |
| 43 mojo::Binding<mojo::ui::ViewHost> binding_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(ViewHostImpl); |
| 46 }; |
| 47 |
| 48 } // namespace view_manager |
| 49 |
| 50 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_HOST_IMPL_H_ |
| OLD | NEW |