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_BROWSER_FAVICON_SERVICE_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_BROWSER_FAVICON_SERVICE_H_ |
6 #define COMPONENTS_FAVICON_CORE_BROWSER_FAVICON_SERVICE_H_ | 6 #define COMPONENTS_FAVICON_CORE_BROWSER_FAVICON_SERVICE_H_ |
7 | 7 |
| 8 #include <hash_set> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
14 #include "components/favicon_base/favicon_callback.h" | 15 #include "components/favicon_base/favicon_callback.h" |
15 #include "components/favicon_base/favicon_types.h" | 16 #include "components/favicon_base/favicon_types.h" |
16 #include "components/favicon_base/favicon_usage_data.h" | 17 #include "components/favicon_base/favicon_usage_data.h" |
17 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const favicon_base::FaviconRawBitmapCallback& callback, | 122 const favicon_base::FaviconRawBitmapCallback& callback, |
122 base::CancelableTaskTracker* tracker); | 123 base::CancelableTaskTracker* tracker); |
123 | 124 |
124 base::CancelableTaskTracker::TaskId GetFaviconForPageURL( | 125 base::CancelableTaskTracker::TaskId GetFaviconForPageURL( |
125 const GURL& page_url, | 126 const GURL& page_url, |
126 int icon_types, | 127 int icon_types, |
127 int desired_size_in_dip, | 128 int desired_size_in_dip, |
128 const favicon_base::FaviconResultsCallback& callback, | 129 const favicon_base::FaviconResultsCallback& callback, |
129 base::CancelableTaskTracker* tracker); | 130 base::CancelableTaskTracker* tracker); |
130 | 131 |
| 132 // Requests a generic large icon, not caring about which type. |
| 133 base::CancelableTaskTracker::TaskId GetGenericLargeIconForPageURL( |
| 134 const GURL& page_url, |
| 135 int desired_size_in_pixel, |
| 136 const favicon_base::FaviconRawBitmapCallback& callback, |
| 137 base::CancelableTaskTracker* tracker); |
| 138 |
131 // Set the favicon mappings to |page_url| for |icon_types| in the history | 139 // Set the favicon mappings to |page_url| for |icon_types| in the history |
132 // database. | 140 // database. |
133 // Sample |icon_urls|: | 141 // Sample |icon_urls|: |
134 // { ICON_URL1 -> TOUCH_ICON, known to the database, | 142 // { ICON_URL1 -> TOUCH_ICON, known to the database, |
135 // ICON_URL2 -> TOUCH_ICON, not known to the database, | 143 // ICON_URL2 -> TOUCH_ICON, not known to the database, |
136 // ICON_URL3 -> TOUCH_PRECOMPOSED_ICON, known to the database } | 144 // ICON_URL3 -> TOUCH_PRECOMPOSED_ICON, known to the database } |
137 // The new mappings are computed from |icon_urls| with these rules: | 145 // The new mappings are computed from |icon_urls| with these rules: |
138 // 1) Any urls in |icon_urls| which are not already known to the database are | 146 // 1) Any urls in |icon_urls| which are not already known to the database are |
139 // rejected. | 147 // rejected. |
140 // Sample new mappings to |page_url|: { ICON_URL1, ICON_URL3 } | 148 // Sample new mappings to |page_url|: { ICON_URL1, ICON_URL3 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 favicon_bitmap_results); | 253 favicon_bitmap_results); |
246 | 254 |
247 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; | 255 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; |
248 history::HistoryService* history_service_; | 256 history::HistoryService* history_service_; |
249 FaviconClient* favicon_client_; | 257 FaviconClient* favicon_client_; |
250 | 258 |
251 DISALLOW_COPY_AND_ASSIGN(FaviconService); | 259 DISALLOW_COPY_AND_ASSIGN(FaviconService); |
252 }; | 260 }; |
253 | 261 |
254 #endif // COMPONENTS_FAVICON_CORE_BROWSER_FAVICON_SERVICE_H_ | 262 #endif // COMPONENTS_FAVICON_CORE_BROWSER_FAVICON_SERVICE_H_ |
OLD | NEW |