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 MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ | 5 #ifndef MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ |
6 #define MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ | 6 #define MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "mash/public/interfaces/launchable.mojom.h" | 11 #include "mash/public/interfaces/launchable.mojom.h" |
12 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
13 #include "services/service_manager/public/cpp/interface_factory.h" | 13 #include "services/service_manager/public/cpp/interface_factory.h" |
14 #include "services/service_manager/public/cpp/service.h" | 14 #include "services/service_manager/public/cpp/service.h" |
15 | 15 |
16 namespace service_manager { | |
17 class ServiceContext; | |
18 } | |
19 | |
20 namespace views { | 16 namespace views { |
21 class AuraInit; | 17 class AuraInit; |
22 class Widget; | 18 class Widget; |
23 } | 19 } |
24 | 20 |
25 class WindowTypeLauncher | 21 class WindowTypeLauncher |
26 : public service_manager::Service, | 22 : public service_manager::Service, |
27 public mash::mojom::Launchable, | 23 public mash::mojom::Launchable, |
28 public service_manager::InterfaceFactory<mash::mojom::Launchable> { | 24 public service_manager::InterfaceFactory<mash::mojom::Launchable> { |
29 public: | 25 public: |
30 WindowTypeLauncher(); | 26 WindowTypeLauncher(); |
31 ~WindowTypeLauncher() override; | 27 ~WindowTypeLauncher() override; |
32 | 28 |
33 void RemoveWindow(views::Widget* window); | 29 void RemoveWindow(views::Widget* window); |
34 | 30 |
35 private: | 31 private: |
36 // service_manager::Service: | 32 // service_manager::Service: |
37 void OnStart(service_manager::ServiceContext* context) override; | 33 void OnStart() override; |
38 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 34 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
39 service_manager::InterfaceRegistry* registry) override; | 35 service_manager::InterfaceRegistry* registry) override; |
40 | 36 |
41 // mash::mojom::Launchable: | 37 // mash::mojom::Launchable: |
42 void Launch(uint32_t what, mash::mojom::LaunchMode how) override; | 38 void Launch(uint32_t what, mash::mojom::LaunchMode how) override; |
43 | 39 |
44 // service_manager::InterfaceFactory<mash::mojom::Launchable>: | 40 // service_manager::InterfaceFactory<mash::mojom::Launchable>: |
45 void Create(const service_manager::Identity& remote_identity, | 41 void Create(const service_manager::Identity& remote_identity, |
46 mash::mojom::LaunchableRequest request) override; | 42 mash::mojom::LaunchableRequest request) override; |
47 | 43 |
48 service_manager::ServiceContext* context_ = nullptr; | |
49 | |
50 mojo::BindingSet<mash::mojom::Launchable> bindings_; | 44 mojo::BindingSet<mash::mojom::Launchable> bindings_; |
51 std::vector<views::Widget*> windows_; | 45 std::vector<views::Widget*> windows_; |
52 | 46 |
53 std::unique_ptr<views::AuraInit> aura_init_; | 47 std::unique_ptr<views::AuraInit> aura_init_; |
54 | 48 |
55 DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncher); | 49 DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncher); |
56 }; | 50 }; |
57 | 51 |
58 #endif // MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ | 52 #endif // MASH_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_ |
OLD | NEW |