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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 28 matching lines...) Expand all Loading... | |
39 virtual ~FaviconService(); | 39 virtual ~FaviconService(); |
40 | 40 |
41 // Auxiliary argument structure for requesting favicons for URLs. | 41 // Auxiliary argument structure for requesting favicons for URLs. |
42 struct FaviconForURLParams { | 42 struct FaviconForURLParams { |
43 FaviconForURLParams(Profile* profile, | 43 FaviconForURLParams(Profile* profile, |
44 const GURL& page_url, | 44 const GURL& page_url, |
45 int icon_types, | 45 int icon_types, |
46 int desired_size_in_dip) | 46 int desired_size_in_dip) |
47 : profile(profile), | 47 : profile(profile), |
48 page_url(page_url), | 48 page_url(page_url), |
49 icon_types(icon_types), | 49 desired_size_in_dip(desired_size_in_dip), |
50 desired_size_in_dip(desired_size_in_dip) {} | 50 threshold_for_next_icon_types(0) { |
51 icon_types_priority.push_back(icon_types); | |
52 } | |
53 | |
54 // Used to get best fit icon with icon types priority, see | |
55 // HistoryService::GetFaviconsForURL. | |
56 FaviconForURLParams(Profile* profile, | |
57 const GURL& page_url, | |
58 const std::vector<int>& icon_types_priority, | |
59 int desired_size_in_dip, | |
60 int threshold_for_next_icon_types) | |
61 : profile(profile), | |
62 page_url(page_url), | |
63 icon_types_priority(icon_types_priority), | |
64 desired_size_in_dip(desired_size_in_dip), | |
65 threshold_for_next_icon_types(threshold_for_next_icon_types) {} | |
51 | 66 |
52 Profile* profile; | 67 Profile* profile; |
sky
2013/10/10 20:35:12
Since the new args are not clear you need to point
michaelbai
2013/10/10 22:39:58
I did it at line 54-55.
On 2013/10/10 20:35:12, s
| |
53 GURL page_url; | 68 GURL page_url; |
54 int icon_types; | 69 std::vector<int> icon_types_priority; |
55 int desired_size_in_dip; | 70 int desired_size_in_dip; |
71 int threshold_for_next_icon_types; | |
56 }; | 72 }; |
57 | 73 |
58 // Callback for GetFaviconImage() and GetFaviconImageForURL(). | 74 // Callback for GetFaviconImage() and GetFaviconImageForURL(). |
59 // |FaviconImageResult::image| is constructed from the bitmaps for the | 75 // |FaviconImageResult::image| is constructed from the bitmaps for the |
60 // passed in URL and icon types which most which closely match the passed in | 76 // passed in URL and icon types which most which closely match the passed in |
61 // |desired_size_in_dip| at the scale factors supported by the current | 77 // |desired_size_in_dip| at the scale factors supported by the current |
62 // platform (eg MacOS) in addition to 1x. | 78 // platform (eg MacOS) in addition to 1x. |
63 // |FaviconImageResult::icon_url| is the favicon that the favicon bitmaps in | 79 // |FaviconImageResult::icon_url| is the favicon that the favicon bitmaps in |
64 // |image| originate from. | 80 // |image| originate from. |
65 // TODO(pkotwicz): Enable constructing |image| from bitmaps from several | 81 // TODO(pkotwicz): Enable constructing |image| from bitmaps from several |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 void RunFaviconRawCallbackWithBitmapResults( | 277 void RunFaviconRawCallbackWithBitmapResults( |
262 const FaviconRawCallback& callback, | 278 const FaviconRawCallback& callback, |
263 int desired_size_in_dip, | 279 int desired_size_in_dip, |
264 ui::ScaleFactor desired_scale_factor, | 280 ui::ScaleFactor desired_scale_factor, |
265 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); | 281 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); |
266 | 282 |
267 DISALLOW_COPY_AND_ASSIGN(FaviconService); | 283 DISALLOW_COPY_AND_ASSIGN(FaviconService); |
268 }; | 284 }; |
269 | 285 |
270 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 286 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
OLD | NEW |