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

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

Issue 2883053003: Delete unused chrome://fallback-icon/ handling (Closed)
Patch Set: Merge branch 'master' into searchbox3 Created 3 years, 6 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
« no previous file with comments | « components/favicon_base/BUILD.gn ('k') | components/favicon_base/fallback_icon_style.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_FALLBACK_ICON_STYLE_H_ 5 #ifndef COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
6 #define COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ 6 #define COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
7 7
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 10
11 namespace favicon_base { 11 namespace favicon_base {
12 12
13 // Styling specifications of a fallback icon. The icon is composed of a solid 13 // Styling specifications of a fallback icon. The icon is composed of a solid
14 // rounded square containing a single letter. The specification excludes the 14 // rounded square containing a single letter. The specification excludes the
15 // icon URL and size, which are given when the icon is rendered. 15 // icon URL and size, which are given when the icon is rendered.
16 struct FallbackIconStyle { 16 struct FallbackIconStyle {
17 FallbackIconStyle(); 17 FallbackIconStyle();
18 ~FallbackIconStyle(); 18 ~FallbackIconStyle();
19 19
20 // If any member changes, also update FallbackIconStyleBuilder.
21
22 // Icon background fill color. 20 // Icon background fill color.
23 SkColor background_color; 21 SkColor background_color;
24 bool is_default_background_color; 22 bool is_default_background_color;
25 23
26 // Icon text color. 24 // Icon text color.
27 SkColor text_color; 25 SkColor text_color;
28 26
29 // Ratio in [0.0, 1.0] of the text font size (pixels) to the icon size.
30 double font_size_ratio;
31
32 // The roundness of the icon's corners. 0 => square icon, 1 => circle icon.
33 double roundness;
34
35 bool operator==(const FallbackIconStyle& other) const; 27 bool operator==(const FallbackIconStyle& other) const;
36 }; 28 };
37 29
38 // Reassigns |style|'s |text_color| to matches well against |background_color|.
39 void MatchFallbackIconTextColorAgainstBackgroundColor(FallbackIconStyle* style);
40
41 // Returns whether |style| values are within bounds.
42 bool ValidateFallbackIconStyle(const FallbackIconStyle& style);
43
44 // Set |style|'s background color to the dominant color of |bitmap_data|, 30 // Set |style|'s background color to the dominant color of |bitmap_data|,
45 // clamping luminance down to a reasonable maximum value so that light text is 31 // clamping luminance down to a reasonable maximum value so that light text is
46 // readable. 32 // readable.
47 void SetDominantColorAsBackground( 33 void SetDominantColorAsBackground(
48 const scoped_refptr<base::RefCountedMemory>& bitmap_data, 34 const scoped_refptr<base::RefCountedMemory>& bitmap_data,
49 FallbackIconStyle* style); 35 FallbackIconStyle* style);
50 36
51 } // namespace favicon_base 37 } // namespace favicon_base
52 38
53 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ 39 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
OLDNEW
« no previous file with comments | « components/favicon_base/BUILD.gn ('k') | components/favicon_base/fallback_icon_style.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698