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_COMMON_CONTENT_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 namespace sandbox { | 37 namespace sandbox { |
38 class TargetPolicy; | 38 class TargetPolicy; |
39 } | 39 } |
40 | 40 |
41 namespace content { | 41 namespace content { |
42 | 42 |
43 class ContentBrowserClient; | 43 class ContentBrowserClient; |
44 class ContentClient; | 44 class ContentClient; |
45 class ContentGpuClient; | 45 class ContentGpuClient; |
46 class ContentPluginClient; | |
47 class ContentRendererClient; | 46 class ContentRendererClient; |
48 class ContentUtilityClient; | 47 class ContentUtilityClient; |
49 struct PepperPluginInfo; | 48 struct PepperPluginInfo; |
50 | 49 |
51 // Setter and getter for the client. The client should be set early, before any | 50 // Setter and getter for the client. The client should be set early, before any |
52 // content code is called. | 51 // content code is called. |
53 CONTENT_EXPORT void SetContentClient(ContentClient* client); | 52 CONTENT_EXPORT void SetContentClient(ContentClient* client); |
54 | 53 |
55 #if defined(CONTENT_IMPLEMENTATION) | 54 #if defined(CONTENT_IMPLEMENTATION) |
56 // Content's embedder API should only be used by content. | 55 // Content's embedder API should only be used by content. |
(...skipping 10 matching lines...) Expand all Loading... |
67 ContentUtilityClient* u); | 66 ContentUtilityClient* u); |
68 | 67 |
69 // Interface that the embedder implements. | 68 // Interface that the embedder implements. |
70 class CONTENT_EXPORT ContentClient { | 69 class CONTENT_EXPORT ContentClient { |
71 public: | 70 public: |
72 ContentClient(); | 71 ContentClient(); |
73 virtual ~ContentClient(); | 72 virtual ~ContentClient(); |
74 | 73 |
75 ContentBrowserClient* browser() { return browser_; } | 74 ContentBrowserClient* browser() { return browser_; } |
76 ContentGpuClient* gpu() { return gpu_; } | 75 ContentGpuClient* gpu() { return gpu_; } |
77 ContentPluginClient* plugin() { return plugin_; } | |
78 ContentRendererClient* renderer() { return renderer_; } | 76 ContentRendererClient* renderer() { return renderer_; } |
79 ContentUtilityClient* utility() { return utility_; } | 77 ContentUtilityClient* utility() { return utility_; } |
80 | 78 |
81 // Sets the currently active URL. Use GURL() to clear the URL. | 79 // Sets the currently active URL. Use GURL() to clear the URL. |
82 virtual void SetActiveURL(const GURL& url) {} | 80 virtual void SetActiveURL(const GURL& url) {} |
83 | 81 |
84 // Sets the data on the current gpu. | 82 // Sets the data on the current gpu. |
85 virtual void SetGpuInfo(const gpu::GPUInfo& gpu_info) {} | 83 virtual void SetGpuInfo(const gpu::GPUInfo& gpu_info) {} |
86 | 84 |
87 // Gives the embedder a chance to register its own pepper plugins. | 85 // Gives the embedder a chance to register its own pepper plugins. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 virtual base::StringPiece GetOriginTrialPublicKey(); | 159 virtual base::StringPiece GetOriginTrialPublicKey(); |
162 | 160 |
163 private: | 161 private: |
164 friend class ContentClientInitializer; // To set these pointers. | 162 friend class ContentClientInitializer; // To set these pointers. |
165 friend class InternalTestInitializer; | 163 friend class InternalTestInitializer; |
166 | 164 |
167 // The embedder API for participating in browser logic. | 165 // The embedder API for participating in browser logic. |
168 ContentBrowserClient* browser_; | 166 ContentBrowserClient* browser_; |
169 // The embedder API for participating in gpu logic. | 167 // The embedder API for participating in gpu logic. |
170 ContentGpuClient* gpu_; | 168 ContentGpuClient* gpu_; |
171 // The embedder API for participating in plugin logic. | |
172 ContentPluginClient* plugin_; | |
173 // The embedder API for participating in renderer logic. | 169 // The embedder API for participating in renderer logic. |
174 ContentRendererClient* renderer_; | 170 ContentRendererClient* renderer_; |
175 // The embedder API for participating in utility logic. | 171 // The embedder API for participating in utility logic. |
176 ContentUtilityClient* utility_; | 172 ContentUtilityClient* utility_; |
177 }; | 173 }; |
178 | 174 |
179 } // namespace content | 175 } // namespace content |
180 | 176 |
181 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 177 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |