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.
5 #ifndef COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
6 #define COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
8 #include "base/memory/ref_counted_memory.h"
9 #include "third_party/skia/include/core/SkColor.h"
11 namespace favicon_base {
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
15 // icon URL and size, which are given when the icon is rendered.
16 struct FallbackIconStyle {
20 // Icon background fill color.
21 SkColor background_color;
22 bool is_default_background_color;
27 bool operator==(const FallbackIconStyle& other) const;
30 // Set |style|'s background color to the dominant color of |bitmap_data|,
31 // clamping luminance down to a reasonable maximum value so that light text is
33 void SetDominantColorAsBackground(
34 const scoped_refptr<base::RefCountedMemory>& bitmap_data,
35 FallbackIconStyle* style);
37 } // namespace favicon_base
39 #endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_