OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ |
6 #define CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ | 6 #define CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
13 #include "content/public/common/mojo_application_info.h" | 13 #include "content/public/common/service_info.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace shell { | 17 namespace shell { |
18 class InterfaceRegistry; | 18 class InterfaceRegistry; |
19 class Service; | 19 class Service; |
20 } | 20 } |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 // Embedder API for participating in renderer logic. | 24 // Embedder API for participating in renderer logic. |
25 class CONTENT_EXPORT ContentUtilityClient { | 25 class CONTENT_EXPORT ContentUtilityClient { |
26 public: | 26 public: |
27 using StaticMojoApplicationMap = std::map<std::string, MojoApplicationInfo>; | 27 using StaticServiceMap = std::map<std::string, ServiceInfo>; |
28 | 28 |
29 virtual ~ContentUtilityClient() {} | 29 virtual ~ContentUtilityClient() {} |
30 | 30 |
31 // Notifies us that the UtilityThread has been created. | 31 // Notifies us that the UtilityThread has been created. |
32 virtual void UtilityThreadStarted() {} | 32 virtual void UtilityThreadStarted() {} |
33 | 33 |
34 // Allows the embedder to filter messages. | 34 // Allows the embedder to filter messages. |
35 virtual bool OnMessageReceived(const IPC::Message& message); | 35 virtual bool OnMessageReceived(const IPC::Message& message); |
36 | 36 |
37 // Allows the client to expose interfaces from this utility process to the | 37 // Allows the client to expose interfaces from this utility process to the |
38 // browser process via |registry|. | 38 // browser process via |registry|. |
39 virtual void ExposeInterfacesToBrowser(shell::InterfaceRegistry* registry) {} | 39 virtual void ExposeInterfacesToBrowser(shell::InterfaceRegistry* registry) {} |
40 | 40 |
41 // Registers Mojo applications. | 41 virtual void RegisterServices(StaticServiceMap* services) {} |
42 virtual void RegisterMojoApplications(StaticMojoApplicationMap* apps) {} | |
43 }; | 42 }; |
44 | 43 |
45 } // namespace content | 44 } // namespace content |
46 | 45 |
47 #endif // CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ | 46 #endif // CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |