OLD | NEW |
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 12 matching lines...) Expand all Loading... |
23 #include "components/bookmarks/browser/bookmark_model.h" | 23 #include "components/bookmarks/browser/bookmark_model.h" |
24 #include "components/favicon_base/favicon_types.h" | 24 #include "components/favicon_base/favicon_types.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
27 #include "grit/components_strings.h" | 27 #include "grit/components_strings.h" |
28 #include "net/base/escape.h" | 28 #include "net/base/escape.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/gfx/favicon_size.h" | 30 #include "ui/gfx/favicon_size.h" |
31 | 31 |
32 using bookmarks::BookmarkCodec; | 32 using bookmarks::BookmarkCodec; |
| 33 using bookmarks::BookmarkNode; |
33 using content::BrowserThread; | 34 using content::BrowserThread; |
34 | 35 |
35 namespace { | 36 namespace { |
36 | 37 |
37 static BookmarkFaviconFetcher* fetcher = NULL; | 38 static BookmarkFaviconFetcher* fetcher = NULL; |
38 | 39 |
39 // File header. | 40 // File header. |
40 const char kHeader[] = | 41 const char kHeader[] = |
41 "<!DOCTYPE NETSCAPE-Bookmark-file-1>\r\n" | 42 "<!DOCTYPE NETSCAPE-Bookmark-file-1>\r\n" |
42 "<!-- This is an automatically generated file.\r\n" | 43 "<!-- This is an automatically generated file.\r\n" |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // BookmarkModel isn't thread safe (nor would we want to lock it down | 501 // BookmarkModel isn't thread safe (nor would we want to lock it down |
501 // for the duration of the write), as such we make a copy of the | 502 // for the duration of the write), as such we make a copy of the |
502 // BookmarkModel using BookmarkCodec then write from that. | 503 // BookmarkModel using BookmarkCodec then write from that. |
503 if (fetcher == NULL) { | 504 if (fetcher == NULL) { |
504 fetcher = new BookmarkFaviconFetcher(profile, path, observer); | 505 fetcher = new BookmarkFaviconFetcher(profile, path, observer); |
505 fetcher->ExportBookmarks(); | 506 fetcher->ExportBookmarks(); |
506 } | 507 } |
507 } | 508 } |
508 | 509 |
509 } // namespace bookmark_html_writer | 510 } // namespace bookmark_html_writer |
OLD | NEW |