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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_FAVICON_TYPES_H_ 5 #ifndef COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
6 #define COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ 6 #define COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
7 7
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #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.
9 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
10 #include "ui/gfx/image/image.h" 11 #include "ui/gfx/image/image.h"
11 #include "url/gurl.h" 12 #include "url/gurl.h"
12 13
13 namespace favicon_base { 14 namespace favicon_base {
14 15
15 typedef int64 FaviconID; 16 typedef int64 FaviconID;
16 17
17 // Defines the icon types. They are also stored in icon_type field of favicons 18 // Defines the icon types. They are also stored in icon_type field of favicons
18 // table. 19 // table.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GURL icon_url; 66 GURL icon_url;
66 67
67 // The icon type of the containing favicon. 68 // The icon type of the containing favicon.
68 IconType icon_type; 69 IconType icon_type;
69 }; 70 };
70 71
71 // Define type with same structure as FaviconRawBitmapResult for passing data to 72 // Define type with same structure as FaviconRawBitmapResult for passing data to
72 // HistoryBackend::SetFavicons(). 73 // HistoryBackend::SetFavicons().
73 typedef FaviconRawBitmapResult FaviconRawBitmapData; 74 typedef FaviconRawBitmapResult FaviconRawBitmapData;
74 75
76 // Styling specifications of a fallback icon. These icons are square, and
77 // consist of a solid rounded rectangle containing a single letter. Styles
78 // 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.
79 struct FallbackIconStyle {
80 FallbackIconStyle();
81 ~FallbackIconStyle();
82
83 // Icon background fill color.
84 SkColor background_color;
85
86 // Icon text color.
87 SkColor text_color;
88
89 // 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.
90 double font_size_ratio;
91
92 // Ratio in [0.0, 1.0] to adjust rounded square's corner radius. The scale is
93 // 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.
94 double roundness;
95
96 // 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.
97 };
98
75 } // namespace favicon_base 99 } // namespace favicon_base
76 100
77 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ 101 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698