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 COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ | 5 #ifndef COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ |
6 #define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ | 6 #define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" | 10 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" |
11 #include "mojo/shell/public/cpp/application_delegate.h" | |
12 #include "mojo/shell/public/cpp/interface_factory.h" | 11 #include "mojo/shell/public/cpp/interface_factory.h" |
| 12 #include "mojo/shell/public/cpp/shell_client.h" |
13 | 13 |
14 namespace devtools_service { | 14 namespace devtools_service { |
15 | 15 |
16 class DevToolsService; | 16 class DevToolsService; |
17 | 17 |
18 class DevToolsServiceDelegate | 18 class DevToolsServiceDelegate |
19 : public mojo::ApplicationDelegate, | 19 : public mojo::ShellClient, |
20 public mojo::InterfaceFactory<DevToolsRegistry>, | 20 public mojo::InterfaceFactory<DevToolsRegistry>, |
21 public mojo::InterfaceFactory<DevToolsCoordinator> { | 21 public mojo::InterfaceFactory<DevToolsCoordinator> { |
22 public: | 22 public: |
23 DevToolsServiceDelegate(); | 23 DevToolsServiceDelegate(); |
24 ~DevToolsServiceDelegate() override; | 24 ~DevToolsServiceDelegate() override; |
25 | 25 |
26 private: | 26 private: |
27 // mojo::ApplicationDelegate implementation. | 27 // mojo::Connection implementation. |
28 void Initialize(mojo::Shell* shell, const std::string& url, | 28 void Initialize(mojo::Shell* shell, const std::string& url, |
29 uint32_t id) override; | 29 uint32_t id) override; |
30 bool AcceptConnection( | 30 bool AcceptConnection(mojo::Connection* connection) override; |
31 mojo::ApplicationConnection* connection) override; | |
32 void Quit() override; | 31 void Quit() override; |
33 | 32 |
34 // mojo::InterfaceFactory<DevToolsRegistry> implementation. | 33 // mojo::InterfaceFactory<DevToolsRegistry> implementation. |
35 void Create(mojo::ApplicationConnection* connection, | 34 void Create(mojo::Connection* connection, |
36 mojo::InterfaceRequest<DevToolsRegistry> request) override; | 35 mojo::InterfaceRequest<DevToolsRegistry> request) override; |
37 | 36 |
38 // mojo::InterfaceFactory<DevToolsCoordinator> implementation. | 37 // mojo::InterfaceFactory<DevToolsCoordinator> implementation. |
39 void Create(mojo::ApplicationConnection* connection, | 38 void Create(mojo::Connection* connection, |
40 mojo::InterfaceRequest<DevToolsCoordinator> request) override; | 39 mojo::InterfaceRequest<DevToolsCoordinator> request) override; |
41 | 40 |
42 scoped_ptr<DevToolsService> service_; | 41 scoped_ptr<DevToolsService> service_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(DevToolsServiceDelegate); | 43 DISALLOW_COPY_AND_ASSIGN(DevToolsServiceDelegate); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace devtools_service | 46 } // namespace devtools_service |
48 | 47 |
49 #endif // COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ | 48 #endif // COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_ |
OLD | NEW |