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/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 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
26 #include "net/base/escape.h" | 26 #include "net/base/escape.h" |
27 #include "net/base/file_stream.h" | 27 #include "net/base/file_stream.h" |
28 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 | 30 |
| 31 using content::BrowserThread; |
| 32 |
31 namespace { | 33 namespace { |
32 | 34 |
33 static BookmarkFaviconFetcher* fetcher = NULL; | 35 static BookmarkFaviconFetcher* fetcher = NULL; |
34 | 36 |
35 // File header. | 37 // File header. |
36 const char kHeader[] = | 38 const char kHeader[] = |
37 "<!DOCTYPE NETSCAPE-Bookmark-file-1>\r\n" | 39 "<!DOCTYPE NETSCAPE-Bookmark-file-1>\r\n" |
38 "<!-- This is an automatically generated file.\r\n" | 40 "<!-- This is an automatically generated file.\r\n" |
39 " It will be read and overwritten.\r\n" | 41 " It will be read and overwritten.\r\n" |
40 " DO NOT EDIT! -->\r\n" | 42 " DO NOT EDIT! -->\r\n" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // BookmarkModel isn't thread safe (nor would we want to lock it down | 490 // BookmarkModel isn't thread safe (nor would we want to lock it down |
489 // for the duration of the write), as such we make a copy of the | 491 // for the duration of the write), as such we make a copy of the |
490 // BookmarkModel using BookmarkCodec then write from that. | 492 // BookmarkModel using BookmarkCodec then write from that. |
491 if (fetcher == NULL) { | 493 if (fetcher == NULL) { |
492 fetcher = new BookmarkFaviconFetcher(profile, path, observer); | 494 fetcher = new BookmarkFaviconFetcher(profile, path, observer); |
493 fetcher->ExportBookmarks(); | 495 fetcher->ExportBookmarks(); |
494 } | 496 } |
495 } | 497 } |
496 | 498 |
497 } // namespace bookmark_html_writer | 499 } // namespace bookmark_html_writer |
OLD | NEW |