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> |
| 9 |
| 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/scoped_ptr.h" |
8 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
9 | 13 |
| 14 class GURL; |
| 15 |
| 16 namespace mojo { |
| 17 class ApplicationDelegate; |
| 18 } |
| 19 |
10 namespace content { | 20 namespace content { |
11 | 21 |
12 class ServiceRegistry; | 22 class ServiceRegistry; |
13 | 23 |
14 // Embedder API for participating in renderer logic. | 24 // Embedder API for participating in renderer logic. |
15 class CONTENT_EXPORT ContentUtilityClient { | 25 class CONTENT_EXPORT ContentUtilityClient { |
16 public: | 26 public: |
| 27 using StaticMojoApplicationMap = |
| 28 std::map<GURL, base::Callback<scoped_ptr<mojo::ApplicationDelegate>()>>; |
| 29 |
17 virtual ~ContentUtilityClient() {} | 30 virtual ~ContentUtilityClient() {} |
18 | 31 |
19 // Notifies us that the UtilityThread has been created. | 32 // Notifies us that the UtilityThread has been created. |
20 virtual void UtilityThreadStarted() {} | 33 virtual void UtilityThreadStarted() {} |
21 | 34 |
22 // Allows the embedder to filter messages. | 35 // Allows the embedder to filter messages. |
23 virtual bool OnMessageReceived(const IPC::Message& message); | 36 virtual bool OnMessageReceived(const IPC::Message& message); |
24 | 37 |
25 // Registers Mojo services. | 38 // Registers Mojo services. |
26 virtual void RegisterMojoServices(ServiceRegistry* registry) {} | 39 virtual void RegisterMojoServices(ServiceRegistry* registry) {} |
| 40 |
| 41 // Registers Mojo applications. |
| 42 virtual void RegisterMojoApplications(StaticMojoApplicationMap* apps) {} |
27 }; | 43 }; |
28 | 44 |
29 } // namespace content | 45 } // namespace content |
30 | 46 |
31 #endif // CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ | 47 #endif // CONTENT_PUBLIC_UTILITY_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |