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

Side by Side Diff: components/history/core/browser/thumbnail_database.h

Issue 2823093002: Make FaviconService::GetRawFaviconForPageURL() select the best candidate among all the icon types (Closed)
Patch Set: Merge branch 'icon_type0' into icon_type Created 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ 6 #define COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 bool DeleteFavicon(favicon_base::FaviconID id); 158 bool DeleteFavicon(favicon_base::FaviconID id);
159 159
160 // Icon Mapping -------------------------------------------------------------- 160 // Icon Mapping --------------------------------------------------------------
161 // 161 //
162 // Returns true if there is a matched icon mapping for the given page and 162 // Returns true if there is a matched icon mapping for the given page and
163 // icon type. 163 // icon type.
164 // The matched icon mapping is returned in the icon_mapping parameter if it is 164 // The matched icon mapping is returned in the icon_mapping parameter if it is
165 // not NULL. 165 // not NULL.
166 166
167 // Returns true if there are icon mappings for the given page and icon types. 167 // Returns true if there are icon mappings for the given page and icon types.
168 // If |required_icon_types| contains multiple icon types and there is more
169 // than one matched icon type in the database, icons of only a single type
170 // will be returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON,
171 // and FAVICON.
172 // The matched icon mappings are returned in the |mapping_data| parameter if 168 // The matched icon mappings are returned in the |mapping_data| parameter if
173 // it is not NULL. 169 // it is not NULL.
174 bool GetIconMappingsForPageURL(const GURL& page_url, 170 bool GetIconMappingsForPageURL(const GURL& page_url,
175 int required_icon_types, 171 int required_icon_types,
176 std::vector<IconMapping>* mapping_data); 172 std::vector<IconMapping>* mapping_data);
177 173
178 // Returns true if there is any matched icon mapping for the given page. 174 // Returns true if there is any matched icon mapping for the given page.
179 // All matched icon mappings are returned in descent order of IconType if 175 // All matched icon mappings are returned in descent order of IconType if
180 // mapping_data is not NULL. 176 // mapping_data is not NULL.
mastiz 2017/04/20 08:55:59 Does anybody use the sorting per IconType? If not,
pkotwicz 2017/04/30 03:49:56 No, no one uses the sorting per IconType. It is us
181 bool GetIconMappingsForPageURL(const GURL& page_url, 177 bool GetIconMappingsForPageURL(const GURL& page_url,
182 std::vector<IconMapping>* mapping_data); 178 std::vector<IconMapping>* mapping_data);
183 179
184 // Adds a mapping between the given page_url and icon_id. 180 // Adds a mapping between the given page_url and icon_id.
185 // Returns the new mapping id if the adding succeeds, otherwise 0 is returned. 181 // Returns the new mapping id if the adding succeeds, otherwise 0 is returned.
186 IconMappingID AddIconMapping(const GURL& page_url, 182 IconMappingID AddIconMapping(const GURL& page_url,
187 favicon_base::FaviconID icon_id); 183 favicon_base::FaviconID icon_id);
188 184
189 // Deletes the icon mapping entries for the given page url. 185 // Deletes the icon mapping entries for the given page url.
190 // Returns true if the deletion succeeded. 186 // Returns true if the deletion succeeded.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 263
268 sql::Connection db_; 264 sql::Connection db_;
269 sql::MetaTable meta_table_; 265 sql::MetaTable meta_table_;
270 266
271 HistoryBackendClient* backend_client_; 267 HistoryBackendClient* backend_client_;
272 }; 268 };
273 269
274 } // namespace history 270 } // namespace history
275 271
276 #endif // COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_ 272 #endif // COMPONENTS_HISTORY_CORE_BROWSER_THUMBNAIL_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698