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

Side by Side Diff: chrome/browser/bookmarks/bookmark_html_writer.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 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 | « base/trace_event/trace_event_android.cc ('k') | chrome/browser/chromeos/app_mode/fake_cws.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/bookmarks/bookmark_html_writer.h" 5 #include "chrome/browser/bookmarks/bookmark_html_writer.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // Writes out the text string (as UTF8). The text is escaped based on 207 // Writes out the text string (as UTF8). The text is escaped based on
208 // type. 208 // type.
209 bool Write(const std::string& text, TextType type) { 209 bool Write(const std::string& text, TextType type) {
210 DCHECK(base::IsStringUTF8(text)); 210 DCHECK(base::IsStringUTF8(text));
211 std::string utf8_string; 211 std::string utf8_string;
212 212
213 switch (type) { 213 switch (type) {
214 case ATTRIBUTE_VALUE: 214 case ATTRIBUTE_VALUE:
215 // Convert " to " 215 // Convert " to "
216 utf8_string = text; 216 utf8_string = text;
217 ReplaceSubstringsAfterOffset(&utf8_string, 0, "\"", """); 217 base::ReplaceSubstringsAfterOffset(&utf8_string, 0, "\"", """);
218 break; 218 break;
219 219
220 case CONTENT: 220 case CONTENT:
221 utf8_string = net::EscapeForHTML(text); 221 utf8_string = net::EscapeForHTML(text);
222 break; 222 break;
223 223
224 default: 224 default:
225 NOTREACHED(); 225 NOTREACHED();
226 } 226 }
227 227
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // BookmarkModel isn't thread safe (nor would we want to lock it down 502 // BookmarkModel isn't thread safe (nor would we want to lock it down
503 // for the duration of the write), as such we make a copy of the 503 // for the duration of the write), as such we make a copy of the
504 // BookmarkModel using BookmarkCodec then write from that. 504 // BookmarkModel using BookmarkCodec then write from that.
505 if (fetcher == NULL) { 505 if (fetcher == NULL) {
506 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 506 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
507 fetcher->ExportBookmarks(); 507 fetcher->ExportBookmarks();
508 } 508 }
509 } 509 }
510 510
511 } // namespace bookmark_html_writer 511 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_android.cc ('k') | chrome/browser/chromeos/app_mode/fake_cws.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698