OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/shell/common/shell_content_client.h" | 5 #include "extensions/shell/common/shell_content_client.h" |
6 | 6 |
7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/public/common/user_agent.h" | 9 #include "content/public/common/user_agent.h" |
10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; | 67 nacl.internal_entry_points.get_interface = nacl_plugin::PPP_GetInterface; |
68 nacl.internal_entry_points.initialize_module = | 68 nacl.internal_entry_points.initialize_module = |
69 nacl_plugin::PPP_InitializeModule; | 69 nacl_plugin::PPP_InitializeModule; |
70 nacl.internal_entry_points.shutdown_module = | 70 nacl.internal_entry_points.shutdown_module = |
71 nacl_plugin::PPP_ShutdownModule; | 71 nacl_plugin::PPP_ShutdownModule; |
72 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; | 72 nacl.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; |
73 plugins->push_back(nacl); | 73 plugins->push_back(nacl); |
74 #endif // !defined(DISABLE_NACL) | 74 #endif // !defined(DISABLE_NACL) |
75 } | 75 } |
76 | 76 |
77 void ShellContentClient::AddAdditionalSchemes( | 77 void ShellContentClient::AddAdditionalSchemes(Schemes* schemes) { |
78 std::vector<url::SchemeWithType>* standard_schemes, | 78 schemes->standard_schemes.push_back(extensions::kExtensionScheme); |
79 std::vector<url::SchemeWithType>* referrer_schemes, | 79 schemes->savable_schemes.push_back(kExtensionScheme); |
80 std::vector<std::string>* savable_schemes) { | |
81 standard_schemes->push_back(url::SchemeWithType{extensions::kExtensionScheme, | |
82 url::SCHEME_WITHOUT_PORT}); | |
83 savable_schemes->push_back(kExtensionScheme); | |
84 } | 80 } |
85 | 81 |
86 std::string ShellContentClient::GetUserAgent() const { | 82 std::string ShellContentClient::GetUserAgent() const { |
87 // Must contain a user agent string for version sniffing. For example, | 83 // Must contain a user agent string for version sniffing. For example, |
88 // pluginless WebRTC Hangouts checks the Chrome version number. | 84 // pluginless WebRTC Hangouts checks the Chrome version number. |
89 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); | 85 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); |
90 } | 86 } |
91 | 87 |
92 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { | 88 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { |
93 return l10n_util::GetStringUTF16(message_id); | 89 return l10n_util::GetStringUTF16(message_id); |
94 } | 90 } |
95 | 91 |
96 base::StringPiece ShellContentClient::GetDataResource( | 92 base::StringPiece ShellContentClient::GetDataResource( |
97 int resource_id, | 93 int resource_id, |
98 ui::ScaleFactor scale_factor) const { | 94 ui::ScaleFactor scale_factor) const { |
99 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 95 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
100 resource_id, scale_factor); | 96 resource_id, scale_factor); |
101 } | 97 } |
102 | 98 |
103 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes( | 99 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes( |
104 int resource_id) const { | 100 int resource_id) const { |
105 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 101 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
106 } | 102 } |
107 | 103 |
108 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 104 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
109 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 105 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
110 } | 106 } |
111 | 107 |
112 } // namespace extensions | 108 } // namespace extensions |
OLD | NEW |