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

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: Moving FallbackIconStyle to its own file to fix Skia dependency issues. 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 {
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698