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

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

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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 "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
9 10
10 namespace favicon_base { 11 namespace favicon_base {
11 12
12 // 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
13 // rounded square containing a single letter. The specification excludes the 14 // rounded square containing a single letter. The specification excludes the
14 // 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.
15 struct FallbackIconStyle { 16 struct FallbackIconStyle {
16 FallbackIconStyle(); 17 FallbackIconStyle();
17 ~FallbackIconStyle(); 18 ~FallbackIconStyle();
(...skipping 12 matching lines...) Expand all
30 // The roundness of the icon's corners. 0 => square icon, 1 => circle icon. 31 // The roundness of the icon's corners. 0 => square icon, 1 => circle icon.
31 double roundness; 32 double roundness;
32 }; 33 };
33 34
34 // Reassigns |style|'s |text_color| to matches well against |background_color|. 35 // Reassigns |style|'s |text_color| to matches well against |background_color|.
35 void MatchFallbackIconTextColorAgainstBackgroundColor(FallbackIconStyle* style); 36 void MatchFallbackIconTextColorAgainstBackgroundColor(FallbackIconStyle* style);
36 37
37 // Returns whether |style| values are within bounds. 38 // Returns whether |style| values are within bounds.
38 bool ValidateFallbackIconStyle(const FallbackIconStyle& style); 39 bool ValidateFallbackIconStyle(const FallbackIconStyle& style);
39 40
41 // Set |style|'s background color to the dominant color of |bitmap_data|,
42 // clamping luminance down to a reasonable maximum value so that light text is
43 // readable.
44 void SetDominantColorAsBackground(
45 const scoped_refptr<base::RefCountedMemory>& bitmap_data,
46 FallbackIconStyle* style);
47
40 } // namespace favicon_base 48 } // namespace favicon_base
41 49
42 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_ 50 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
OLDNEW
« no previous file with comments | « components/favicon/core/large_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