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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_CHROME_CONTENT_CLIENT_H_
6 #define CHROME_COMMON_CHROME_CONTENT_CLIENT_H_
11 #include "base/compiler_specific.h"
12 #include "base/files/file_path.h"
13 #include "content/public/common/content_client.h"
15 #if defined(ENABLE_PLUGINS)
16 #include "content/public/common/pepper_plugin_info.h"
19 // Returns the user agent of Chrome.
20 std::string
GetUserAgent();
22 class ChromeContentClient
: public content::ContentClient
{
24 static const char* const kPDFPluginName
;
25 static const char* const kRemotingViewerPluginPath
;
27 // The methods below are called by child processes to set the function
28 // pointers for built-in plugins. We avoid linking these plugins into
29 // chrome_common because then on Windows we would ship them twice because of
31 #if defined(ENABLE_REMOTING)
32 static void SetRemotingEntryFunctions(
33 content::PepperPluginInfo::GetInterfaceFunc get_interface
,
34 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module
,
35 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module
);
38 #if !defined(DISABLE_NACL)
39 static void SetNaClEntryFunctions(
40 content::PepperPluginInfo::GetInterfaceFunc get_interface
,
41 content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module
,
42 content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module
);
45 void SetActiveURL(const GURL
& url
) override
;
46 void SetGpuInfo(const gpu::GPUInfo
& gpu_info
) override
;
47 void AddPepperPlugins(
48 std::vector
<content::PepperPluginInfo
>* plugins
) override
;
49 void AddAdditionalSchemes(std::vector
<std::string
>* standard_schemes
,
50 std::vector
<std::string
>* saveable_shemes
) override
;
51 std::string
GetProduct() const override
;
52 std::string
GetUserAgent() const override
;
53 base::string16
GetLocalizedString(int message_id
) const override
;
54 base::StringPiece
GetDataResource(
56 ui::ScaleFactor scale_factor
) const override
;
57 base::RefCountedStaticMemory
* GetDataResourceBytes(
58 int resource_id
) const override
;
59 gfx::Image
& GetNativeImageNamed(int resource_id
) const override
;
60 std::string
GetProcessTypeNameInEnglish(int type
) override
;
62 #if defined(OS_MACOSX) && !defined(OS_IOS)
63 bool GetSandboxProfileForSandboxType(
65 int* sandbox_profile_resource_id
) const override
;
69 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_