| 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_LAUNCHER_LAUNCHER_APP_H_ | 5 #ifndef SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ |
| 6 #define SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | 6 #define SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 | 10 |
| 11 #include "mojo/common/binding_set.h" | 11 #include "mojo/common/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_delegate.h" |
| 14 #include "services/ui/launcher/launch_instance.h" | 14 #include "services/ui/launcher/launch_instance.h" |
| 15 #include "services/ui/launcher/launcher.mojom.h" | 15 #include "services/ui/launcher/launcher.mojom.h" |
| 16 | 16 |
| 17 namespace launcher { | 17 namespace launcher { |
| 18 | 18 |
| 19 class LauncherApp : public mojo::ApplicationDelegate, public Launcher { | 19 class LauncherApp : public mojo::ApplicationDelegate, public Launcher { |
| 20 public: | 20 public: |
| 21 LauncherApp(); | 21 LauncherApp(); |
| 22 ~LauncherApp() override; | 22 ~LauncherApp() override; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // |ApplicationDelegate|: | 25 // |ApplicationDelegate|: |
| 26 void Initialize(mojo::ApplicationImpl* app_impl) override; | 26 void Initialize(mojo::ApplicationImpl* app_impl) override; |
| 27 void InitCompositor(); |
| 28 void InitViewManager(); |
| 29 void InitViewAssociates(const std::string& associate_urls_command_line_param); |
| 27 bool ConfigureIncomingConnection( | 30 bool ConfigureIncomingConnection( |
| 28 mojo::ServiceProviderImpl* service_provider_impl) override; | 31 mojo::ServiceProviderImpl* service_provider_impl) override; |
| 29 | 32 |
| 30 // |Launcher|: | 33 // |Launcher|: |
| 31 void Launch(const mojo::String& application_url) override; | 34 void Launch(const mojo::String& application_url) override; |
| 32 | 35 |
| 33 void OnLaunchTermination(uint32_t id); | 36 void OnLaunchTermination(uint32_t id); |
| 34 | 37 |
| 38 void OnCompositorConnectionError(); |
| 39 void OnViewManagerConnectionError(); |
| 40 void OnViewAssociateConnectionError(); |
| 41 |
| 35 mojo::ApplicationImpl* app_impl_; | 42 mojo::ApplicationImpl* app_impl_; |
| 36 mojo::TracingImpl tracing_; | 43 mojo::TracingImpl tracing_; |
| 37 | 44 |
| 38 mojo::BindingSet<Launcher> bindings_; | 45 mojo::BindingSet<Launcher> bindings_; |
| 39 std::unordered_map<uint32_t, std::unique_ptr<LaunchInstance>> | 46 std::unordered_map<uint32_t, std::unique_ptr<LaunchInstance>> |
| 40 launch_instances_; | 47 launch_instances_; |
| 48 |
| 41 uint32_t next_id_; | 49 uint32_t next_id_; |
| 42 | 50 |
| 51 mojo::gfx::composition::CompositorPtr compositor_; |
| 52 mojo::ui::ViewManagerPtr view_manager_; |
| 53 std::vector<mojo::ui::ViewAssociateOwnerPtr> view_associate_owners_; |
| 54 |
| 43 DISALLOW_COPY_AND_ASSIGN(LauncherApp); | 55 DISALLOW_COPY_AND_ASSIGN(LauncherApp); |
| 44 }; | 56 }; |
| 45 | 57 |
| 46 } // namespace launcher | 58 } // namespace launcher |
| 47 | 59 |
| 48 #endif // SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | 60 #endif // SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ |
| OLD | NEW |