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

Unified Diff: components/favicon_base/favicon_types.h

Issue 835903005: [Favicon] Add new fallback icon rendering flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing FallbackIconStyleBuilder; trimming down chrome://fallback-icon syntax. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/favicon_base/favicon_types.h
diff --git a/components/favicon_base/favicon_types.h b/components/favicon_base/favicon_types.h
index ea6475429d93d931fb9f511fbe24adaa16ccd38e..f190cd6667e16db53867109ba975e14193b24c64 100644
--- a/components/favicon_base/favicon_types.h
+++ b/components/favicon_base/favicon_types.h
@@ -6,6 +6,7 @@
#define COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
#include "base/memory/ref_counted_memory.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"
@@ -72,6 +73,35 @@ struct FaviconRawBitmapResult {
// HistoryBackend::SetFavicons().
typedef FaviconRawBitmapResult FaviconRawBitmapData;
+// Styling specification for a fallback icon. The icon is composed of a solid
+// rounded square containing a single letter. The specification excludes the
+// icon URL and size, which are given when the icon is rendered.
+class FallbackIconStyle {
+ public:
+ FallbackIconStyle();
+ ~FallbackIconStyle();
+
+ // Reassigns |text_color| so it matches well with |background_color|.
+ void MatchTextColorWithBackgroundColor();
+
+ // Returns true if values stored are within bounds.
+ bool is_valid() const;
+
+ // Icon background fill color.
+ SkColor background_color;
+
+ // Icon text color.
+ SkColor text_color;
+
+ // Ratio in [0.0, 1.0] of the text font size (pixels) to the icon size.
+ double font_size_ratio;
+
+ // The roundness of the icon's corners. 0 => square icon, 1 => circle icon.
+ double roundness;
+
+ // If any member changes, also update FallbackIconStyleBuilder.
+};
+
} // namespace favicon_base
#endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698