| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "content/public/common/content_client.h" | 13 #include "content/public/common/content_client.h" |
| 14 | 14 |
| 15 #if defined(ENABLE_PLUGINS) | 15 #if defined(ENABLE_PLUGINS) |
| 16 #include "content/public/common/pepper_plugin_info.h" | 16 #include "content/public/common/pepper_plugin_info.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 // Returns the user agent of Chrome. | 19 // Returns the user agent of Chrome. |
| 20 std::string GetUserAgent(); | 20 std::string GetUserAgent(); |
| 21 | 21 |
| 22 class ChromeContentClient : public content::ContentClient { | 22 class ChromeContentClient : public content::ContentClient { |
| 23 public: | 23 public: |
| 24 static const char* const kPDFPluginName; | 24 static const char* const kPDFPluginName; |
| 25 static const char* const kPDFPluginPath; | |
| 26 static const char* const kRemotingViewerPluginPath; | 25 static const char* const kRemotingViewerPluginPath; |
| 27 | 26 |
| 28 // The methods below are called by child processes to set the function | 27 // The methods below are called by child processes to set the function |
| 29 // pointers for built-in plugins. We avoid linking these plugins into | 28 // pointers for built-in plugins. We avoid linking these plugins into |
| 30 // chrome_common because then on Windows we would ship them twice because of | 29 // chrome_common because then on Windows we would ship them twice because of |
| 31 // the split DLL. | 30 // the split DLL. |
| 32 #if defined(ENABLE_REMOTING) | 31 #if defined(ENABLE_REMOTING) |
| 33 static void SetRemotingEntryFunctions( | 32 static void SetRemotingEntryFunctions( |
| 34 content::PepperPluginInfo::GetInterfaceFunc get_interface, | 33 content::PepperPluginInfo::GetInterfaceFunc get_interface, |
| 35 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, | 34 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, |
| 36 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); | 35 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); |
| 37 #endif | 36 #endif |
| 38 | 37 |
| 39 #if !defined(DISABLE_NACL) | 38 #if !defined(DISABLE_NACL) |
| 40 static void SetNaClEntryFunctions( | 39 static void SetNaClEntryFunctions( |
| 41 content::PepperPluginInfo::GetInterfaceFunc get_interface, | 40 content::PepperPluginInfo::GetInterfaceFunc get_interface, |
| 42 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, | 41 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, |
| 43 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); | 42 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); |
| 44 #endif | |
| 45 | |
| 46 #if defined(ENABLE_PLUGINS) | |
| 47 static void SetPDFEntryFunctions( | |
| 48 content::PepperPluginInfo::GetInterfaceFunc get_interface, | |
| 49 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, | |
| 50 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); | |
| 51 #endif | 43 #endif |
| 52 | 44 |
| 53 void SetActiveURL(const GURL& url) override; | 45 void SetActiveURL(const GURL& url) override; |
| 54 void SetGpuInfo(const gpu::GPUInfo& gpu_info) override; | 46 void SetGpuInfo(const gpu::GPUInfo& gpu_info) override; |
| 55 void AddPepperPlugins( | 47 void AddPepperPlugins( |
| 56 std::vector<content::PepperPluginInfo>* plugins) override; | 48 std::vector<content::PepperPluginInfo>* plugins) override; |
| 57 void AddAdditionalSchemes(std::vector<std::string>* standard_schemes, | 49 void AddAdditionalSchemes(std::vector<std::string>* standard_schemes, |
| 58 std::vector<std::string>* saveable_shemes) override; | 50 std::vector<std::string>* saveable_shemes) override; |
| 59 std::string GetProduct() const override; | 51 std::string GetProduct() const override; |
| 60 std::string GetUserAgent() const override; | 52 std::string GetUserAgent() const override; |
| 61 base::string16 GetLocalizedString(int message_id) const override; | 53 base::string16 GetLocalizedString(int message_id) const override; |
| 62 base::StringPiece GetDataResource( | 54 base::StringPiece GetDataResource( |
| 63 int resource_id, | 55 int resource_id, |
| 64 ui::ScaleFactor scale_factor) const override; | 56 ui::ScaleFactor scale_factor) const override; |
| 65 base::RefCountedStaticMemory* GetDataResourceBytes( | 57 base::RefCountedStaticMemory* GetDataResourceBytes( |
| 66 int resource_id) const override; | 58 int resource_id) const override; |
| 67 gfx::Image& GetNativeImageNamed(int resource_id) const override; | 59 gfx::Image& GetNativeImageNamed(int resource_id) const override; |
| 68 std::string GetProcessTypeNameInEnglish(int type) override; | 60 std::string GetProcessTypeNameInEnglish(int type) override; |
| 69 | 61 |
| 70 #if defined(OS_MACOSX) && !defined(OS_IOS) | 62 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 71 bool GetSandboxProfileForSandboxType( | 63 bool GetSandboxProfileForSandboxType( |
| 72 int sandbox_type, | 64 int sandbox_type, |
| 73 int* sandbox_profile_resource_id) const override; | 65 int* sandbox_profile_resource_id) const override; |
| 74 #endif | 66 #endif |
| 75 }; | 67 }; |
| 76 | 68 |
| 77 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ | 69 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ |
| OLD | NEW |