OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FAV_ICON_HELPER_H__ | 5 #ifndef CHROME_BROWSER_FAV_ICON_HELPER_H__ |
6 #define CHROME_BROWSER_FAV_ICON_HELPER_H__ | 6 #define CHROME_BROWSER_FAV_ICON_HELPER_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Return the NavigationEntry for the active entry, or NULL if the active | 114 // Return the NavigationEntry for the active entry, or NULL if the active |
115 // entries URL does not match that of the URL last passed to FetchFavIcon. | 115 // entries URL does not match that of the URL last passed to FetchFavIcon. |
116 NavigationEntry* GetEntry(); | 116 NavigationEntry* GetEntry(); |
117 | 117 |
118 Profile* profile(); | 118 Profile* profile(); |
119 | 119 |
120 FaviconService* GetFaviconService(); | 120 FaviconService* GetFaviconService(); |
121 | 121 |
122 // See description above class for details. | 122 // See description above class for details. |
123 void OnFavIconDataForInitialURL(FaviconService::Handle handle, | 123 void OnFavIconDataForInitialURL(FaviconService::Handle handle, |
124 bool know_favicon, | 124 history::FaviconData favicon); |
125 scoped_refptr<RefCountedMemory> data, | |
126 bool expired, | |
127 GURL icon_url); | |
128 | 125 |
129 // If the favicon has expired, asks the renderer to download the favicon. | 126 // If the favicon has expired, asks the renderer to download the favicon. |
130 // Otherwise asks history to update the mapping between page url and icon | 127 // Otherwise asks history to update the mapping between page url and icon |
131 // url with a callback to OnFavIconData when done. | 128 // url with a callback to OnFavIconData when done. |
132 void DownloadFavIconOrAskHistory(NavigationEntry* entry); | 129 void DownloadFavIconOrAskHistory(NavigationEntry* entry); |
133 | 130 |
134 // See description above class for details. | 131 // See description above class for details. |
135 void OnFavIconData(FaviconService::Handle handle, | 132 void OnFavIconData(FaviconService::Handle handle, |
136 bool know_favicon, | 133 history::FaviconData favicon); |
137 scoped_refptr<RefCountedMemory> data, | |
138 bool expired, | |
139 GURL icon_url); | |
140 | 134 |
141 // Schedules a download for the specified entry. This adds the request to | 135 // Schedules a download for the specified entry. This adds the request to |
142 // download_requests_. | 136 // download_requests_. |
143 int ScheduleDownload(const GURL& url, const GURL& image_url, int image_size, | 137 int ScheduleDownload(const GURL& url, const GURL& image_url, int image_size, |
144 ImageDownloadCallback* callback); | 138 ImageDownloadCallback* callback); |
145 | 139 |
146 // Sets the image data for the favicon. This is invoked asynchronously after | 140 // Sets the image data for the favicon. This is invoked asynchronously after |
147 // we request the TabContents to download the favicon. | 141 // we request the TabContents to download the favicon. |
148 void SetFavIcon(const GURL& url, const GURL& icon_url, const SkBitmap& image); | 142 void SetFavIcon(const GURL& url, const GURL& icon_url, const SkBitmap& image); |
149 | 143 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool fav_icon_expired_; | 176 bool fav_icon_expired_; |
183 | 177 |
184 // Requests to the renderer to download favicons. | 178 // Requests to the renderer to download favicons. |
185 typedef std::map<int, DownloadRequest> DownloadRequests; | 179 typedef std::map<int, DownloadRequest> DownloadRequests; |
186 DownloadRequests download_requests_; | 180 DownloadRequests download_requests_; |
187 | 181 |
188 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); | 182 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); |
189 }; | 183 }; |
190 | 184 |
191 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ | 185 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ |
OLD | NEW |