OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 namespace sandbox { | 25 namespace sandbox { |
26 class TargetPolicy; | 26 class TargetPolicy; |
27 } | 27 } |
28 | 28 |
29 namespace webkit { | 29 namespace webkit { |
30 namespace npapi { | 30 namespace npapi { |
31 class PluginList; | 31 class PluginList; |
32 } | 32 } |
| 33 |
| 34 namespace ppapi { |
| 35 class HostGlobals; |
| 36 } |
33 } | 37 } |
34 | 38 |
35 namespace content { | 39 namespace content { |
36 | 40 |
37 class ContentBrowserClient; | 41 class ContentBrowserClient; |
38 class ContentClient; | 42 class ContentClient; |
39 class ContentPluginClient; | 43 class ContentPluginClient; |
40 class ContentRendererClient; | 44 class ContentRendererClient; |
41 class ContentUtilityClient; | 45 class ContentUtilityClient; |
42 struct GPUInfo; | 46 struct GPUInfo; |
43 struct PepperPluginInfo; | 47 struct PepperPluginInfo; |
44 | 48 |
45 // Setter and getter for the client. The client should be set early, before any | 49 // Setter and getter for the client. The client should be set early, before any |
46 // content code is called. | 50 // content code is called. |
47 CONTENT_EXPORT void SetContentClient(ContentClient* client); | 51 CONTENT_EXPORT void SetContentClient(ContentClient* client); |
48 CONTENT_EXPORT ContentClient* GetContentClient(); | 52 CONTENT_EXPORT ContentClient* GetContentClient(); |
49 | 53 |
50 // Returns the user agent string being used by the browser. SetContentClient() | 54 // Returns the user agent string being used by the browser. SetContentClient() |
51 // must be called prior to calling this, and this routine must be used | 55 // must be called prior to calling this, and this routine must be used |
52 // instead of webkit_glue::GetUserAgent() in order to ensure that we use | 56 // instead of webkit_glue::GetUserAgent() in order to ensure that we use |
53 // the same user agent string everywhere. | 57 // the same user agent string everywhere. |
54 // TODO(dpranke): This is caused by webkit_glue being a library that can | 58 // TODO(dpranke): This is caused by webkit_glue being a library that can |
55 // get linked into multiple linkable objects, causing us to have multiple | 59 // get linked into multiple linkable objects, causing us to have multiple |
56 // static values of the user agent. This will be fixed when we clean up | 60 // static values of the user agent. This will be fixed when we clean up |
57 // webkit_glue. | 61 // webkit_glue. |
58 CONTENT_EXPORT const std::string& GetUserAgent(const GURL& url); | 62 CONTENT_EXPORT const std::string& GetUserAgent(const GURL& url); |
59 | 63 |
| 64 // Returns the PPAPI global singleton. See webkit/plugins/ppapi/host_globals.h |
| 65 // TODO(dpranke): Also needed since webkit_glue is a library. |
| 66 CONTENT_EXPORT webkit::ppapi::HostGlobals* GetHostGlobals(); |
| 67 |
60 // Interface that the embedder implements. | 68 // Interface that the embedder implements. |
61 class CONTENT_EXPORT ContentClient { | 69 class CONTENT_EXPORT ContentClient { |
62 public: | 70 public: |
63 ContentClient(); | 71 ContentClient(); |
64 virtual ~ContentClient(); | 72 virtual ~ContentClient(); |
65 | 73 |
66 ContentBrowserClient* browser() { return browser_; } | 74 ContentBrowserClient* browser() { return browser_; } |
67 void set_browser(ContentBrowserClient* c) { browser_ = c; } | 75 void set_browser(ContentBrowserClient* c) { browser_ = c; } |
68 ContentPluginClient* plugin() { return plugin_; } | 76 ContentPluginClient* plugin() { return plugin_; } |
69 void set_plugin(ContentPluginClient* p) { plugin_ = p; } | 77 void set_plugin(ContentPluginClient* p) { plugin_ = p; } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ContentPluginClient* plugin_; | 139 ContentPluginClient* plugin_; |
132 // The embedder API for participating in renderer logic. | 140 // The embedder API for participating in renderer logic. |
133 ContentRendererClient* renderer_; | 141 ContentRendererClient* renderer_; |
134 // The embedder API for participating in utility logic. | 142 // The embedder API for participating in utility logic. |
135 ContentUtilityClient* utility_; | 143 ContentUtilityClient* utility_; |
136 }; | 144 }; |
137 | 145 |
138 } // namespace content | 146 } // namespace content |
139 | 147 |
140 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 148 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |