| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Returns true if |bitmap_data| contains a valid bitmap. | 59 // Returns true if |bitmap_data| contains a valid bitmap. |
| 60 bool is_valid() const { return bitmap_data.get() && bitmap_data->size(); } | 60 bool is_valid() const { return bitmap_data.get() && bitmap_data->size(); } |
| 61 | 61 |
| 62 // Indicates whether |bitmap_data| is expired. | 62 // Indicates whether |bitmap_data| is expired. |
| 63 bool expired; | 63 bool expired; |
| 64 | 64 |
| 65 // The bits of the bitmap. | 65 // The bits of the bitmap. |
| 66 scoped_refptr<base::RefCountedMemory> bitmap_data; | 66 scoped_refptr<base::RefCountedMemory> bitmap_data; |
| 67 | 67 |
| 68 // The pixel dimensions of |bitmap_data|. | 68 // The pixel dimensions of |bitmap_data|. |
| 69 // TODO(jkrcal): Remove this and only use pixel_size_in_db (crbug.com/675637). |
| 69 gfx::Size pixel_size; | 70 gfx::Size pixel_size; |
| 70 | 71 |
| 72 // The pixel dimensions of the bitmap stored in the database. Icons are |
| 73 // resized prior to storing into the database so the dimensions are different |
| 74 // than those of the bitmap at |icon_url|. The dimensions are taken prior to |
| 75 // the resizing in FaviconService::Get###(). |
| 76 gfx::Size pixel_size_in_db; |
| 77 |
| 71 // The URL of the containing favicon. | 78 // The URL of the containing favicon. |
| 72 GURL icon_url; | 79 GURL icon_url; |
| 73 | 80 |
| 74 // The icon type of the containing favicon. | 81 // The icon type of the containing favicon. |
| 75 IconType icon_type; | 82 IconType icon_type; |
| 76 }; | 83 }; |
| 77 | 84 |
| 78 // Define type with same structure as FaviconRawBitmapResult for passing data to | 85 // Define type with same structure as FaviconRawBitmapResult for passing data to |
| 79 // HistoryBackend::SetFavicons(). | 86 // HistoryBackend::SetFavicons(). |
| 80 typedef FaviconRawBitmapResult FaviconRawBitmapData; | 87 typedef FaviconRawBitmapResult FaviconRawBitmapData; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 95 FaviconRawBitmapResult bitmap; | 102 FaviconRawBitmapResult bitmap; |
| 96 | 103 |
| 97 // The fallback icon style if a sufficiently large icon isn't available. This | 104 // The fallback icon style if a sufficiently large icon isn't available. This |
| 98 // uses the dominant color of a smaller icon as the background if available. | 105 // uses the dominant color of a smaller icon as the background if available. |
| 99 std::unique_ptr<FallbackIconStyle> fallback_icon_style; | 106 std::unique_ptr<FallbackIconStyle> fallback_icon_style; |
| 100 }; | 107 }; |
| 101 | 108 |
| 102 } // namespace favicon_base | 109 } // namespace favicon_base |
| 103 | 110 |
| 104 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ | 111 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
| OLD | NEW |