| 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 #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 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void ExecuteWriter(); | 58 void ExecuteWriter(); |
| 59 | 59 |
| 60 // Starts async fetch for the next bookmark favicon. | 60 // Starts async fetch for the next bookmark favicon. |
| 61 // Takes single url from bookmark_urls_ and removes it from the list. | 61 // Takes single url from bookmark_urls_ and removes it from the list. |
| 62 // Returns true if there are more favicons to extract. | 62 // Returns true if there are more favicons to extract. |
| 63 bool FetchNextFavicon(); | 63 bool FetchNextFavicon(); |
| 64 | 64 |
| 65 // Favicon fetch callback. After all favicons are fetched executes | 65 // Favicon fetch callback. After all favicons are fetched executes |
| 66 // html output on the file thread. | 66 // html output on the file thread. |
| 67 void OnFaviconDataAvailable(FaviconService::Handle handle, | 67 void OnFaviconDataAvailable(FaviconService::Handle handle, |
| 68 history::FaviconData favicon); | 68 history::FaviconData favicon_data, |
| 69 std::vector<GURL> icon_urls_in_db); |
| 69 | 70 |
| 70 // The Profile object used for accessing FaviconService, bookmarks model. | 71 // The Profile object used for accessing FaviconService, bookmarks model. |
| 71 Profile* profile_; | 72 Profile* profile_; |
| 72 | 73 |
| 73 // All URLs that are extracted from bookmarks. Used to fetch favicons | 74 // All URLs that are extracted from bookmarks. Used to fetch favicons |
| 74 // for each of them. After favicon is fetched top url is removed from list. | 75 // for each of them. After favicon is fetched top url is removed from list. |
| 75 std::list<std::string> bookmark_urls_; | 76 std::list<std::string> bookmark_urls_; |
| 76 | 77 |
| 77 // Consumer for requesting favicons. | 78 // Consumer for requesting favicons. |
| 78 CancelableRequestConsumer favicon_consumer_; | 79 CancelableRequestConsumer favicon_consumer_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 97 // thread is used. | 98 // thread is used. |
| 98 // Before writing to the file favicons are fetched on the main thread. | 99 // Before writing to the file favicons are fetched on the main thread. |
| 99 // TODO(sky): need a callback on failure. | 100 // TODO(sky): need a callback on failure. |
| 100 void WriteBookmarks(Profile* profile, | 101 void WriteBookmarks(Profile* profile, |
| 101 const FilePath& path, | 102 const FilePath& path, |
| 102 BookmarksExportObserver* observer); | 103 BookmarksExportObserver* observer); |
| 103 | 104 |
| 104 } // namespace bookmark_html_writer | 105 } // namespace bookmark_html_writer |
| 105 | 106 |
| 106 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ | 107 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_HTML_WRITER_H_ |
| OLD | NEW |