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

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: Adding new host chrome://fallback-icon. 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..1b8957fb3df8ce4c7e39739c2cc9cd37bc1c2989 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 "ui/gfx/color_utils.h"
pkotwicz 2015/01/21 19:44:16 Nit: Please include "third_party/skia/include/core
huangs 2015/01/22 01:13:28 Done.
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"
@@ -72,6 +73,29 @@ struct FaviconRawBitmapResult {
// HistoryBackend::SetFavicons().
typedef FaviconRawBitmapResult FaviconRawBitmapData;
+// Styling specifications of a fallback icon. These icons are square, and
+// consist of a solid rounded rectangle containing a single letter. Styles
+// excludes icon URL and size, since these are only specified when we render.
pkotwicz 2015/01/21 19:44:16 How about: "Specification for a fallback icon. The
huangs 2015/01/22 01:13:28 Rephrased, but kept size excluded still.
+struct FallbackIconStyle {
+ FallbackIconStyle();
+ ~FallbackIconStyle();
+
+ // Icon background fill color.
+ SkColor background_color;
+
+ // Icon text color.
+ SkColor text_color;
+
+ // Ratio in [0.0, 1.0] from text font size (pixels) to icon size.
pkotwicz 2015/01/21 19:44:16 Nits: "from text font size" -> "of the text font s
huangs 2015/01/22 01:13:28 Done.
+ double font_size_ratio;
+
+ // Ratio in [0.0, 1.0] to adjust rounded square's corner radius. The scale is
+ // adjusted so 0.0 => square and 0.5 => circle.
pkotwicz 2015/01/21 19:44:16 How about: "The roundness of the icon's corners. 0
huangs 2015/01/22 01:13:28 Done.
+ double roundness;
+
+ // If any member change, also update FallbackIconStyleBuilder.
pkotwicz 2015/01/21 19:44:16 Nit: change -> changes
huangs 2015/01/22 01:13:28 Done.
+};
+
} // namespace favicon_base
#endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698