Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Side by Side Diff: extensions/common/error_utils.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/browser/test_management_policy.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/strings/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 {
(...skipping 22 matching lines...) Expand all
33 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); 33 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
34 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); 34 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
35 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3); 35 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s3);
36 return ret_val; 36 return ret_val;
37 } 37 }
38 38
39 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, 39 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
40 const std::string& s1) { 40 const std::string& s1) {
41 std::string ret_val = format; 41 std::string ret_val = format;
42 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); 42 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
43 return UTF8ToUTF16(ret_val); 43 return base::UTF8ToUTF16(ret_val);
44 } 44 }
45 45
46 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, 46 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
47 const std::string& s1, 47 const std::string& s1,
48 const std::string& s2) { 48 const std::string& s2) {
49 std::string ret_val = format; 49 std::string ret_val = format;
50 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1); 50 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s1);
51 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2); 51 ReplaceFirstSubstringAfterOffset(&ret_val, 0, "*", s2);
52 return UTF8ToUTF16(ret_val); 52 return base::UTF8ToUTF16(ret_val);
53 } 53 }
54 54
55 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format, 55 base::string16 ErrorUtils::FormatErrorMessageUTF16(const std::string& format,
56 const std::string& s1, 56 const std::string& s1,
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 base::UTF8ToUTF16(ret_val);
64 } 64 }
65 65
66 } // namespace 66 } // namespace
OLDNEW
« no previous file with comments | « extensions/browser/test_management_policy.cc ('k') | extensions/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698