| 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_FAVICON_FAVICON_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ |
| 6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ | 6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 GURL url; | 184 GURL url; |
| 185 GURL image_url; | 185 GURL image_url; |
| 186 gfx::Image image; | 186 gfx::Image image; |
| 187 float score; | 187 float score; |
| 188 history::IconType icon_type; | 188 history::IconType icon_type; |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 // See description above class for details. | 191 // See description above class for details. |
| 192 void OnFaviconDataForInitialURL( | 192 void OnFaviconDataForInitialURL( |
| 193 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results, | 193 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results); |
| 194 const history::IconURLSizesMap& icon_url_sizes); | |
| 195 | 194 |
| 196 // If the favicon has expired, asks the renderer to download the favicon. | 195 // If the favicon has expired, asks the renderer to download the favicon. |
| 197 // Otherwise asks history to update the mapping between page url and icon | 196 // Otherwise asks history to update the mapping between page url and icon |
| 198 // url with a callback to OnFaviconData when done. | 197 // url with a callback to OnFaviconData when done. |
| 199 void DownloadFaviconOrAskHistory(const GURL& page_url, | 198 void DownloadFaviconOrAskHistory(const GURL& page_url, |
| 200 const GURL& icon_url, | 199 const GURL& icon_url, |
| 201 history::IconType icon_type); | 200 history::IconType icon_type); |
| 202 | 201 |
| 203 // See description above class for details. | 202 // See description above class for details. |
| 204 void OnFaviconData( | 203 void OnFaviconData( |
| 205 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results, | 204 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results); |
| 206 const history::IconURLSizesMap& icon_url_sizes); | |
| 207 | 205 |
| 208 // Schedules a download for the specified entry. This adds the request to | 206 // Schedules a download for the specified entry. This adds the request to |
| 209 // download_requests_. | 207 // download_requests_. |
| 210 int ScheduleDownload(const GURL& url, | 208 int ScheduleDownload(const GURL& url, |
| 211 const GURL& image_url, | 209 const GURL& image_url, |
| 212 int image_size, | 210 int image_size, |
| 213 history::IconType icon_type); | 211 history::IconType icon_type); |
| 214 | 212 |
| 215 // Updates |favicon_candidate_| and returns true if it is an exact match. | 213 // Updates |favicon_candidate_| and returns true if it is an exact match. |
| 216 bool UpdateFaviconCandidate(const GURL& url, | 214 bool UpdateFaviconCandidate(const GURL& url, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // This handler's delegate. | 278 // This handler's delegate. |
| 281 FaviconHandlerDelegate* delegate_; // weak | 279 FaviconHandlerDelegate* delegate_; // weak |
| 282 | 280 |
| 283 // Current favicon candidate. | 281 // Current favicon candidate. |
| 284 FaviconCandidate favicon_candidate_; | 282 FaviconCandidate favicon_candidate_; |
| 285 | 283 |
| 286 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); | 284 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); |
| 287 }; | 285 }; |
| 288 | 286 |
| 289 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ | 287 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ |
| OLD | NEW |