OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | |
6 #define SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "mojo/common/tracing_impl.h" | |
11 #include "mojo/public/cpp/application/application_delegate.h" | |
12 #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_provider.mojom.h" | |
15 | |
16 namespace launcher { | |
17 | |
18 class LauncherViewTree; | |
19 | |
20 class LauncherApp : public mojo::ApplicationDelegate, | |
21 public mojo::NativeViewportEventDispatcher { | |
22 public: | |
23 LauncherApp(); | |
24 ~LauncherApp() override; | |
25 | |
26 private: | |
27 // |ApplicationDelegate|: | |
28 void Initialize(mojo::ApplicationImpl* app) override; | |
29 | |
30 // |NativeViewportEventDispatcher|: | |
31 void OnEvent(mojo::EventPtr event, | |
32 const mojo::Callback<void()>& callback) override; | |
33 | |
34 void InitViewport(); | |
35 void OnViewportConnectionError(); | |
36 void OnViewportCreated(mojo::ViewportMetricsPtr metrics); | |
37 void OnViewportMetricsChanged(mojo::ViewportMetricsPtr metrics); | |
38 void RequestUpdatedViewportMetrics(); | |
39 | |
40 void OnViewManagerConnectionError(); | |
41 | |
42 void LaunchClient(std::string app_url); | |
abarth
2015/10/24 06:07:21
const std::string&
| |
43 void OnClientConnectionError(); | |
44 void OnClientViewCreated(mojo::ui::ViewTokenPtr view_token); | |
45 | |
46 void UpdateClientView(); | |
47 | |
48 mojo::ApplicationImpl* app_impl_; | |
49 mojo::TracingImpl tracing_; | |
50 | |
51 mojo::NativeViewportPtr viewport_service_; | |
52 mojo::Binding<NativeViewportEventDispatcher> | |
53 viewport_event_dispatcher_binding_; | |
54 | |
55 std::unique_ptr<LauncherViewTree> view_tree_; | |
56 | |
57 mojo::ui::ViewProviderPtr client_view_provider_; | |
58 mojo::ui::ViewTokenPtr client_view_token_; | |
abarth
2015/10/24 06:07:21
nit: We don't usually use |client_| prefixes for t
| |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(LauncherApp); | |
61 }; | |
62 | |
63 } // namespace launcher | |
64 | |
65 #endif // SERVICES_UI_LAUNCHER_LAUNCHER_APP_H_ | |
OLD | NEW |