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

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
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
huangs 2015/04/21 05:00:28 #include <base/memory/scoped_ptr.h>
beaudoin 2015/04/21 15:11:12 Done.
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 namespace favicon_base { 13 namespace favicon_base {
14 14
15 struct FallbackIconStyle;
16
15 typedef int64 FaviconID; 17 typedef int64 FaviconID;
16 18
17 // Defines the icon types. They are also stored in icon_type field of favicons 19 // Defines the icon types. They are also stored in icon_type field of favicons
18 // table. 20 // table.
19 // The values of the IconTypes are used to select the priority in which favicon 21 // 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 22 // data is returned in HistoryBackend and ThumbnailDatabase. Data for the
21 // largest IconType takes priority if data for multiple IconTypes is available. 23 // largest IconType takes priority if data for multiple IconTypes is available.
22 enum IconType { 24 enum IconType {
23 INVALID_ICON = 0x0, 25 INVALID_ICON = 0x0,
24 FAVICON = 1 << 0, 26 FAVICON = 1 << 0,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GURL icon_url; 67 GURL icon_url;
66 68
67 // The icon type of the containing favicon. 69 // The icon type of the containing favicon.
68 IconType icon_type; 70 IconType icon_type;
69 }; 71 };
70 72
71 // Define type with same structure as FaviconRawBitmapResult for passing data to 73 // Define type with same structure as FaviconRawBitmapResult for passing data to
72 // HistoryBackend::SetFavicons(). 74 // HistoryBackend::SetFavicons().
73 typedef FaviconRawBitmapResult FaviconRawBitmapData; 75 typedef FaviconRawBitmapResult FaviconRawBitmapData;
74 76
77 // Result returned when accessing a large icon, which is either a bitmap if
78 // one was available; or the style of the fallback icon otherwise.
79 struct LargeIconResult {
80 LargeIconResult();
81 ~LargeIconResult();
82
83 // The bitmap of the large icon if available.
84 FaviconRawBitmapResult bitmap;
85
86 // The fallback icon style if a large icon isn't available. This uses the
87 // dominant color of a smaller icon as the background if available.
88 scoped_ptr<FallbackIconStyle> fallback_icon_style;
89 };
90
75 } // namespace favicon_base 91 } // namespace favicon_base
76 92
77 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_ 93 #endif // COMPONENTS_FAVICON_BASE_FAVICON_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698