Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: components/favicon_base/fallback_icon_style.h

Issue 886163003: [Favicon] Add FallbackIconStyle and FallbackIconService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix; moved FallbackIconStyle member functions outside of struct. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/favicon_base/fallback_icon_service.cc ('k') | components/favicon_base/fallback_icon_style.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698