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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 bool know_favicon, |
125 scoped_refptr<RefCountedMemory> data, | 125 scoped_refptr<RefCountedMemory> data, |
126 bool expired, | 126 bool expired, |
127 GURL icon_url); | 127 GURL icon_url, |
| 128 history::IconType icon_type); |
128 | 129 |
129 // If the favicon has expired, asks the renderer to download the favicon. | 130 // 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 | 131 // Otherwise asks history to update the mapping between page url and icon |
131 // url with a callback to OnFavIconData when done. | 132 // url with a callback to OnFavIconData when done. |
132 void DownloadFavIconOrAskHistory(NavigationEntry* entry); | 133 void DownloadFavIconOrAskHistory(NavigationEntry* entry); |
133 | 134 |
134 // See description above class for details. | 135 // See description above class for details. |
135 void OnFavIconData(FaviconService::Handle handle, | 136 void OnFavIconData(FaviconService::Handle handle, |
136 bool know_favicon, | 137 bool know_favicon, |
137 scoped_refptr<RefCountedMemory> data, | 138 scoped_refptr<RefCountedMemory> data, |
138 bool expired, | 139 bool expired, |
139 GURL icon_url); | 140 GURL icon_url, |
| 141 history::IconType icon_type); |
140 | 142 |
141 // Schedules a download for the specified entry. This adds the request to | 143 // Schedules a download for the specified entry. This adds the request to |
142 // download_requests_. | 144 // download_requests_. |
143 int ScheduleDownload(const GURL& url, const GURL& image_url, int image_size, | 145 int ScheduleDownload(const GURL& url, const GURL& image_url, int image_size, |
144 ImageDownloadCallback* callback); | 146 ImageDownloadCallback* callback); |
145 | 147 |
146 // Sets the image data for the favicon. This is invoked asynchronously after | 148 // Sets the image data for the favicon. This is invoked asynchronously after |
147 // we request the TabContents to download the favicon. | 149 // we request the TabContents to download the favicon. |
148 void SetFavIcon(const GURL& url, const GURL& icon_url, const SkBitmap& image); | 150 void SetFavIcon(const GURL& url, const GURL& icon_url, const SkBitmap& image); |
149 | 151 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool fav_icon_expired_; | 184 bool fav_icon_expired_; |
183 | 185 |
184 // Requests to the renderer to download favicons. | 186 // Requests to the renderer to download favicons. |
185 typedef std::map<int, DownloadRequest> DownloadRequests; | 187 typedef std::map<int, DownloadRequest> DownloadRequests; |
186 DownloadRequests download_requests_; | 188 DownloadRequests download_requests_; |
187 | 189 |
188 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); | 190 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); |
189 }; | 191 }; |
190 | 192 |
191 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ | 193 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ |
OLD | NEW |