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

Side by Side Diff: components/favicon_base/favicon_types.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
« no previous file with comments | « components/favicon_base/favicon_callback.h ('k') | components/favicon_base/favicon_types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/scoped_ptr.h>
9
8 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
9 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
10 #include "ui/gfx/image/image.h" 12 #include "ui/gfx/image/image.h"
11 #include "url/gurl.h" 13 #include "url/gurl.h"
12 14
13 namespace favicon_base { 15 namespace favicon_base {
14 16
17 struct FallbackIconStyle;
18
15 typedef int64 FaviconID; 19 typedef int64 FaviconID;
16 20
17 // Defines the icon types. They are also stored in icon_type field of favicons 21 // Defines the icon types. They are also stored in icon_type field of favicons
18 // table. 22 // table.
19 // The values of the IconTypes are used to select the priority in which favicon 23 // The values of the IconTypes are used to select the priority in which favicon
20 // data is returned in HistoryBackend and ThumbnailDatabase. Data for the 24 // data is returned in HistoryBackend and ThumbnailDatabase. Data for the
21 // largest IconType takes priority if data for multiple IconTypes is available. 25 // largest IconType takes priority if data for multiple IconTypes is available.
22 enum IconType { 26 enum IconType {
23 INVALID_ICON = 0x0, 27 INVALID_ICON = 0x0,
24 FAVICON = 1 << 0, 28 FAVICON = 1 << 0,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GURL icon_url; 69 GURL icon_url;
66 70
67 // The icon type of the containing favicon. 71 // The icon type of the containing favicon.
68 IconType icon_type; 72 IconType icon_type;
69 }; 73 };
70 74
71 // Define type with same structure as FaviconRawBitmapResult for passing data to 75 // Define type with same structure as FaviconRawBitmapResult for passing data to
72 // HistoryBackend::SetFavicons(). 76 // HistoryBackend::SetFavicons().
73 typedef FaviconRawBitmapResult FaviconRawBitmapData; 77 typedef FaviconRawBitmapResult FaviconRawBitmapData;
74 78
79 // Result returned when accessing a large icon, which is either a bitmap if
80 // one was available; or the style of the fallback icon otherwise.
81 struct LargeIconResult {
82 LargeIconResult();
83 ~LargeIconResult();
84
85 // The bitmap of the large icon if available.
86 FaviconRawBitmapResult bitmap;
87
88 // The fallback icon style if a large icon isn't available. This uses the
89 // dominant color of a smaller icon as the background if available.
90 scoped_ptr<FallbackIconStyle> fallback_icon_style;
pkotwicz 2015/04/21 18:19:47 I wonder whether the API would be easier to unders
pkotwicz 2015/04/21 20:13:28 Ping on this comment
beaudoin 2015/04/21 20:24:05 Sorry missed that comment. Even though I only ever
91 };
92
75 } // namespace favicon_base 93 } // namespace favicon_base
76 94
77 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ 95 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
OLDNEW
« no previous file with comments | « components/favicon_base/favicon_callback.h ('k') | components/favicon_base/favicon_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698