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 | 9 |
10 #include "mojo/common/tracing_impl.h" | 10 #include "mojo/common/tracing_impl.h" |
11 #include "mojo/public/cpp/application/application_delegate.h" | 11 #include "mojo/public/cpp/application/application_delegate.h" |
| 12 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h" |
12 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" | 13 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" |
13 #include "mojo/services/surfaces/interfaces/display.mojom.h" | 14 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" |
14 #include "mojo/services/ui/views/interfaces/view_provider.mojom.h" | 15 #include "mojo/services/ui/views/interfaces/view_provider.mojom.h" |
15 | 16 |
16 namespace launcher { | 17 namespace launcher { |
17 | 18 |
18 class LauncherViewTree; | 19 class LauncherViewTree; |
19 | 20 |
20 class LauncherApp : public mojo::ApplicationDelegate, | 21 class LauncherApp : public mojo::ApplicationDelegate, |
21 public mojo::NativeViewportEventDispatcher { | 22 public mojo::NativeViewportEventDispatcher { |
22 public: | 23 public: |
23 LauncherApp(); | 24 LauncherApp(); |
24 ~LauncherApp() override; | 25 ~LauncherApp() override; |
25 | 26 |
26 private: | 27 private: |
27 // |ApplicationDelegate|: | 28 // |ApplicationDelegate|: |
28 void Initialize(mojo::ApplicationImpl* app) override; | 29 void Initialize(mojo::ApplicationImpl* app_impl) override; |
29 | 30 |
30 // |NativeViewportEventDispatcher|: | 31 // |NativeViewportEventDispatcher|: |
31 void OnEvent(mojo::EventPtr event, | 32 void OnEvent(mojo::EventPtr event, |
32 const mojo::Callback<void()>& callback) override; | 33 const mojo::Callback<void()>& callback) override; |
33 | 34 |
| 35 void OnCompositorConnectionError(); |
| 36 void OnViewManagerConnectionError(); |
| 37 |
34 void InitViewport(); | 38 void InitViewport(); |
35 void OnViewportConnectionError(); | 39 void OnViewportConnectionError(); |
36 void OnViewportCreated(mojo::ViewportMetricsPtr metrics); | 40 void OnViewportCreated(mojo::ViewportMetricsPtr metrics); |
37 void OnViewportMetricsChanged(mojo::ViewportMetricsPtr metrics); | 41 void OnViewportMetricsChanged(mojo::ViewportMetricsPtr metrics); |
38 void RequestUpdatedViewportMetrics(); | 42 void RequestUpdatedViewportMetrics(); |
39 | 43 |
40 void OnViewManagerConnectionError(); | |
41 | |
42 void LaunchClient(std::string app_url); | 44 void LaunchClient(std::string app_url); |
43 void OnClientConnectionError(); | 45 void OnClientConnectionError(); |
44 void OnClientViewCreated(mojo::ui::ViewTokenPtr view_token); | 46 void OnClientViewCreated(mojo::ui::ViewTokenPtr view_token); |
45 | 47 |
46 void UpdateClientView(); | 48 void UpdateClientView(); |
47 | 49 |
| 50 void Shutdown(); |
| 51 |
48 mojo::ApplicationImpl* app_impl_; | 52 mojo::ApplicationImpl* app_impl_; |
49 mojo::TracingImpl tracing_; | 53 mojo::TracingImpl tracing_; |
50 | 54 |
51 mojo::NativeViewportPtr viewport_service_; | 55 mojo::gfx::composition::CompositorPtr compositor_; |
| 56 mojo::ui::ViewManagerPtr view_manager_; |
| 57 |
| 58 mojo::NativeViewportPtr viewport_; |
52 mojo::Binding<NativeViewportEventDispatcher> | 59 mojo::Binding<NativeViewportEventDispatcher> |
53 viewport_event_dispatcher_binding_; | 60 viewport_event_dispatcher_binding_; |
54 | 61 |
55 std::unique_ptr<LauncherViewTree> view_tree_; | 62 std::unique_ptr<LauncherViewTree> view_tree_; |
56 | 63 |
57 mojo::ui::ViewProviderPtr client_view_provider_; | 64 mojo::ui::ViewProviderPtr client_view_provider_; |
58 mojo::ui::ViewTokenPtr client_view_token_; | 65 mojo::ui::ViewTokenPtr client_view_token_; |
59 | 66 |
60 DISALLOW_COPY_AND_ASSIGN(LauncherApp); | 67 DISALLOW_COPY_AND_ASSIGN(LauncherApp); |
61 }; | 68 }; |
62 | 69 |
63 } // namespace launcher | 70 } // namespace launcher |
64 | 71 |
65 #endif // SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | 72 #endif // SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ |
OLD | NEW |