Chromium Code Reviews| 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 { | |
|
stevenjb
2015/02/11 18:04:37
From the style guide: "Use a struct only for passi
huangs
2015/02/11 20:28:39
I want the ability to directly access member varia
| |
| 16 FallbackIconStyle(); | |
| 17 ~FallbackIconStyle(); | |
| 18 | |
| 19 // Reassigns |text_color| so it matches well with |background_color|. | |
| 20 void MatchTextColorWithBackgroundColor(); | |
| 21 | |
| 22 // If any member changes, also update FallbackIconStyleBuilder. | |
| 23 | |
| 24 // Returns true if values stored are within bounds. | |
| 25 bool is_valid() const; | |
| 26 | |
| 27 // Icon background fill color. | |
| 28 SkColor background_color; | |
| 29 | |
| 30 // Icon text color. | |
| 31 SkColor text_color; | |
| 32 | |
| 33 // Ratio in [0.0, 1.0] of the text font size (pixels) to the icon size. | |
| 34 double font_size_ratio; | |
| 35 | |
| 36 // The roundness of the icon's corners. 0 => square icon, 1 => circle icon. | |
| 37 double roundness; | |
| 38 }; | |
| 39 | |
| 40 } // namespace favicon_base | |
| 41 | |
| 42 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ | |
| OLD | NEW |