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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 GURL icon_url); | 72 GURL icon_url); |
73 | 73 |
74 // The Profile object used for accessing FaviconService, bookmarks model. | 74 // The Profile object used for accessing FaviconService, bookmarks model. |
75 Profile* profile_; | 75 Profile* profile_; |
76 | 76 |
77 // All URLs that are extracted from bookmarks. Used to fetch favicons | 77 // All URLs that are extracted from bookmarks. Used to fetch favicons |
78 // for each of them. After favicon is fetched top url is removed from list. | 78 // for each of them. After favicon is fetched top url is removed from list. |
79 std::list<std::string> bookmark_urls_; | 79 std::list<std::string> bookmark_urls_; |
80 | 80 |
81 // Consumer for requesting favicons. | 81 // Consumer for requesting favicons. |
82 CancelableRequestConsumer fav_icon_consumer_; | 82 CancelableRequestConsumer favicon_consumer_; |
83 | 83 |
84 // Map that stores favicon per URL. | 84 // Map that stores favicon per URL. |
85 scoped_ptr<URLFaviconMap> favicons_map_; | 85 scoped_ptr<URLFaviconMap> favicons_map_; |
86 | 86 |
87 // Path where html output is stored. | 87 // Path where html output is stored. |
88 FilePath path_; | 88 FilePath path_; |
89 | 89 |
90 BookmarksExportObserver* observer_; | 90 BookmarksExportObserver* observer_; |
91 | 91 |
92 NotificationRegistrar registrar_; | 92 NotificationRegistrar registrar_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(BookmarkFaviconFetcher); | 94 DISALLOW_COPY_AND_ASSIGN(BookmarkFaviconFetcher); |
95 }; | 95 }; |
96 | 96 |
97 namespace bookmark_html_writer { | 97 namespace bookmark_html_writer { |
98 | 98 |
99 // Writes the bookmarks out in the 'bookmarks.html' format understood by | 99 // Writes the bookmarks out in the 'bookmarks.html' format understood by |
100 // Firefox and IE. The results are written to the file at |path|. The file | 100 // Firefox and IE. The results are written to the file at |path|. The file |
101 // thread is used. | 101 // thread is used. |
102 // Before writing to the file favicons are fetched on the main thread. | 102 // Before writing to the file favicons are fetched on the main thread. |
103 // TODO(sky): need a callback on failure. | 103 // TODO(sky): need a callback on failure. |
104 void WriteBookmarks(Profile* profile, | 104 void WriteBookmarks(Profile* profile, |
105 const FilePath& path, | 105 const FilePath& path, |
106 BookmarksExportObserver* observer); | 106 BookmarksExportObserver* observer); |
107 | 107 |
108 } // namespace bookmark_html_writer | 108 } // namespace bookmark_html_writer |
109 | 109 |
110 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ | 110 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ |
OLD | NEW |