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" | |
pkotwicz
2015/01/21 19:44:16
Nit: Please include "third_party/skia/include/core
huangs
2015/01/22 01:13:28
Done.
| |
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 // Styling specifications of a fallback icon. These icons are square, and | |
77 // consist of a solid rounded rectangle containing a single letter. Styles | |
78 // excludes icon URL and size, since these are only specified when we render. | |
pkotwicz
2015/01/21 19:44:16
How about: "Specification for a fallback icon. The
huangs
2015/01/22 01:13:28
Rephrased, but kept size excluded still.
| |
79 struct FallbackIconStyle { | |
80 FallbackIconStyle(); | |
81 ~FallbackIconStyle(); | |
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. | |
pkotwicz
2015/01/21 19:44:16
Nits: "from text font size" -> "of the text font s
huangs
2015/01/22 01:13:28
Done.
| |
90 double font_size_ratio; | |
91 | |
92 // Ratio in [0.0, 1.0] to adjust rounded square's corner radius. The scale is | |
93 // adjusted so 0.0 => square and 0.5 => circle. | |
pkotwicz
2015/01/21 19:44:16
How about: "The roundness of the icon's corners. 0
huangs
2015/01/22 01:13:28
Done.
| |
94 double roundness; | |
95 | |
96 // If any member change, also update FallbackIconStyleBuilder. | |
pkotwicz
2015/01/21 19:44:16
Nit: change -> changes
huangs
2015/01/22 01:13:28
Done.
| |
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 |