| 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 "mojo/common/strong_binding_set.h" | 11 #include "mojo/common/strong_binding_set.h" |
| 12 #include "mojo/common/tracing_impl.h" | 12 #include "mojo/common/tracing_impl.h" |
| 13 #include "mojo/public/cpp/application/application_delegate.h" | 13 #include "mojo/public/cpp/application/application_impl_base.h" |
| 14 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.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/view_registry.h" | 16 #include "services/ui/view_manager/view_registry.h" |
| 17 | 17 |
| 18 namespace view_manager { | 18 namespace view_manager { |
| 19 | 19 |
| 20 // View manager application entry point. | 20 // View manager application entry point. |
| 21 class ViewManagerApp : public mojo::ApplicationDelegate { | 21 class ViewManagerApp : public mojo::ApplicationImplBase { |
| 22 public: | 22 public: |
| 23 ViewManagerApp(); | 23 ViewManagerApp(); |
| 24 ~ViewManagerApp() override; | 24 ~ViewManagerApp() override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 // |ApplicationDelegate|: | 27 // |ApplicationImplBase|: |
| 28 void Initialize(mojo::ApplicationImpl* app_impl) override; | 28 void OnInitialize() override; |
| 29 bool ConfigureIncomingConnection( | 29 bool OnAcceptConnection( |
| 30 mojo::ServiceProviderImpl* service_provider_impl) override; | 30 mojo::ServiceProviderImpl* service_provider_impl) override; |
| 31 | 31 |
| 32 void OnCompositorConnectionError(); | 32 void OnCompositorConnectionError(); |
| 33 | 33 |
| 34 void Shutdown(); | 34 void Shutdown(); |
| 35 | 35 |
| 36 mojo::ApplicationImpl* app_impl_; | |
| 37 mojo::TracingImpl tracing_; | 36 mojo::TracingImpl tracing_; |
| 38 | 37 |
| 39 mojo::StrongBindingSet<mojo::ui::ViewManager> view_managers_; | 38 mojo::StrongBindingSet<mojo::ui::ViewManager> view_managers_; |
| 40 std::unique_ptr<ViewRegistry> registry_; | 39 std::unique_ptr<ViewRegistry> registry_; |
| 41 | 40 |
| 42 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | 41 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 } // namespace view_manager | 44 } // namespace view_manager |
| 46 | 45 |
| 47 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | 46 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_MANAGER_APP_H_ |
| OLD | NEW |