| 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 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 5 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
| 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "mojo/common/strong_binding_set.h" | 11 #include "mojo/common/strong_binding_set.h" |
| 13 #include "mojo/common/tracing_impl.h" | 12 #include "mojo/common/tracing_impl.h" |
| 14 #include "mojo/public/cpp/application/application_delegate.h" | 13 #include "mojo/public/cpp/application/application_delegate.h" |
| 14 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h" |
| 15 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" | 15 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" |
| 16 #include "services/ui/view_manager/surface_manager.h" | |
| 17 #include "services/ui/view_manager/view_registry.h" | 16 #include "services/ui/view_manager/view_registry.h" |
| 18 | 17 |
| 19 namespace view_manager { | 18 namespace view_manager { |
| 20 | 19 |
| 21 // View manager application entry point. | 20 // View manager application entry point. |
| 22 class ViewManagerApp : public mojo::ApplicationDelegate, | 21 class ViewManagerApp : public mojo::ApplicationDelegate, |
| 23 public mojo::InterfaceFactory<mojo::ui::ViewManager> { | 22 public mojo::InterfaceFactory<mojo::ui::ViewManager> { |
| 24 public: | 23 public: |
| 25 ViewManagerApp(); | 24 ViewManagerApp(); |
| 26 ~ViewManagerApp() override; | 25 ~ViewManagerApp() override; |
| 27 | 26 |
| 28 private: | 27 private: |
| 29 // |ApplicationDelegate|: | 28 // |ApplicationDelegate|: |
| 30 void Initialize(mojo::ApplicationImpl* app_impl) override; | 29 void Initialize(mojo::ApplicationImpl* app_impl) override; |
| 31 bool ConfigureIncomingConnection( | 30 bool ConfigureIncomingConnection( |
| 32 mojo::ApplicationConnection* connection) override; | 31 mojo::ApplicationConnection* connection) override; |
| 33 | 32 |
| 34 // |InterfaceFactory<ViewManager>|: | 33 // |InterfaceFactory<ViewManager>|: |
| 35 void Create(mojo::ApplicationConnection* connection, | 34 void Create(mojo::ApplicationConnection* connection, |
| 36 mojo::InterfaceRequest<mojo::ui::ViewManager> request) override; | 35 mojo::InterfaceRequest<mojo::ui::ViewManager> request) override; |
| 37 | 36 |
| 37 void OnCompositorConnectionError(); |
| 38 void OnAssociateConnectionError(const std::string& url); |
| 39 |
| 40 void Shutdown(); |
| 41 |
| 38 mojo::ApplicationImpl* app_impl_; | 42 mojo::ApplicationImpl* app_impl_; |
| 39 mojo::TracingImpl tracing_; | 43 mojo::TracingImpl tracing_; |
| 40 | 44 |
| 41 mojo::StrongBindingSet<mojo::ui::ViewManager> view_managers; | 45 mojo::StrongBindingSet<mojo::ui::ViewManager> view_managers_; |
| 42 std::unique_ptr<ViewRegistry> registry_; | 46 std::unique_ptr<ViewRegistry> registry_; |
| 43 std::unique_ptr<SurfaceManager> surface_manager_; // must come after registry | |
| 44 | 47 |
| 45 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 48 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace view_manager | 51 } // namespace view_manager |
| 49 | 52 |
| 50 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 53 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
| OLD | NEW |