diff --git a/extensions/common/error_utils.cc b/extensions/common/error_utils.cc index 4c40e20e20feea..2343c04bf7edfb 100644 --- a/extensions/common/error_utils.cc +++ b/extensions/common/error_utils.cc @@ -38,29 +38,20 @@ std::string ErrorUtils::FormatErrorMessage(const std::string& format, base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, const std::string& s1) { - std::string ret_val = format; - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); - return base::UTF8ToUTF16(ret_val); + return base::UTF8ToUTF16(FormatErrorMessage(format, s1)); } base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, const std::string& s1, const std::string& s2) { - std::string ret_val = format; - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); - return base::UTF8ToUTF16(ret_val); + return base::UTF8ToUTF16(FormatErrorMessage(format, s1, s2)); } base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, const std::string& s1, const std::string& s2, const std::string& s3) { - std::string ret_val = format; - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); - ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3); - return base::UTF8ToUTF16(ret_val); + return base::UTF8ToUTF16(FormatErrorMessage(format, s1, s2, s3)); } -} // namespace +} // namespace extensions