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 #include "url/url_util.h" |
| 20 |
19 // Returns the user agent of Chrome. | 21 // Returns the user agent of Chrome. |
20 std::string GetUserAgent(); | 22 std::string GetUserAgent(); |
21 | 23 |
22 class ChromeContentClient : public content::ContentClient { | 24 class ChromeContentClient : public content::ContentClient { |
23 public: | 25 public: |
24 static const char kPDFPluginName[]; | 26 static const char kPDFPluginName[]; |
25 static const char kPDFPluginPath[]; | 27 static const char kPDFPluginPath[]; |
26 static const char kRemotingViewerPluginPath[]; | 28 static const char kRemotingViewerPluginPath[]; |
27 | 29 |
28 // The methods below are called by child processes to set the function | 30 // The methods below are called by child processes to set the function |
(...skipping 18 matching lines...) Expand all Loading... |
47 // plugin type. This function may return a nullptr if given an empty vector. | 49 // plugin type. This function may return a nullptr if given an empty vector. |
48 // The method is only visible for testing purposes. | 50 // The method is only visible for testing purposes. |
49 static content::PepperPluginInfo* FindMostRecentPlugin( | 51 static content::PepperPluginInfo* FindMostRecentPlugin( |
50 const std::vector<content::PepperPluginInfo*>& plugins); | 52 const std::vector<content::PepperPluginInfo*>& plugins); |
51 #endif | 53 #endif |
52 | 54 |
53 void SetActiveURL(const GURL& url) override; | 55 void SetActiveURL(const GURL& url) override; |
54 void SetGpuInfo(const gpu::GPUInfo& gpu_info) override; | 56 void SetGpuInfo(const gpu::GPUInfo& gpu_info) override; |
55 void AddPepperPlugins( | 57 void AddPepperPlugins( |
56 std::vector<content::PepperPluginInfo>* plugins) override; | 58 std::vector<content::PepperPluginInfo>* plugins) override; |
57 void AddAdditionalSchemes(std::vector<std::string>* standard_schemes, | 59 void AddAdditionalSchemes(std::vector<url::SchemeWithType>* standard_schemes, |
58 std::vector<std::string>* saveable_shemes) override; | 60 std::vector<std::string>* saveable_shemes) override; |
59 std::string GetProduct() const override; | 61 std::string GetProduct() const override; |
60 std::string GetUserAgent() const override; | 62 std::string GetUserAgent() const override; |
61 base::string16 GetLocalizedString(int message_id) const override; | 63 base::string16 GetLocalizedString(int message_id) const override; |
62 base::StringPiece GetDataResource( | 64 base::StringPiece GetDataResource( |
63 int resource_id, | 65 int resource_id, |
64 ui::ScaleFactor scale_factor) const override; | 66 ui::ScaleFactor scale_factor) const override; |
65 base::RefCountedStaticMemory* GetDataResourceBytes( | 67 base::RefCountedStaticMemory* GetDataResourceBytes( |
66 int resource_id) const override; | 68 int resource_id) const override; |
67 gfx::Image& GetNativeImageNamed(int resource_id) const override; | 69 gfx::Image& GetNativeImageNamed(int resource_id) const override; |
68 std::string GetProcessTypeNameInEnglish(int type) override; | 70 std::string GetProcessTypeNameInEnglish(int type) override; |
69 | 71 |
70 #if defined(OS_MACOSX) && !defined(OS_IOS) | 72 #if defined(OS_MACOSX) && !defined(OS_IOS) |
71 bool GetSandboxProfileForSandboxType( | 73 bool GetSandboxProfileForSandboxType( |
72 int sandbox_type, | 74 int sandbox_type, |
73 int* sandbox_profile_resource_id) const override; | 75 int* sandbox_profile_resource_id) const override; |
74 #endif | 76 #endif |
75 | 77 |
76 void AddSecureSchemesAndOrigins(std::set<std::string>* schemes, | 78 void AddSecureSchemesAndOrigins(std::set<std::string>* schemes, |
77 std::set<GURL>* origins) override; | 79 std::set<GURL>* origins) override; |
78 | 80 |
79 void AddServiceWorkerSchemes(std::set<std::string>* schemes) override; | 81 void AddServiceWorkerSchemes(std::set<std::string>* schemes) override; |
80 }; | 82 }; |
81 | 83 |
82 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ | 84 #endif // CHROME_COMMON_CHROME_CONTENT_CLIENT_H_ |
OLD | NEW |