OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ | |
6 #define COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ | |
7 | |
8 #include "third_party/skia/include/core/SkColor.h" | |
9 | |
10 namespace favicon_base { | |
11 | |
12 // Styling specifications of a fallback icon. The icon is composed of a solid | |
13 // rounded square containing a single letter. The specification excludes the | |
14 // icon URL and size, which are given when the icon is rendered. | |
15 struct FallbackIconStyle { | |
16 FallbackIconStyle(); | |
17 ~FallbackIconStyle(); | |
18 | |
19 // If any member changes, also update FallbackIconStyleBuilder. | |
20 | |
21 // Icon background fill color. | |
22 SkColor background_color; | |
23 | |
24 // Icon text color. | |
25 SkColor text_color; | |
26 | |
27 // Ratio in [0.0, 1.0] of the text font size (pixels) to the icon size. | |
28 double font_size_ratio; | |
29 | |
30 // The roundness of the icon's corners. 0 => square icon, 1 => circle icon. | |
31 double roundness; | |
32 }; | |
33 | |
34 // Reassigns |style|'s |text_color| to matches well against |background_color|. | |
35 void MatchFallbackIconTextColorAgainstBackgroundColor(FallbackIconStyle* style); | |
36 | |
37 // Returns whether |style| values are within bounds. | |
38 bool ValidateFallbackIconStyle(const FallbackIconStyle& style); | |
stevenjb
2015/02/11 21:15:58
FWIW I think this would have been better as a clas
huangs
2015/02/11 21:21:56
Acknowledged.
| |
39 | |
40 } // namespace favicon_base | |
41 | |
42 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ | |
OLD | NEW |