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