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 17 matching lines...) Expand all Loading... |
28 protected: | 28 protected: |
29 virtual ~BookmarksExportObserver() {} | 29 virtual ~BookmarksExportObserver() {} |
30 }; | 30 }; |
31 | 31 |
32 // Class that fetches favicons for list of bookmarks and | 32 // Class that fetches favicons for list of bookmarks and |
33 // then starts Writer which outputs bookmarks and favicons to html file. | 33 // then starts Writer which outputs bookmarks and favicons to html file. |
34 // Should be used only by WriteBookmarks function. | 34 // Should be used only by WriteBookmarks function. |
35 class BookmarkFaviconFetcher: public content::NotificationObserver { | 35 class BookmarkFaviconFetcher: public content::NotificationObserver { |
36 public: | 36 public: |
37 // Map of URL and corresponding favicons. | 37 // Map of URL and corresponding favicons. |
38 typedef std::map<std::string, scoped_refptr<RefCountedMemory> > URLFaviconMap; | 38 typedef std::map<std::string, scoped_refptr<base::RefCountedMemory> > |
| 39 URLFaviconMap; |
39 | 40 |
40 BookmarkFaviconFetcher(Profile* profile, | 41 BookmarkFaviconFetcher(Profile* profile, |
41 const FilePath& path, | 42 const FilePath& path, |
42 BookmarksExportObserver* observer); | 43 BookmarksExportObserver* observer); |
43 virtual ~BookmarkFaviconFetcher(); | 44 virtual ~BookmarkFaviconFetcher(); |
44 | 45 |
45 // Executes bookmark export process. | 46 // Executes bookmark export process. |
46 void ExportBookmarks(); | 47 void ExportBookmarks(); |
47 | 48 |
48 // content::NotificationObserver implementation. | 49 // content::NotificationObserver implementation. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |