Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: services/shell/tests/lifecycle/app_client.h

Issue 2419723002: Move services/shell to services/service_manager (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/shell/tests/lifecycle/app.cc ('k') | services/shell/tests/lifecycle/app_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_
6 #define SERVICES_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_
7
8 #include <memory>
9
10 #include "base/bind.h"
11 #include "base/macros.h"
12 #include "mojo/public/cpp/bindings/binding_set.h"
13 #include "services/shell/public/cpp/interface_factory.h"
14 #include "services/shell/public/cpp/service.h"
15 #include "services/shell/public/cpp/service_runner.h"
16 #include "services/shell/public/interfaces/service.mojom.h"
17 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h"
18
19 using LifecycleControl = shell::test::mojom::LifecycleControl;
20 using LifecycleControlRequest = shell::test::mojom::LifecycleControlRequest;
21
22 namespace shell {
23 class ServiceContext;
24
25 namespace test {
26
27 class AppClient : public Service,
28 public InterfaceFactory<LifecycleControl>,
29 public LifecycleControl {
30 public:
31 AppClient();
32 explicit AppClient(shell::mojom::ServiceRequest request);
33 ~AppClient() override;
34
35 void set_runner(ServiceRunner* runner) {
36 runner_ = runner;
37 }
38
39 // Service:
40 bool OnConnect(const Identity& remote_identity,
41 InterfaceRegistry* registry) override;
42
43 // InterfaceFactory<LifecycleControl>:
44 void Create(const Identity& remote_identity,
45 LifecycleControlRequest request) override;
46
47 // LifecycleControl:
48 void Ping(const PingCallback& callback) override;
49 void GracefulQuit() override;
50 void Crash() override;
51 void CloseShellConnection() override;
52
53 private:
54 void BindingLost();
55
56 ServiceRunner* runner_ = nullptr;
57 mojo::BindingSet<LifecycleControl> bindings_;
58 std::unique_ptr<ServiceContext> context_;
59
60 DISALLOW_COPY_AND_ASSIGN(AppClient);
61 };
62
63 } // namespace test
64 } // namespace shell
65
66 #endif // SERVICES_SHELL_TESTS_LIFECYCLE_APP_CLIENT_H_
OLDNEW
« no previous file with comments | « services/shell/tests/lifecycle/app.cc ('k') | services/shell/tests/lifecycle/app_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698