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 "ui/gfx/color_utils.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 |
15 typedef int64 FaviconID; | 16 typedef int64 FaviconID; |
16 | 17 |
17 // Defines the icon types. They are also stored in icon_type field of favicons | 18 // Defines the icon types. They are also stored in icon_type field of favicons |
18 // table. | 19 // table. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 GURL icon_url; | 66 GURL icon_url; |
66 | 67 |
67 // The icon type of the containing favicon. | 68 // The icon type of the containing favicon. |
68 IconType icon_type; | 69 IconType icon_type; |
69 }; | 70 }; |
70 | 71 |
71 // Define type with same structure as FaviconRawBitmapResult for passing data to | 72 // Define type with same structure as FaviconRawBitmapResult for passing data to |
72 // HistoryBackend::SetFavicons(). | 73 // HistoryBackend::SetFavicons(). |
73 typedef FaviconRawBitmapResult FaviconRawBitmapData; | 74 typedef FaviconRawBitmapResult FaviconRawBitmapData; |
74 | 75 |
76 // Rendering specifications of a fallback icon, which is a square image as a | |
77 // solid rounded rectangle containing a single letter. The specs exclude icon | |
78 // URL and size, since these are only specified when we render. | |
79 struct FallbackIconSpecs { | |
80 FallbackIconSpecs(); | |
81 ~FallbackIconSpecs(); | |
82 | |
83 // Icon background fill color. | |
84 SkColor background_color; | |
85 | |
86 // Icon text color. | |
87 SkColor text_color; | |
88 | |
89 // Ratio in [0.0, 1.0] from text font size (pixels) to icon size. | |
90 double font_size_ratio; | |
91 | |
92 // Ratio in [0.0, 0.5] from rounded square's corner radius to square size. | |
93 // In particular, 0.0 => square and 0.5 => circle. | |
94 double corner_radius_ratio; | |
pkotwicz
2015/01/19 04:32:02
I think that a pixel corner radius is more intuiti
huangs
2015/01/20 22:20:41
"Roundness" is a good idea, updating.
| |
95 | |
96 // If any field change, need to update FallbackIconSpecsBuilder. | |
97 }; | |
98 | |
75 } // namespace favicon_base | 99 } // namespace favicon_base |
76 | 100 |
77 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ | 101 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ |
OLD | NEW |