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