| 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 "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // TODO(pkotwicz): Return multiple |icon_urls| to allow |image| to have | 45 // TODO(pkotwicz): Return multiple |icon_urls| to allow |image| to have |
| 46 // representations from several favicons once content::FaviconStatus supports | 46 // representations from several favicons once content::FaviconStatus supports |
| 47 // multiple URLs. | 47 // multiple URLs. |
| 48 GURL icon_url; | 48 GURL icon_url; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Defines a favicon bitmap which best matches the desired DIP size and one of | 51 // Defines a favicon bitmap which best matches the desired DIP size and one of |
| 52 // the desired scale factors. | 52 // the desired scale factors. |
| 53 struct FaviconRawBitmapResult { | 53 struct FaviconRawBitmapResult { |
| 54 FaviconRawBitmapResult(); | 54 FaviconRawBitmapResult(); |
| 55 FaviconRawBitmapResult(const FaviconRawBitmapResult& other); |
| 55 ~FaviconRawBitmapResult(); | 56 ~FaviconRawBitmapResult(); |
| 56 | 57 |
| 57 // Returns true if |bitmap_data| contains a valid bitmap. | 58 // Returns true if |bitmap_data| contains a valid bitmap. |
| 58 bool is_valid() const { return bitmap_data.get() && bitmap_data->size(); } | 59 bool is_valid() const { return bitmap_data.get() && bitmap_data->size(); } |
| 59 | 60 |
| 60 // Indicates whether |bitmap_data| is expired. | 61 // Indicates whether |bitmap_data| is expired. |
| 61 bool expired; | 62 bool expired; |
| 62 | 63 |
| 63 // The bits of the bitmap. | 64 // The bits of the bitmap. |
| 64 scoped_refptr<base::RefCountedMemory> bitmap_data; | 65 scoped_refptr<base::RefCountedMemory> bitmap_data; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 93 FaviconRawBitmapResult bitmap; | 94 FaviconRawBitmapResult bitmap; |
| 94 | 95 |
| 95 // The fallback icon style if a sufficiently large icon isn't available. This | 96 // The fallback icon style if a sufficiently large icon isn't available. This |
| 96 // uses the dominant color of a smaller icon as the background if available. | 97 // uses the dominant color of a smaller icon as the background if available. |
| 97 scoped_ptr<FallbackIconStyle> fallback_icon_style; | 98 scoped_ptr<FallbackIconStyle> fallback_icon_style; |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 } // namespace favicon_base | 101 } // namespace favicon_base |
| 101 | 102 |
| 102 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ | 103 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
| OLD | NEW |