summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/strings/string_util.cc75
-rw-r--r--base/strings/string_util.h57
-rw-r--r--chrome/browser/extensions/extension_storage_monitor.cc3
-rw-r--r--chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc3
-rw-r--r--chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader.cc4
-rw-r--r--chrome/browser/ui/cocoa/l10n_util.h2
-rw-r--r--chrome/browser/ui/cocoa/l10n_util.mm6
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.cc6
-rw-r--r--chrome/browser/web_resource/promo_resource_service_unittest.cc2
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc2
-rw-r--r--chrome/installer/util/l10n_string_util.cc7
-rw-r--r--chrome/installer/util/user_experiment.cc2
-rw-r--r--chrome/tools/mac_helpers/infoplist_strings_util.mm5
-rw-r--r--cloud_print/service/win/cloud_print_service.cc3
-rw-r--r--components/dom_distiller/core/viewer.cc2
-rw-r--r--components/history/core/test/history_unittest_base.cc2
-rw-r--r--content/child/blink_platform_impl.cc6
-rw-r--r--content/public/test/render_view_test.cc2
-rw-r--r--extensions/browser/api/app_window/app_window_api.cc2
-rw-r--r--extensions/browser/api/bluetooth/bluetooth_private_api.cc4
-rw-r--r--extensions/renderer/i18n_custom_bindings.cc2
-rw-r--r--ios/web/webui/shared_resources_data_source_ios.cc2
-rw-r--r--remoting/host/disconnect_window_win.cc6
-rw-r--r--ui/base/l10n/l10n_util.cc2
-rw-r--r--ui/base/webui/web_ui_util.cc2
25 files changed, 101 insertions, 108 deletions
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index a0c95ec..b6fad29 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -27,9 +27,7 @@
#include "base/third_party/icu/icu_utf.h"
#include "build/build_config.h"
-// Remove when this entire file is in the base namespace.
-using base::char16;
-using base::string16;
+namespace base {
namespace {
@@ -80,13 +78,13 @@ template<typename T> inline T* AlignToMachineWord(T* pointer) {
}
template<size_t size, typename CharacterType> struct NonASCIIMask;
-template<> struct NonASCIIMask<4, base::char16> {
+template<> struct NonASCIIMask<4, char16> {
static inline uint32_t value() { return 0xFF80FF80U; }
};
template<> struct NonASCIIMask<4, char> {
static inline uint32_t value() { return 0x80808080U; }
};
-template<> struct NonASCIIMask<8, base::char16> {
+template<> struct NonASCIIMask<8, char16> {
static inline uint64_t value() { return 0xFF80FF80FF80FF80ULL; }
};
template<> struct NonASCIIMask<8, char> {
@@ -115,8 +113,6 @@ struct CaseInsensitiveCompareDeprecated {
} // namespace
-namespace base {
-
bool IsWprintfFormatPortable(const wchar_t* format) {
for (const wchar_t* position = format; *position != '\0'; ++position) {
if (*position == '%') {
@@ -179,24 +175,24 @@ int CompareCaseInsensitiveASCIIT(BasicStringPiece<StringType> a,
return 1;
}
-int CompareCaseInsensitiveASCII(base::StringPiece a, base::StringPiece b) {
+int CompareCaseInsensitiveASCII(StringPiece a, StringPiece b) {
return CompareCaseInsensitiveASCIIT<std::string>(a, b);
}
-int CompareCaseInsensitiveASCII(base::StringPiece16 a, base::StringPiece16 b) {
- return CompareCaseInsensitiveASCIIT<base::string16>(a, b);
+int CompareCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b) {
+ return CompareCaseInsensitiveASCIIT<string16>(a, b);
}
-bool EqualsCaseInsensitiveASCII(base::StringPiece a, base::StringPiece b) {
+bool EqualsCaseInsensitiveASCII(StringPiece a, StringPiece b) {
if (a.length() != b.length())
return false;
return CompareCaseInsensitiveASCIIT<std::string>(a, b) == 0;
}
-bool EqualsCaseInsensitiveASCII(base::StringPiece16 a, base::StringPiece16 b) {
+bool EqualsCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b) {
if (a.length() != b.length())
return false;
- return CompareCaseInsensitiveASCIIT<base::string16>(a, b) == 0;
+ return CompareCaseInsensitiveASCIIT<string16>(a, b) == 0;
}
const std::string& EmptyString() {
@@ -228,27 +224,27 @@ bool ReplaceCharsT(const STR& input,
}
bool ReplaceChars(const string16& input,
- const base::StringPiece16& replace_chars,
+ const StringPiece16& replace_chars,
const string16& replace_with,
string16* output) {
return ReplaceCharsT(input, replace_chars.as_string(), replace_with, output);
}
bool ReplaceChars(const std::string& input,
- const base::StringPiece& replace_chars,
+ const StringPiece& replace_chars,
const std::string& replace_with,
std::string* output) {
return ReplaceCharsT(input, replace_chars.as_string(), replace_with, output);
}
bool RemoveChars(const string16& input,
- const base::StringPiece16& remove_chars,
+ const StringPiece16& remove_chars,
string16* output) {
return ReplaceChars(input, remove_chars.as_string(), string16(), output);
}
bool RemoveChars(const std::string& input,
- const base::StringPiece& remove_chars,
+ const StringPiece& remove_chars,
std::string* output) {
return ReplaceChars(input, remove_chars.as_string(), std::string(), output);
}
@@ -290,13 +286,13 @@ TrimPositions TrimStringT(const Str& input,
}
bool TrimString(const string16& input,
- base::StringPiece16 trim_chars,
+ StringPiece16 trim_chars,
string16* output) {
return TrimStringT(input, trim_chars, TRIM_ALL, output) != TRIM_NONE;
}
bool TrimString(const std::string& input,
- base::StringPiece trim_chars,
+ StringPiece trim_chars,
std::string* output) {
return TrimStringT(input, trim_chars, TRIM_ALL, output) != TRIM_NONE;
}
@@ -313,13 +309,13 @@ BasicStringPiece<Str> TrimStringPieceT(BasicStringPiece<Str> input,
}
StringPiece16 TrimString(StringPiece16 input,
- const base::StringPiece16& trim_chars,
+ const StringPiece16& trim_chars,
TrimPositions positions) {
return TrimStringPieceT(input, trim_chars, positions);
}
StringPiece TrimString(StringPiece input,
- const base::StringPiece& trim_chars,
+ const StringPiece& trim_chars,
TrimPositions positions) {
return TrimStringPieceT(input, trim_chars, positions);
}
@@ -592,7 +588,7 @@ bool StartsWithT(BasicStringPiece<Str> str,
return std::equal(
search_for.begin(), search_for.end(),
source.begin(),
- base::CaseInsensitiveCompareASCII<typename Str::value_type>());
+ CaseInsensitiveCompareASCII<typename Str::value_type>());
default:
NOTREACHED();
@@ -647,7 +643,7 @@ bool EndsWithT(BasicStringPiece<Str> str,
return std::equal(
source.begin(), source.end(),
search_for.begin(),
- base::CaseInsensitiveCompareASCII<typename Str::value_type>());
+ CaseInsensitiveCompareASCII<typename Str::value_type>());
default:
NOTREACHED();
@@ -880,7 +876,7 @@ char* WriteInto(std::string* str, size_t length_with_null) {
return WriteIntoT(str, length_with_null);
}
-char16* WriteInto(base::string16* str, size_t length_with_null) {
+char16* WriteInto(string16* str, size_t length_with_null) {
return WriteIntoT(str, length_with_null);
}
@@ -912,25 +908,22 @@ string16 JoinString(const std::vector<string16>& parts,
return JoinStringT(parts, separator);
}
-} // namespace base
-
template<class FormatStringType, class OutStringType>
-OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string,
- const std::vector<OutStringType>& subst, std::vector<size_t>* offsets) {
+OutStringType DoReplaceStringPlaceholders(
+ const FormatStringType& format_string,
+ const std::vector<OutStringType>& subst,
+ std::vector<size_t>* offsets) {
size_t substitutions = subst.size();
size_t sub_length = 0;
- for (typename std::vector<OutStringType>::const_iterator iter = subst.begin();
- iter != subst.end(); ++iter) {
- sub_length += iter->length();
- }
+ for (const auto& cur : subst)
+ sub_length += cur.length();
OutStringType formatted;
formatted.reserve(format_string.length() + sub_length);
std::vector<ReplacementOffset> r_offsets;
- for (typename FormatStringType::const_iterator i = format_string.begin();
- i != format_string.end(); ++i) {
+ for (auto i = format_string.begin(); i != format_string.end(); ++i) {
if ('$' == *i) {
if (i + 1 != format_string.end()) {
++i;
@@ -968,10 +961,8 @@ OutStringType DoReplaceStringPlaceholders(const FormatStringType& format_string,
}
}
if (offsets) {
- for (std::vector<ReplacementOffset>::const_iterator i = r_offsets.begin();
- i != r_offsets.end(); ++i) {
- offsets->push_back(i->offset);
- }
+ for (const auto& cur : r_offsets)
+ offsets->push_back(cur.offset);
}
return formatted;
}
@@ -982,7 +973,7 @@ string16 ReplaceStringPlaceholders(const string16& format_string,
return DoReplaceStringPlaceholders(format_string, subst, offsets);
}
-std::string ReplaceStringPlaceholders(const base::StringPiece& format_string,
+std::string ReplaceStringPlaceholders(const StringPiece& format_string,
const std::vector<std::string>& subst,
std::vector<size_t>* offsets) {
return DoReplaceStringPlaceholders(format_string, subst, offsets);
@@ -1026,9 +1017,11 @@ size_t lcpyT(CHAR* dst, const CHAR* src, size_t dst_size) {
} // namespace
-size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
+size_t strlcpy(char* dst, const char* src, size_t dst_size) {
return lcpyT<char>(dst, src, dst_size);
}
-size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
+size_t wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
return lcpyT<wchar_t>(dst, src, dst_size);
}
+
+} // namespace base
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index b75a9f88..d7a08c8 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -165,10 +165,10 @@ BASE_EXPORT extern const char kUtf8ByteOrderMark[];
// if any characters were removed. |remove_chars| must be null-terminated.
// NOTE: Safe to use the same variable for both |input| and |output|.
BASE_EXPORT bool RemoveChars(const string16& input,
- const base::StringPiece16& remove_chars,
+ const StringPiece16& remove_chars,
string16* output);
BASE_EXPORT bool RemoveChars(const std::string& input,
- const base::StringPiece& remove_chars,
+ const StringPiece& remove_chars,
std::string* output);
// Replaces characters in |replace_chars| from anywhere in |input| with
@@ -177,11 +177,11 @@ BASE_EXPORT bool RemoveChars(const std::string& input,
// |replace_chars| must be null-terminated.
// NOTE: Safe to use the same variable for both |input| and |output|.
BASE_EXPORT bool ReplaceChars(const string16& input,
- const base::StringPiece16& replace_chars,
+ const StringPiece16& replace_chars,
const string16& replace_with,
string16* output);
BASE_EXPORT bool ReplaceChars(const std::string& input,
- const base::StringPiece& replace_chars,
+ const StringPiece& replace_chars,
const std::string& replace_with,
std::string* output);
@@ -198,19 +198,19 @@ enum TrimPositions {
// It is safe to use the same variable for both |input| and |output| (this is
// the normal usage to trim in-place).
BASE_EXPORT bool TrimString(const string16& input,
- base::StringPiece16 trim_chars,
+ StringPiece16 trim_chars,
string16* output);
BASE_EXPORT bool TrimString(const std::string& input,
- base::StringPiece trim_chars,
+ StringPiece trim_chars,
std::string* output);
// StringPiece versions of the above. The returned pieces refer to the original
// buffer.
BASE_EXPORT StringPiece16 TrimString(StringPiece16 input,
- const base::StringPiece16& trim_chars,
+ const StringPiece16& trim_chars,
TrimPositions positions);
BASE_EXPORT StringPiece TrimString(StringPiece input,
- const base::StringPiece& trim_chars,
+ const StringPiece& trim_chars,
TrimPositions positions);
// Truncates a string to the nearest UTF-8 character that will leave
@@ -228,7 +228,7 @@ BASE_EXPORT void TruncateUTF8ToByteSize(const std::string& input,
// NOTE: Safe to use the same variable for both input and output.
BASE_EXPORT TrimPositions TrimWhitespace(const string16& input,
TrimPositions positions,
- base::string16* output);
+ string16* output);
BASE_EXPORT StringPiece16 TrimWhitespace(StringPiece16 input,
TrimPositions positions);
BASE_EXPORT TrimPositions TrimWhitespaceASCII(const std::string& input,
@@ -455,7 +455,7 @@ BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
// characters, for example:
// std::replace(str.begin(), str.end(), 'a', 'b');
BASE_EXPORT void ReplaceSubstringsAfterOffset(
- base::string16* str,
+ string16* str,
size_t start_offset,
StringPiece16 find_this,
StringPiece16 replace_with);
@@ -486,7 +486,7 @@ BASE_EXPORT void ReplaceSubstringsAfterOffset(
// than str.c_str() will get back a string of whatever size |str| had on entry
// to this function (probably 0).
BASE_EXPORT char* WriteInto(std::string* str, size_t length_with_null);
-BASE_EXPORT char16* WriteInto(base::string16* str, size_t length_with_null);
+BASE_EXPORT char16* WriteInto(string16* str, size_t length_with_null);
#ifndef OS_WIN
BASE_EXPORT wchar_t* WriteInto(std::wstring* str, size_t length_with_null);
#endif
@@ -497,34 +497,33 @@ BASE_EXPORT std::string JoinString(const std::vector<std::string>& parts,
BASE_EXPORT string16 JoinString(const std::vector<string16>& parts,
StringPiece16 separator);
-} // namespace base
-
-#if defined(OS_WIN)
-#include "base/strings/string_util_win.h"
-#elif defined(OS_POSIX)
-#include "base/strings/string_util_posix.h"
-#else
-#error Define string operations appropriately for your platform
-#endif
-
// Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively.
// Additionally, any number of consecutive '$' characters is replaced by that
// number less one. Eg $$->$, $$$->$$, etc. The offsets parameter here can be
// NULL. This only allows you to use up to nine replacements.
-BASE_EXPORT base::string16 ReplaceStringPlaceholders(
- const base::string16& format_string,
- const std::vector<base::string16>& subst,
+BASE_EXPORT string16 ReplaceStringPlaceholders(
+ const string16& format_string,
+ const std::vector<string16>& subst,
std::vector<size_t>* offsets);
BASE_EXPORT std::string ReplaceStringPlaceholders(
- const base::StringPiece& format_string,
+ const StringPiece& format_string,
const std::vector<std::string>& subst,
std::vector<size_t>* offsets);
// Single-string shortcut for ReplaceStringHolders. |offset| may be NULL.
-BASE_EXPORT base::string16 ReplaceStringPlaceholders(
- const base::string16& format_string,
- const base::string16& a,
- size_t* offset);
+BASE_EXPORT string16 ReplaceStringPlaceholders(const string16& format_string,
+ const string16& a,
+ size_t* offset);
+
+} // namespace base
+
+#if defined(OS_WIN)
+#include "base/strings/string_util_win.h"
+#elif defined(OS_POSIX)
+#include "base/strings/string_util_posix.h"
+#else
+#error Define string operations appropriately for your platform
+#endif
#endif // BASE_STRINGS_STRING_UTIL_H_
diff --git a/chrome/browser/extensions/extension_storage_monitor.cc b/chrome/browser/extensions/extension_storage_monitor.cc
index 564ab96..db0bc37e 100644
--- a/chrome/browser/extensions/extension_storage_monitor.cc
+++ b/chrome/browser/extensions/extension_storage_monitor.cc
@@ -380,7 +380,8 @@ std::string ExtensionStorageMonitor::GetNotificationId(
placeholders.push_back(context_->GetPath().BaseName().MaybeAsASCII());
placeholders.push_back(extension_id);
- return ReplaceStringPlaceholders(kNotificationIdFormat, placeholders, NULL);
+ return base::ReplaceStringPlaceholders(
+ kNotificationIdFormat, placeholders, NULL);
}
void ExtensionStorageMonitor::OnStorageThresholdExceeded(
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
index ba4e4ae..c89d357 100644
--- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
+++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
@@ -38,7 +38,8 @@ bool StringHasPlaceholders(const base::string16& input) {
std::vector<base::string16> subst;
subst.push_back(base::string16());
- base::string16 replaced = ReplaceStringPlaceholders(input, subst, &offsets);
+ base::string16 replaced =
+ base::ReplaceStringPlaceholders(input, subst, &offsets);
return !offsets.empty();
}
diff --git a/chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader.cc b/chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader.cc
index 789a2d2..d153d1f 100644
--- a/chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader.cc
+++ b/chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader.cc
@@ -62,7 +62,7 @@ void LauncherSearchIconImageLoader::LoadResources() {
params.push_back(GetTruncatedIconUrl(kTruncatedIconUrlMaxSize));
params.push_back(extensions::kExtensionScheme);
params.push_back(extension_->id());
- error_reporter_->Warn(ReplaceStringPlaceholders(
+ error_reporter_->Warn(base::ReplaceStringPlaceholders(
"$1 Invalid icon URL: $2. Must have a valid URL within $3://$4.",
params, nullptr));
return;
@@ -119,7 +119,7 @@ void LauncherSearchIconImageLoader::OnCustomIconLoaded(
std::vector<std::string> params;
params.push_back(kWarningMessagePrefix);
params.push_back(GetTruncatedIconUrl(kTruncatedIconUrlMaxSize));
- error_reporter_->Warn(ReplaceStringPlaceholders(
+ error_reporter_->Warn(base::ReplaceStringPlaceholders(
"$1 Failed to load icon URL: $2", params, nullptr));
return;
diff --git a/chrome/browser/ui/cocoa/l10n_util.h b/chrome/browser/ui/cocoa/l10n_util.h
index bc8baa5..c49d193 100644
--- a/chrome/browser/ui/cocoa/l10n_util.h
+++ b/chrome/browser/ui/cocoa/l10n_util.h
@@ -23,7 +23,7 @@ NSSize WrapOrSizeToFit(NSView* view);
// coordinates.
CGFloat VerticallyReflowGroup(NSArray* views);
-// Like |ReplaceStringPlaceholders(const base::string16&,
+// Like |base::ReplaceStringPlaceholders(const base::string16&,
// const base::string16&, size_t*)|, but for a NSString formatString.
NSString* ReplaceNSStringPlaceholders(NSString* formatString,
const base::string16& a,
diff --git a/chrome/browser/ui/cocoa/l10n_util.mm b/chrome/browser/ui/cocoa/l10n_util.mm
index 942de3b..7c3b4ad 100644
--- a/chrome/browser/ui/cocoa/l10n_util.mm
+++ b/chrome/browser/ui/cocoa/l10n_util.mm
@@ -69,10 +69,8 @@ CGFloat VerticallyReflowGroup(NSArray* views) {
NSString* ReplaceNSStringPlaceholders(NSString* formatString,
const base::string16& a,
size_t* offset) {
- return base::SysUTF16ToNSString(
- ReplaceStringPlaceholders(base::SysNSStringToUTF16(formatString),
- a,
- offset));
+ return base::SysUTF16ToNSString(base::ReplaceStringPlaceholders(
+ base::SysNSStringToUTF16(formatString), a, offset));
}
NSString* TooltipForURLAndTitle(NSString* url, NSString* title) {
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 6579db5..2724c7d 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -563,7 +563,7 @@ void NTPResourceCache::CreateNewTabIncognitoCSS() {
IDR_NEW_INCOGNITO_TAB_THEME_CSS));
// Create the string from our template and the replacements.
- std::string full_css = ReplaceStringPlaceholders(
+ std::string full_css = base::ReplaceStringPlaceholders(
new_tab_theme_css, subst, NULL);
new_tab_incognito_css_ = base::RefCountedString::TakeString(&full_css);
@@ -596,7 +596,7 @@ void NTPResourceCache::CreateNewTabGuestCSS() {
IDR_NEW_INCOGNITO_TAB_THEME_CSS));
// Create the string from our template and the replacements.
- std::string full_css = ReplaceStringPlaceholders(
+ std::string full_css = base::ReplaceStringPlaceholders(
new_tab_theme_css, subst, NULL);
new_tab_guest_css_ = base::RefCountedString::TakeString(&full_css);
@@ -692,6 +692,6 @@ void NTPResourceCache::CreateNewTabCSS() {
// Create the string from our template and the replacements.
std::string css_string;
- css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
+ css_string = base::ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
new_tab_css_ = base::RefCountedString::TakeString(&css_string);
}
diff --git a/chrome/browser/web_resource/promo_resource_service_unittest.cc b/chrome/browser/web_resource/promo_resource_service_unittest.cc
index 6fd084f..2756835 100644
--- a/chrome/browser/web_resource/promo_resource_service_unittest.cc
+++ b/chrome/browser/web_resource/promo_resource_service_unittest.cc
@@ -93,7 +93,7 @@ class NotificationPromoTest {
replacements.push_back(year_from_now_string);
std::string json_with_end_date(
- ReplaceStringPlaceholders(json, replacements, NULL));
+ base::ReplaceStringPlaceholders(json, replacements, NULL));
base::Value* value(base::JSONReader::DeprecatedRead(json_with_end_date));
ASSERT_TRUE(value);
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 8a9fc16..fe50c10 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -48,7 +48,7 @@ base::string16 LocalizeUrl(const wchar_t* url) {
base::string16 language;
if (!GoogleUpdateSettings::GetLanguage(&language))
language = L"en-US"; // Default to US English.
- return ReplaceStringPlaceholders(url, language.c_str(), NULL);
+ return base::ReplaceStringPlaceholders(url, language.c_str(), NULL);
}
base::string16 GetUninstallSurveyUrl() {
diff --git a/chrome/installer/util/l10n_string_util.cc b/chrome/installer/util/l10n_string_util.cc
index 3e38788..71963ce 100644
--- a/chrome/installer/util/l10n_string_util.cc
+++ b/chrome/installer/util/l10n_string_util.cc
@@ -57,9 +57,10 @@ std::wstring GetLocalizedString(int base_message_id) {
base::string16 GetLocalizedStringF(int base_message_id,
const base::string16& a) {
- return ReplaceStringPlaceholders(GetLocalizedString(base_message_id),
- std::vector<base::string16>(1, a),
- NULL);
+ return base::ReplaceStringPlaceholders(
+ GetLocalizedString(base_message_id),
+ std::vector<base::string16>(1, a),
+ NULL);
}
// Here we generate the url spec with the Microsoft res:// scheme which is
diff --git a/chrome/installer/util/user_experiment.cc b/chrome/installer/util/user_experiment.cc
index 4eb0b28..4a63eef 100644
--- a/chrome/installer/util/user_experiment.cc
+++ b/chrome/installer/util/user_experiment.cc
@@ -56,7 +56,7 @@ base::string16 LocalizeUrl(const wchar_t* url) {
base::string16 language;
if (!GoogleUpdateSettings::GetLanguage(&language))
language = L"en-US"; // Default to US English.
- return ReplaceStringPlaceholders(url, language.c_str(), NULL);
+ return base::ReplaceStringPlaceholders(url, language.c_str(), NULL);
}
base::string16 GetWelcomeBackUrl() {
diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm
index 765969f..1a6804c 100644
--- a/chrome/tools/mac_helpers/infoplist_strings_util.mm
+++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm
@@ -263,9 +263,8 @@ int main(int argc, char* const argv[]) {
std::vector<base::string16> replacements;
replacements.push_back(base::IntToString16(exploded_time.year));
NSString* copyright = base::SysUTF16ToNSString(
- ReplaceStringPlaceholders(base::SysNSStringToUTF16(copyright_format),
- replacements,
- NULL));
+ base::ReplaceStringPlaceholders(
+ base::SysNSStringToUTF16(copyright_format), replacements, NULL));
// For now, assume this is ok for all languages. If we need to, this could
// be moved into generated_resources.grd and fetched.
diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc
index b3761d3..fb73a9f 100644
--- a/cloud_print/service/win/cloud_print_service.cc
+++ b/cloud_print/service/win/cloud_print_service.cc
@@ -90,7 +90,8 @@ base::string16 GetOption(int string_id,
bool secure) {
base::string16 prompt_format = cloud_print::LoadLocalString(string_id);
std::vector<base::string16> substitutions(1, default_option);
- std::cout << ReplaceStringPlaceholders(prompt_format, substitutions, NULL);
+ std::cout <<
+ base::ReplaceStringPlaceholders(prompt_format, substitutions, NULL);
base::string16 tmp;
if (secure) {
DWORD saved_mode = 0;
diff --git a/components/dom_distiller/core/viewer.cc b/components/dom_distiller/core/viewer.cc
index 2e13161..53b84b7 100644
--- a/components/dom_distiller/core/viewer.cc
+++ b/components/dom_distiller/core/viewer.cc
@@ -144,7 +144,7 @@ std::string ReplaceHtmlTemplateValues(
substitutions.push_back(script.str()); // $8
- return ReplaceStringPlaceholders(html_template, substitutions, NULL);
+ return base::ReplaceStringPlaceholders(html_template, substitutions, NULL);
}
} // namespace
diff --git a/components/history/core/test/history_unittest_base.cc b/components/history/core/test/history_unittest_base.cc
index 040a474..fd18034 100644
--- a/components/history/core/test/history_unittest_base.cc
+++ b/components/history/core/test/history_unittest_base.cc
@@ -29,7 +29,7 @@ void HistoryUnitTestBase::ExecuteSQLScript(const base::FilePath& sql_path,
sql_time.push_back(base::StringPrintf("%" PRId64, now)); // last_visit_time
sql_time.push_back(base::StringPrintf("%" PRId64, now)); // visit_time
sql_time.push_back(base::StringPrintf("%" PRId64, now)); // time_slot
- sql = ReplaceStringPlaceholders(sql, sql_time, NULL);
+ sql = base::ReplaceStringPlaceholders(sql, sql_time, NULL);
sql::Connection connection;
ASSERT_TRUE(connection.Open(db_path));
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 1fbb0a5..41f46d4 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -1110,8 +1110,8 @@ WebString BlinkPlatformImpl::queryLocalizedString(
int message_id = ToMessageID(name);
if (message_id < 0)
return WebString();
- return ReplaceStringPlaceholders(GetContentClient()->GetLocalizedString(
- message_id), value, NULL);
+ return base::ReplaceStringPlaceholders(
+ GetContentClient()->GetLocalizedString(message_id), value, NULL);
}
WebString BlinkPlatformImpl::queryLocalizedString(
@@ -1125,7 +1125,7 @@ WebString BlinkPlatformImpl::queryLocalizedString(
values.reserve(2);
values.push_back(value1);
values.push_back(value2);
- return ReplaceStringPlaceholders(
+ return base::ReplaceStringPlaceholders(
GetContentClient()->GetLocalizedString(message_id), values, NULL);
}
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 52ea9c2b..351c3cc 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -340,7 +340,7 @@ gfx::Rect RenderViewTest::GetElementBounds(const std::string& element_id) {
std::vector<std::string> params;
params.push_back(element_id);
std::string script =
- ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL);
+ base::ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate);
diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc
index fcc5961..313568a 100644
--- a/extensions/browser/api/app_window/app_window_api.cc
+++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -86,7 +86,7 @@ bool CheckBoundsConflict(const scoped_ptr<int>& inner_property,
if (inner_property.get() && outer_property.get()) {
std::vector<std::string> subst;
subst.push_back(property_name);
- *error = ReplaceStringPlaceholders(
+ *error = base::ReplaceStringPlaceholders(
app_window_constants::kConflictingBoundsOptions, subst, NULL);
return false;
}
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
index 0ac112a..85bbbc5 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
@@ -228,8 +228,8 @@ void BluetoothPrivateSetAdapterStateFunction::SendError() {
std::vector<std::string> replacements(1);
replacements[0] = base::JoinString(failed_vector, ", ");
- std::string error =
- ReplaceStringPlaceholders(kSetAdapterPropertyError, replacements, NULL);
+ std::string error = base::ReplaceStringPlaceholders(kSetAdapterPropertyError,
+ replacements, NULL);
SetError(error);
SendResponse(false);
}
diff --git a/extensions/renderer/i18n_custom_bindings.cc b/extensions/renderer/i18n_custom_bindings.cc
index b5b3a4d..cf91030 100644
--- a/extensions/renderer/i18n_custom_bindings.cc
+++ b/extensions/renderer/i18n_custom_bindings.cc
@@ -81,7 +81,7 @@ void I18NCustomBindings::GetL10nMessage(
args.GetReturnValue().Set(v8::String::NewFromUtf8(
isolate,
- ReplaceStringPlaceholders(message, substitutions, NULL).c_str()));
+ base::ReplaceStringPlaceholders(message, substitutions, NULL).c_str()));
}
void I18NCustomBindings::GetL10nUILanguage(
diff --git a/ios/web/webui/shared_resources_data_source_ios.cc b/ios/web/webui/shared_resources_data_source_ios.cc
index 8545c4f..9806336 100644
--- a/ios/web/webui/shared_resources_data_source_ios.cc
+++ b/ios/web/webui/shared_resources_data_source_ios.cc
@@ -63,7 +63,7 @@ void SharedResourcesDataSourceIOS::StartDataRequest(
const std::string& chrome_shared =
web_client->GetDataResource(idr, ui::SCALE_FACTOR_NONE).as_string();
std::string replaced =
- ReplaceStringPlaceholders(chrome_shared, placeholders, nullptr);
+ base::ReplaceStringPlaceholders(chrome_shared, placeholders, nullptr);
bytes = base::RefCountedString::TakeString(&replaced);
} else {
bytes = web_client->GetDataResourceBytes(idr);
diff --git a/remoting/host/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc
index 7617b09..c0a7ecc 100644
--- a/remoting/host/disconnect_window_win.cc
+++ b/remoting/host/disconnect_window_win.cc
@@ -316,9 +316,9 @@ bool DisconnectWindowWin::SetStrings() {
}
// Format and truncate "Your desktop is shared with ..." message.
- message_text = ReplaceStringPlaceholders(message_text,
- base::UTF8ToUTF16(username_),
- nullptr);
+ message_text = base::ReplaceStringPlaceholders(message_text,
+ base::UTF8ToUTF16(username_),
+ nullptr);
if (message_text.length() > kMaxSharingWithTextLength)
message_text.erase(kMaxSharingWithTextLength);
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index 0ef20ba..de0e620 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -707,7 +707,7 @@ base::string16 GetStringFUTF16(int message_id,
}
#endif
- base::string16 formatted = ReplaceStringPlaceholders(
+ base::string16 formatted = base::ReplaceStringPlaceholders(
format_string, replacements, offsets);
AdjustParagraphDirectionality(&formatted);
diff --git a/ui/base/webui/web_ui_util.cc b/ui/base/webui/web_ui_util.cc
index 160f4da..c0f5a9d 100644
--- a/ui/base/webui/web_ui_util.cc
+++ b/ui/base/webui/web_ui_util.cc
@@ -130,7 +130,7 @@ std::string GetWebUiCssTextDefaults() {
resource_bundle.GetRawDataResource(IDR_WEBUI_CSS_TEXT_DEFAULTS)
.as_string();
- return ReplaceStringPlaceholders(css_template, placeholders, nullptr);
+ return base::ReplaceStringPlaceholders(css_template, placeholders, nullptr);
}
void AppendWebUiCssTextDefaults(std::string* html) {