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" |
18 #include "components/favicon/core/favicon_url.h" | 17 #include "components/favicon/core/favicon_url.h" |
| 18 #include "components/favicon_base/favicon_callback.h" |
19 #include "ui/gfx/favicon_size.h" | 19 #include "ui/gfx/favicon_size.h" |
20 #include "ui/gfx/image/image.h" | 20 #include "ui/gfx/image/image.h" |
21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
22 | 22 |
23 class FaviconClient; | 23 class FaviconClient; |
24 class FaviconDriver; | 24 class FaviconDriver; |
25 class SkBitmap; | 25 class SkBitmap; |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class RefCountedMemory; | 28 class RefCountedMemory; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // TestFaviconHandler. | 119 // TestFaviconHandler. |
120 | 120 |
121 // Asks the render to download favicon, returns the request id. | 121 // Asks the render to download favicon, returns the request id. |
122 virtual int DownloadFavicon(const GURL& image_url, int max_bitmap_size); | 122 virtual int DownloadFavicon(const GURL& image_url, int max_bitmap_size); |
123 | 123 |
124 // Ask the favicon from history | 124 // Ask the favicon from history |
125 virtual void UpdateFaviconMappingAndFetch( | 125 virtual void UpdateFaviconMappingAndFetch( |
126 const GURL& page_url, | 126 const GURL& page_url, |
127 const GURL& icon_url, | 127 const GURL& icon_url, |
128 favicon_base::IconType icon_type, | 128 favicon_base::IconType icon_type, |
129 const FaviconService::FaviconResultsCallback& callback, | 129 const favicon_base::FaviconResultsCallback& callback, |
130 base::CancelableTaskTracker* tracker); | 130 base::CancelableTaskTracker* tracker); |
131 | 131 |
132 virtual void GetFaviconFromFaviconService( | 132 virtual void GetFaviconFromFaviconService( |
133 const GURL& icon_url, | 133 const GURL& icon_url, |
134 favicon_base::IconType icon_type, | 134 favicon_base::IconType icon_type, |
135 const FaviconService::FaviconResultsCallback& callback, | 135 const favicon_base::FaviconResultsCallback& callback, |
136 base::CancelableTaskTracker* tracker); | 136 base::CancelableTaskTracker* tracker); |
137 | 137 |
138 virtual void GetFaviconForURLFromFaviconService( | 138 virtual void GetFaviconForURLFromFaviconService( |
139 const GURL& page_url, | 139 const GURL& page_url, |
140 int icon_types, | 140 int icon_types, |
141 const FaviconService::FaviconResultsCallback& callback, | 141 const favicon_base::FaviconResultsCallback& callback, |
142 base::CancelableTaskTracker* tracker); | 142 base::CancelableTaskTracker* tracker); |
143 | 143 |
144 virtual void SetHistoryFavicons(const GURL& page_url, | 144 virtual void SetHistoryFavicons(const GURL& page_url, |
145 const GURL& icon_url, | 145 const GURL& icon_url, |
146 favicon_base::IconType icon_type, | 146 favicon_base::IconType icon_type, |
147 const gfx::Image& image); | 147 const gfx::Image& image); |
148 | 148 |
149 // Returns true if the favicon should be saved. | 149 // Returns true if the favicon should be saved. |
150 virtual bool ShouldSaveFavicon(const GURL& url); | 150 virtual bool ShouldSaveFavicon(const GURL& url); |
151 | 151 |
(...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 | 289 // 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 | 290 // 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 | 291 // available the favicon service and the current page are updated (assuming |
292 // the image is for a favicon). | 292 // the image is for a favicon). |
293 FaviconCandidate best_favicon_candidate_; | 293 FaviconCandidate best_favicon_candidate_; |
294 | 294 |
295 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); | 295 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); |
296 }; | 296 }; |
297 | 297 |
298 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ | 298 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ |
OLD | NEW |