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 "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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 if (!WriteIndent() || | 301 if (!WriteIndent() || |
302 !Write(kFolderStart) || | 302 !Write(kFolderStart) || |
303 !WriteTime(date_added_string) || | 303 !WriteTime(date_added_string) || |
304 !Write(kLastModified) || | 304 !Write(kLastModified) || |
305 !WriteTime(last_modified_date)) { | 305 !WriteTime(last_modified_date)) { |
306 return false; | 306 return false; |
307 } | 307 } |
308 if (folder_type == BookmarkNode::BOOKMARK_BAR) { | 308 if (folder_type == BookmarkNode::BOOKMARK_BAR) { |
309 if (!Write(kBookmarkBar)) | 309 if (!Write(kBookmarkBar)) |
310 return false; | 310 return false; |
311 title = l10n_util::GetStringUTF8(IDS_BOOMARK_BAR_FOLDER_NAME); | 311 title = l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME); |
312 } else if (!Write(kFolderAttributeEnd)) { | 312 } else if (!Write(kFolderAttributeEnd)) { |
313 return false; | 313 return false; |
314 } | 314 } |
315 if (!Write(title, CONTENT) || | 315 if (!Write(title, CONTENT) || |
316 !Write(kFolderEnd) || | 316 !Write(kFolderEnd) || |
317 !Write(kNewline) || | 317 !Write(kNewline) || |
318 !WriteIndent() || | 318 !WriteIndent() || |
319 !Write(kFolderChildren) || | 319 !Write(kFolderChildren) || |
320 !Write(kNewline)) { | 320 !Write(kNewline)) { |
321 return false; | 321 return false; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 // BookmarkModel isn't thread safe (nor would we want to lock it down | 483 // BookmarkModel isn't thread safe (nor would we want to lock it down |
484 // for the duration of the write), as such we make a copy of the | 484 // for the duration of the write), as such we make a copy of the |
485 // BookmarkModel using BookmarkCodec then write from that. | 485 // BookmarkModel using BookmarkCodec then write from that. |
486 if (fetcher == NULL) { | 486 if (fetcher == NULL) { |
487 fetcher = new BookmarkFaviconFetcher(profile, path, observer); | 487 fetcher = new BookmarkFaviconFetcher(profile, path, observer); |
488 fetcher->ExportBookmarks(); | 488 fetcher->ExportBookmarks(); |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 } // namespace bookmark_html_writer | 492 } // namespace bookmark_html_writer |
OLD | NEW |