OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_LAUNCH_INSTANCE_H_ | 5 #ifndef SERVICES_UI_LAUNCHER_LAUNCH_INSTANCE_H_ |
6 #define SERVICES_UI_LAUNCHER_LAUNCH_INSTANCE_H_ | 6 #define SERVICES_UI_LAUNCHER_LAUNCH_INSTANCE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "mojo/public/cpp/application/application_delegate.h" | 11 #include "mojo/public/cpp/application/application_delegate.h" |
12 #include "mojo/public/cpp/application/application_impl.h" | 12 #include "mojo/public/cpp/application/application_impl.h" |
13 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.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/native_viewport/interfaces/native_viewport.mojom.h" | 15 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" |
16 #include "mojo/services/native_viewport/interfaces/native_viewport_event_dispatc
her.mojom.h" | 16 #include "mojo/services/native_viewport/interfaces/native_viewport_event_dispatc
her.mojom.h" |
17 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" | 17 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" |
18 | 18 |
19 namespace launcher { | 19 namespace launcher { |
20 | 20 |
21 class LauncherViewTree; | 21 class LauncherViewTree; |
22 | 22 |
23 class LaunchInstance : public mojo::NativeViewportEventDispatcher { | 23 class LaunchInstance : public mojo::NativeViewportEventDispatcher, |
| 24 public mojo::ui::ViewAssociateWatcher { |
24 public: | 25 public: |
25 LaunchInstance(mojo::ApplicationImpl* app_impl, | 26 LaunchInstance(mojo::ApplicationImpl* app_impl, |
26 const std::string& app_url, | 27 const std::string& app_url, |
27 const base::Closure& shutdown_callback); | 28 const base::Closure& shutdown_callback); |
28 ~LaunchInstance() override; | 29 ~LaunchInstance() override; |
29 | 30 |
30 void Launch(); | 31 void Launch(); |
31 | 32 |
| 33 // |ViewAssociateWatcher| |
| 34 void OnViewAssociateConnectionError( |
| 35 const mojo::String& label, |
| 36 const OnViewAssociateConnectionErrorCallback& callback) override; |
| 37 |
32 private: | 38 private: |
33 // |NativeViewportEventDispatcher|: | 39 // |NativeViewportEventDispatcher|: |
34 void OnEvent(mojo::EventPtr event, | 40 void OnEvent(mojo::EventPtr event, |
35 const mojo::Callback<void()>& callback) override; | 41 const mojo::Callback<void()>& callback) override; |
36 | 42 |
37 void OnCompositorConnectionError(); | 43 void OnCompositorConnectionError(); |
38 void OnViewManagerConnectionError(); | 44 void OnViewManagerConnectionError(); |
39 | 45 |
40 void InitViewport(); | 46 void InitViewport(); |
41 void OnViewportConnectionError(); | 47 void OnViewportConnectionError(); |
(...skipping 15 matching lines...) Expand all Loading... |
57 std::unique_ptr<LauncherViewTree> view_tree_; | 63 std::unique_ptr<LauncherViewTree> view_tree_; |
58 | 64 |
59 mojo::ui::ViewOwnerPtr client_view_owner_; | 65 mojo::ui::ViewOwnerPtr client_view_owner_; |
60 | 66 |
61 DISALLOW_COPY_AND_ASSIGN(LaunchInstance); | 67 DISALLOW_COPY_AND_ASSIGN(LaunchInstance); |
62 }; | 68 }; |
63 | 69 |
64 } // namespace launcher | 70 } // namespace launcher |
65 | 71 |
66 #endif // SERVICES_UI_LAUNCHER_LAUNCH_INSTANCE_H_ | 72 #endif // SERVICES_UI_LAUNCHER_LAUNCH_INSTANCE_H_ |
OLD | NEW |