OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_FAVICON_TYPES_H_ | 5 #ifndef COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
6 #define COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ | 6 #define COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
7 | 7 |
8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/memory/scoped_ptr.h" |
9 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
10 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
12 | 13 |
13 namespace favicon_base { | 14 namespace favicon_base { |
14 | 15 |
| 16 struct FallbackIconStyle; |
| 17 |
15 typedef int64 FaviconID; | 18 typedef int64 FaviconID; |
16 | 19 |
17 // Defines the icon types. They are also stored in icon_type field of favicons | 20 // Defines the icon types. They are also stored in icon_type field of favicons |
18 // table. | 21 // table. |
19 // The values of the IconTypes are used to select the priority in which favicon | 22 // The values of the IconTypes are used to select the priority in which favicon |
20 // data is returned in HistoryBackend and ThumbnailDatabase. Data for the | 23 // data is returned in HistoryBackend and ThumbnailDatabase. Data for the |
21 // largest IconType takes priority if data for multiple IconTypes is available. | 24 // largest IconType takes priority if data for multiple IconTypes is available. |
22 enum IconType { | 25 enum IconType { |
23 INVALID_ICON = 0x0, | 26 INVALID_ICON = 0x0, |
24 FAVICON = 1 << 0, | 27 FAVICON = 1 << 0, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 GURL icon_url; | 68 GURL icon_url; |
66 | 69 |
67 // The icon type of the containing favicon. | 70 // The icon type of the containing favicon. |
68 IconType icon_type; | 71 IconType icon_type; |
69 }; | 72 }; |
70 | 73 |
71 // Define type with same structure as FaviconRawBitmapResult for passing data to | 74 // Define type with same structure as FaviconRawBitmapResult for passing data to |
72 // HistoryBackend::SetFavicons(). | 75 // HistoryBackend::SetFavicons(). |
73 typedef FaviconRawBitmapResult FaviconRawBitmapData; | 76 typedef FaviconRawBitmapResult FaviconRawBitmapData; |
74 | 77 |
| 78 // Result returned by LargeIconService::GetLargeIconOrFallbackStyle(). Contains |
| 79 // either the bitmap data if the favicon database has a sufficiently large |
| 80 // favicon bitmap and the style of the fallback icon otherwise. |
| 81 struct LargeIconResult { |
| 82 LargeIconResult(); |
| 83 ~LargeIconResult(); |
| 84 |
| 85 // The bitmap from the favicon database if the database has a sufficiently |
| 86 // large one. |
| 87 FaviconRawBitmapResult bitmap; |
| 88 |
| 89 // The fallback icon style if a sufficiently large icon isn't available. This |
| 90 // uses the dominant color of a smaller icon as the background if available. |
| 91 scoped_ptr<FallbackIconStyle> fallback_icon_style; |
| 92 }; |
| 93 |
75 } // namespace favicon_base | 94 } // namespace favicon_base |
76 | 95 |
77 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ | 96 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
OLD | NEW |