| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class TargetPolicy; | 42 class TargetPolicy; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace content { | 45 namespace content { |
| 46 | 46 |
| 47 class ContentBrowserClient; | 47 class ContentBrowserClient; |
| 48 class ContentClient; | 48 class ContentClient; |
| 49 class ContentGpuClient; | 49 class ContentGpuClient; |
| 50 class ContentRendererClient; | 50 class ContentRendererClient; |
| 51 class ContentUtilityClient; | 51 class ContentUtilityClient; |
| 52 class OriginTrialPolicy; |
| 52 struct CdmInfo; | 53 struct CdmInfo; |
| 53 struct PepperPluginInfo; | 54 struct PepperPluginInfo; |
| 54 | 55 |
| 55 // Setter and getter for the client. The client should be set early, before any | 56 // Setter and getter for the client. The client should be set early, before any |
| 56 // content code is called. | 57 // content code is called. |
| 57 CONTENT_EXPORT void SetContentClient(ContentClient* client); | 58 CONTENT_EXPORT void SetContentClient(ContentClient* client); |
| 58 | 59 |
| 59 #if defined(CONTENT_IMPLEMENTATION) | 60 #if defined(CONTENT_IMPLEMENTATION) |
| 60 // Content's embedder API should only be used by content. | 61 // Content's embedder API should only be used by content. |
| 61 ContentClient* GetContentClient(); | 62 ContentClient* GetContentClient(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // service worker. | 162 // service worker. |
| 162 virtual bool AllowScriptExtensionForServiceWorker(const GURL& script_url); | 163 virtual bool AllowScriptExtensionForServiceWorker(const GURL& script_url); |
| 163 | 164 |
| 164 // Returns true if the embedder wishes to supplement the site isolation policy | 165 // Returns true if the embedder wishes to supplement the site isolation policy |
| 165 // used by the content layer. Returning true enables the infrastructure for | 166 // used by the content layer. Returning true enables the infrastructure for |
| 166 // out-of-process iframes, and causes the content layer to consult | 167 // out-of-process iframes, and causes the content layer to consult |
| 167 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process | 168 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process |
| 168 // model decisions. | 169 // model decisions. |
| 169 virtual bool IsSupplementarySiteIsolationModeEnabled(); | 170 virtual bool IsSupplementarySiteIsolationModeEnabled(); |
| 170 | 171 |
| 171 // Returns the public key to be used for origin trials, or an empty string if | 172 // Called by the renderer after the render thread has started, and allows the |
| 172 // origin trials are not enabled in this context. | 173 // embedder to set up any global origin trial policies (e.g. custom public |
| 173 virtual base::StringPiece GetOriginTrialPublicKey(); | 174 // key) |
| 175 virtual void InitializeOriginTrialPolicy(); |
| 176 |
| 177 // Returns the origin trial policy, or nullptr if origin trials are not |
| 178 // supported by the embedder. |
| 179 virtual const OriginTrialPolicy* GetOriginTrialPolicy() const; |
| 174 | 180 |
| 175 #if defined(OS_ANDROID) | 181 #if defined(OS_ANDROID) |
| 176 // Returns true for clients like Android WebView that uses synchronous | 182 // Returns true for clients like Android WebView that uses synchronous |
| 177 // compositor. Note setting this to true will permit synchronous IPCs from | 183 // compositor. Note setting this to true will permit synchronous IPCs from |
| 178 // the browser UI thread. | 184 // the browser UI thread. |
| 179 virtual bool UsingSynchronousCompositing(); | 185 virtual bool UsingSynchronousCompositing(); |
| 180 | 186 |
| 181 // Returns the MediaClientAndroid to be used by media code on Android. | 187 // Returns the MediaClientAndroid to be used by media code on Android. |
| 182 virtual media::MediaClientAndroid* GetMediaClientAndroid(); | 188 virtual media::MediaClientAndroid* GetMediaClientAndroid(); |
| 183 #endif // OS_ANDROID | 189 #endif // OS_ANDROID |
| 184 | 190 |
| 185 private: | 191 private: |
| 186 friend class ContentClientInitializer; // To set these pointers. | 192 friend class ContentClientInitializer; // To set these pointers. |
| 187 friend class InternalTestInitializer; | 193 friend class InternalTestInitializer; |
| 188 | 194 |
| 189 // The embedder API for participating in browser logic. | 195 // The embedder API for participating in browser logic. |
| 190 ContentBrowserClient* browser_; | 196 ContentBrowserClient* browser_; |
| 191 // The embedder API for participating in gpu logic. | 197 // The embedder API for participating in gpu logic. |
| 192 ContentGpuClient* gpu_; | 198 ContentGpuClient* gpu_; |
| 193 // The embedder API for participating in renderer logic. | 199 // The embedder API for participating in renderer logic. |
| 194 ContentRendererClient* renderer_; | 200 ContentRendererClient* renderer_; |
| 195 // The embedder API for participating in utility logic. | 201 // The embedder API for participating in utility logic. |
| 196 ContentUtilityClient* utility_; | 202 ContentUtilityClient* utility_; |
| 197 }; | 203 }; |
| 198 | 204 |
| 199 } // namespace content | 205 } // namespace content |
| 200 | 206 |
| 201 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 207 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
| OLD | NEW |