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