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 CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ | 5 #ifndef CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ |
6 #define CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ | 6 #define CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "chrome/common/origin_trials/origin_trial_key_manager.h" | 15 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
15 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
16 | 17 |
17 #if defined(ENABLE_PLUGINS) | 18 #if defined(ENABLE_PLUGINS) |
18 #include "content/public/common/pepper_plugin_info.h" | 19 #include "content/public/common/pepper_plugin_info.h" |
19 #endif | 20 #endif |
20 | 21 |
21 #include "url/url_util.h" | 22 #include "url/url_util.h" |
22 | 23 |
23 // Returns the user agent of Chrome. | 24 // Returns the user agent of Chrome. |
24 std::string GetUserAgent(); | 25 std::string GetUserAgent(); |
25 | 26 |
26 class ChromeContentClient : public content::ContentClient { | 27 class ChromeContentClient : public content::ContentClient { |
27 public: | 28 public: |
28 static const char kPDFPluginName[]; | 29 static const char kPDFPluginName[]; |
29 static const char kPDFPluginPath[]; | 30 static const char kPDFPluginPath[]; |
30 static const char kRemotingViewerPluginPath[]; | 31 static const char kRemotingViewerPluginPath[]; |
31 | 32 |
| 33 ChromeContentClient(); |
| 34 ~ChromeContentClient() override; |
| 35 |
32 // The methods below are called by child processes to set the function | 36 // The methods below are called by child processes to set the function |
33 // pointers for built-in plugins. We avoid linking these plugins into | 37 // pointers for built-in plugins. We avoid linking these plugins into |
34 // chrome_common because then on Windows we would ship them twice because of | 38 // chrome_common because then on Windows we would ship them twice because of |
35 // the split DLL. | 39 // the split DLL. |
36 #if !defined(DISABLE_NACL) | 40 #if !defined(DISABLE_NACL) |
37 static void SetNaClEntryFunctions( | 41 static void SetNaClEntryFunctions( |
38 content::PepperPluginInfo::GetInterfaceFunc get_interface, | 42 content::PepperPluginInfo::GetInterfaceFunc get_interface, |
39 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, | 43 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, |
40 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); | 44 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); |
41 #endif | 45 #endif |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 int* sandbox_profile_resource_id) const override; | 87 int* sandbox_profile_resource_id) const override; |
84 #endif | 88 #endif |
85 | 89 |
86 void AddSecureSchemesAndOrigins(std::set<std::string>* schemes, | 90 void AddSecureSchemesAndOrigins(std::set<std::string>* schemes, |
87 std::set<GURL>* origins) override; | 91 std::set<GURL>* origins) override; |
88 | 92 |
89 void AddServiceWorkerSchemes(std::set<std::string>* schemes) override; | 93 void AddServiceWorkerSchemes(std::set<std::string>* schemes) override; |
90 bool AllowScriptExtensionForServiceWorker(const GURL& script_url) override; | 94 bool AllowScriptExtensionForServiceWorker(const GURL& script_url) override; |
91 | 95 |
92 bool IsSupplementarySiteIsolationModeEnabled() override; | 96 bool IsSupplementarySiteIsolationModeEnabled() override; |
93 base::StringPiece GetOriginTrialPublicKey() override; | |
94 | 97 |
95 OriginTrialKeyManager* origin_trial_key_manager() { | 98 content::OriginTrialPolicy* GetOriginTrialPolicy() override; |
96 return &origin_trial_key_manager_; | |
97 } | |
98 | 99 |
99 #if defined(OS_ANDROID) | 100 #if defined(OS_ANDROID) |
100 media::MediaClientAndroid* GetMediaClientAndroid() override; | 101 media::MediaClientAndroid* GetMediaClientAndroid() override; |
101 #endif // OS_ANDROID | 102 #endif // OS_ANDROID |
102 | 103 |
103 private: | 104 private: |
104 OriginTrialKeyManager origin_trial_key_manager_; | 105 std::unique_ptr<ChromeOriginTrialPolicy> origin_trial_policy_; |
105 }; | 106 }; |
106 | 107 |
107 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ | 108 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ |
OLD | NEW |