| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 std::string ShellContentClient::GetUserAgent() const { | 94 std::string ShellContentClient::GetUserAgent() const { |
| 95 // Must contain a user agent string for version sniffing. For example, | 95 // Must contain a user agent string for version sniffing. For example, |
| 96 // pluginless WebRTC Hangouts checks the Chrome version number. | 96 // pluginless WebRTC Hangouts checks the Chrome version number. |
| 97 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); | 97 return content::BuildUserAgentFromProduct("Chrome/" PRODUCT_VERSION); |
| 98 } | 98 } |
| 99 | 99 |
| 100 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { | 100 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { |
| 101 return l10n_util::GetStringUTF16(message_id); | 101 return l10n_util::GetStringUTF16(message_id); |
| 102 } | 102 } |
| 103 | 103 |
| 104 base::string16 ShellContentClient::GetLocalizedStringF( |
| 105 int message_id, |
| 106 const base::string16& string0) const { |
| 107 return l10n_util::GetStringFUTF16(message_id, string0); |
| 108 } |
| 109 |
| 104 base::StringPiece ShellContentClient::GetDataResource( | 110 base::StringPiece ShellContentClient::GetDataResource( |
| 105 int resource_id, | 111 int resource_id, |
| 106 ui::ScaleFactor scale_factor) const { | 112 ui::ScaleFactor scale_factor) const { |
| 107 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 113 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
| 108 resource_id, scale_factor); | 114 resource_id, scale_factor); |
| 109 } | 115 } |
| 110 | 116 |
| 111 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( | 117 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( |
| 112 int resource_id) const { | 118 int resource_id) const { |
| 113 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 119 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
| 114 } | 120 } |
| 115 | 121 |
| 116 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 122 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
| 117 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 123 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
| 118 } | 124 } |
| 119 | 125 |
| 120 } // namespace extensions | 126 } // namespace extensions |
| OLD | NEW |