| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(Schemes* schemes) { | 77 void ShellContentClient::AddAdditionalSchemes(Schemes* schemes) { |
| 78 schemes->standard_schemes.push_back(extensions::kExtensionScheme); | 78 schemes->standard_schemes.push_back(extensions::kExtensionScheme); |
| 79 schemes->savable_schemes.push_back(kExtensionScheme); | 79 schemes->savable_schemes.push_back(kExtensionScheme); |
| 80 schemes->secure_schemes.push_back(kExtensionScheme); |
| 81 schemes->cors_enabled_schemes.push_back(kExtensionScheme); |
| 80 } | 82 } |
| 81 | 83 |
| 82 std::string ShellContentClient::GetUserAgent() const { | 84 std::string ShellContentClient::GetUserAgent() const { |
| 83 // Must contain a user agent string for version sniffing. For example, | 85 // Must contain a user agent string for version sniffing. For example, |
| 84 // pluginless WebRTC Hangouts checks the Chrome version number. | 86 // pluginless WebRTC Hangouts checks the Chrome version number. |
| 85 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); | 87 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); |
| 86 } | 88 } |
| 87 | 89 |
| 88 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { | 90 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { |
| 89 return l10n_util::GetStringUTF16(message_id); | 91 return l10n_util::GetStringUTF16(message_id); |
| 90 } | 92 } |
| 91 | 93 |
| 92 base::StringPiece ShellContentClient::GetDataResource( | 94 base::StringPiece ShellContentClient::GetDataResource( |
| 93 int resource_id, | 95 int resource_id, |
| 94 ui::ScaleFactor scale_factor) const { | 96 ui::ScaleFactor scale_factor) const { |
| 95 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 97 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
| 96 resource_id, scale_factor); | 98 resource_id, scale_factor); |
| 97 } | 99 } |
| 98 | 100 |
| 99 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes( | 101 base::RefCountedMemory* ShellContentClient::GetDataResourceBytes( |
| 100 int resource_id) const { | 102 int resource_id) const { |
| 101 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 103 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
| 102 } | 104 } |
| 103 | 105 |
| 104 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 106 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
| 105 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 107 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
| 106 } | 108 } |
| 107 | 109 |
| 108 } // namespace extensions | 110 } // namespace extensions |
| OLD | NEW |