OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/error_utils.h" | 5 #include "extensions/common/error_utils.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
11 | 11 |
12 std::string ErrorUtils::FormatErrorMessage(const std::string& format, | 12 std::string ErrorUtils::FormatErrorMessage(const std::string& format, |
13 const std::string& s1) { | 13 const std::string& s1) { |
14 std::string ret_val = format; | 14 std::string ret_val = format; |
15 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); | 15 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); |
16 return ret_val; | 16 return ret_val; |
17 } | 17 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const std::string& s2, | 57 const std::string& s2, |
58 const std::string& s3) { | 58 const std::string& s3) { |
59 std::string ret_val = format; | 59 std::string ret_val = format; |
60 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); | 60 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); |
61 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); | 61 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); |
62 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3); | 62 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3); |
63 return UTF8ToUTF16(ret_val); | 63 return UTF8ToUTF16(ret_val); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
OLD | NEW |