| 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 <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/task/cancelable_task_tracker.h" | 15 #include "base/task/cancelable_task_tracker.h" |
| 16 #include "chrome/browser/favicon/favicon_service.h" | |
| 17 #include "chrome/browser/favicon/favicon_tab_helper.h" | 16 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 17 #include "components/favicon_base/favicon_callback.h" |
| 18 #include "components/favicon_base/favicon_types.h" |
| 18 #include "content/public/common/favicon_url.h" | 19 #include "content/public/common/favicon_url.h" |
| 19 #include "ui/gfx/favicon_size.h" | 20 #include "ui/gfx/favicon_size.h" |
| 20 #include "ui/gfx/image/image.h" | 21 #include "ui/gfx/image/image.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 class FaviconClient; | 24 class FaviconClient; |
| 24 class FaviconDriver; | 25 class FaviconDriver; |
| 25 class SkBitmap; | 26 class SkBitmap; |
| 26 | 27 |
| 27 namespace base { | 28 namespace base { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // TestFaviconHandler. | 120 // TestFaviconHandler. |
| 120 | 121 |
| 121 // Asks the render to download favicon, returns the request id. | 122 // Asks the render to download favicon, returns the request id. |
| 122 virtual int DownloadFavicon(const GURL& image_url, int max_bitmap_size); | 123 virtual int DownloadFavicon(const GURL& image_url, int max_bitmap_size); |
| 123 | 124 |
| 124 // Ask the favicon from history | 125 // Ask the favicon from history |
| 125 virtual void UpdateFaviconMappingAndFetch( | 126 virtual void UpdateFaviconMappingAndFetch( |
| 126 const GURL& page_url, | 127 const GURL& page_url, |
| 127 const GURL& icon_url, | 128 const GURL& icon_url, |
| 128 favicon_base::IconType icon_type, | 129 favicon_base::IconType icon_type, |
| 129 const FaviconService::FaviconResultsCallback& callback, | 130 const favicon_base::FaviconResultsCallback& callback, |
| 130 base::CancelableTaskTracker* tracker); | 131 base::CancelableTaskTracker* tracker); |
| 131 | 132 |
| 132 virtual void GetFaviconFromFaviconService( | 133 virtual void GetFaviconFromFaviconService( |
| 133 const GURL& icon_url, | 134 const GURL& icon_url, |
| 134 favicon_base::IconType icon_type, | 135 favicon_base::IconType icon_type, |
| 135 const FaviconService::FaviconResultsCallback& callback, | 136 const favicon_base::FaviconResultsCallback& callback, |
| 136 base::CancelableTaskTracker* tracker); | 137 base::CancelableTaskTracker* tracker); |
| 137 | 138 |
| 138 virtual void GetFaviconForURLFromFaviconService( | 139 virtual void GetFaviconForURLFromFaviconService( |
| 139 const GURL& page_url, | 140 const GURL& page_url, |
| 140 int icon_types, | 141 int icon_types, |
| 141 const FaviconService::FaviconResultsCallback& callback, | 142 const favicon_base::FaviconResultsCallback& callback, |
| 142 base::CancelableTaskTracker* tracker); | 143 base::CancelableTaskTracker* tracker); |
| 143 | 144 |
| 144 virtual void SetHistoryFavicons(const GURL& page_url, | 145 virtual void SetHistoryFavicons(const GURL& page_url, |
| 145 const GURL& icon_url, | 146 const GURL& icon_url, |
| 146 favicon_base::IconType icon_type, | 147 favicon_base::IconType icon_type, |
| 147 const gfx::Image& image); | 148 const gfx::Image& image); |
| 148 | 149 |
| 149 // Returns true if the favicon should be saved. | 150 // Returns true if the favicon should be saved. |
| 150 virtual bool ShouldSaveFavicon(const GURL& url); | 151 virtual bool ShouldSaveFavicon(const GURL& url); |
| 151 | 152 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // Best image we've seen so far. As images are downloaded from the page they | 290 // Best image we've seen so far. As images are downloaded from the page they |
| 290 // are stored here. When there is an exact match, or no more images are | 291 // are stored here. When there is an exact match, or no more images are |
| 291 // available the favicon service and the current page are updated (assuming | 292 // available the favicon service and the current page are updated (assuming |
| 292 // the image is for a favicon). | 293 // the image is for a favicon). |
| 293 FaviconCandidate best_favicon_candidate_; | 294 FaviconCandidate best_favicon_candidate_; |
| 294 | 295 |
| 295 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); | 296 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); |
| 296 }; | 297 }; |
| 297 | 298 |
| 298 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ | 299 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ |
| OLD | NEW |