| 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 COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| 6 #define COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 6 #define COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 bool UpdateFaviconCandidate(const GURL& image_url, | 246 bool UpdateFaviconCandidate(const GURL& image_url, |
| 247 const gfx::Image& image, | 247 const gfx::Image& image, |
| 248 float score, | 248 float score, |
| 249 favicon_base::IconType icon_type); | 249 favicon_base::IconType icon_type); |
| 250 | 250 |
| 251 // Sets the image data for the favicon. | 251 // Sets the image data for the favicon. |
| 252 void SetFavicon(const GURL& icon_url, | 252 void SetFavicon(const GURL& icon_url, |
| 253 const gfx::Image& image, | 253 const gfx::Image& image, |
| 254 favicon_base::IconType icon_type); | 254 favicon_base::IconType icon_type); |
| 255 | 255 |
| 256 // Considers the current candidate finished and can (a) stop working if an |
| 257 // exact match was found or no candidates are left; or (b) increase |
| 258 // |current_candidate_index_| and start processing the next candidate. |
| 259 void CurrentCandidateFinished(bool found_exact_match); |
| 260 |
| 256 // Notifies |driver_| that FaviconHandler found an icon which matches the | 261 // Notifies |driver_| that FaviconHandler found an icon which matches the |
| 257 // |handler_type_| criteria. NotifyFaviconUpdated() can be called multiple | 262 // |handler_type_| criteria. NotifyFaviconUpdated() can be called multiple |
| 258 // times for the same page if: | 263 // times for the same page if: |
| 259 // - a better match is found for |handler_type_| (e.g. newer bitmap data) | 264 // - a better match is found for |handler_type_| (e.g. newer bitmap data) |
| 260 // - Javascript changes the page's icon URLs. | 265 // - Javascript changes the page's icon URLs. |
| 261 void NotifyFaviconUpdated( | 266 void NotifyFaviconUpdated( |
| 262 const std::vector<favicon_base::FaviconRawBitmapResult>& | 267 const std::vector<favicon_base::FaviconRawBitmapResult>& |
| 263 favicon_bitmap_results); | 268 favicon_bitmap_results); |
| 264 void NotifyFaviconUpdated(const GURL& icon_url, | 269 void NotifyFaviconUpdated(const GURL& icon_url, |
| 265 favicon_base::IconType icon_type, | 270 favicon_base::IconType icon_type, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 FaviconCandidate best_favicon_candidate_; | 342 FaviconCandidate best_favicon_candidate_; |
| 338 | 343 |
| 339 base::WeakPtrFactory<FaviconHandler> weak_ptr_factory_; | 344 base::WeakPtrFactory<FaviconHandler> weak_ptr_factory_; |
| 340 | 345 |
| 341 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); | 346 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); |
| 342 }; | 347 }; |
| 343 | 348 |
| 344 } // namespace favicon | 349 } // namespace favicon |
| 345 | 350 |
| 346 #endif // COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 351 #endif // COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| OLD | NEW |