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

Side by Side Diff: ui/base/template_expressions.cc

Issue 2834573004: [i18n] escape commas, polymer workaround (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/base/template_expressions.h" 5 #include "ui/base/template_expressions.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 13 matching lines...) Expand all
24 switch (c) { 24 switch (c) {
25 case '\\': 25 case '\\':
26 out.append("\\\\"); 26 out.append("\\\\");
27 break; 27 break;
28 case '\'': 28 case '\'':
29 out.append("\\'"); 29 out.append("\\'");
30 break; 30 break;
31 case '"': 31 case '"':
32 out.append("\\\""); 32 out.append("\\\"");
33 break; 33 break;
34 case ',':
35 out.append("\\,");
36 break;
34 default: 37 default:
35 out += c; 38 out += c;
36 } 39 }
37 } 40 }
38 return out; 41 return out;
39 } 42 }
40 43
41 } // namespace 44 } // namespace
42 45
43 namespace ui { 46 namespace ui {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 111 }
109 112
110 formatted.append(replacement); 113 formatted.append(replacement);
111 114
112 current_pos = key_end + sizeof(kKeyClose); 115 current_pos = key_end + sizeof(kKeyClose);
113 } 116 }
114 return formatted; 117 return formatted;
115 } 118 }
116 119
117 } // namespace ui 120 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698