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

Unified Diff: chrome/browser/history/history.cc

Issue 10802066: Adds support for saving favicon size into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested by Sky and stevenjb Created 8 years, 4 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: chrome/browser/history/history.cc
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc
index 648de2963dd020abb15ab4cbc4f21a08d057b0e6..2ae08b6e7fed4cabb864ecc0aac8dd09f97d0c00 100644
--- a/chrome/browser/history/history.cc
+++ b/chrome/browser/history/history.cc
@@ -491,53 +491,75 @@ HistoryService::Handle HistoryService::GetPageThumbnail(
new history::GetPageThumbnailRequest(callback), page_url);
}
-void HistoryService::GetFavicon(FaviconService::GetFaviconRequest* request,
- const GURL& icon_url,
- history::IconType icon_type) {
- Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavicon, NULL, request,
- icon_url, icon_type);
+void HistoryService::GetFaviconClosestToSize(
+ FaviconService::GetFaviconRequest* request,
+ const GURL& icon_url,
+ history::IconType icon_type,
+ const gfx::Size& pixel_size) {
+ Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconClosestToSize, NULL,
+ request, icon_url, icon_type, pixel_size);
}
-void HistoryService::UpdateFaviconMappingAndFetch(
+void HistoryService::GetFavicons(
FaviconService::GetFaviconRequest* request,
- const GURL& page_url,
- const GURL& icon_url,
+ const std::vector<GURL>& icon_urls,
history::IconType icon_type) {
- Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFaviconMappingAndFetch, NULL,
- request, page_url, icon_url, history::FAVICON);
+ Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFavicons, NULL, request,
+ icon_urls, icon_type);
}
-void HistoryService::GetFaviconForURL(
+void HistoryService::GetFaviconForURLClosestToSize(
+ FaviconService::GetFaviconRequest* request,
+ const GURL& page_url,
+ int icon_types,
+ const gfx::Size& pixel_size) {
+ Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURLClosestToSize,
+ NULL, request, page_url, icon_types, pixel_size);
+}
+
+void HistoryService::GetFaviconsForURL(
FaviconService::GetFaviconRequest* request,
const GURL& page_url,
int icon_types) {
- Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForURL, NULL, request,
+ Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconsForURL, NULL, request,
page_url, icon_types);
}
-void HistoryService::GetFaviconForID(FaviconService::GetFaviconRequest* request,
- history::FaviconID id) {
- Schedule(PRIORITY_NORMAL, &HistoryBackend::GetFaviconForID, NULL, request,
- id);
+void HistoryService::UpdateFaviconMappingsAndFetch(
+ FaviconService::GetFaviconRequest* request,
+ const GURL& page_url,
+ const std::vector<GURL>& icon_urls,
+ history::IconType icon_type) {
+ Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateFaviconMappingsAndFetch,
+ NULL, request, page_url, icon_urls, icon_type);
+}
+
+void HistoryService::AddFavicons(
+ const GURL& page_url,
+ history::IconType icon_type,
+ const std::vector<history::FaviconDataElement>& elements) {
+ if (!CanAddURL(page_url))
+ return;
+
+ ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::AddFavicons, page_url,
+ icon_type, elements);
}
-void HistoryService::SetFavicon(const GURL& page_url,
- const GURL& icon_url,
- const std::vector<unsigned char>& image_data,
- history::IconType icon_type) {
+void HistoryService::SetFavicons(
+ const GURL& page_url,
+ history::IconType icon_type,
+ const std::vector<history::FaviconDataElement>& elements,
+ const history::IconURLSizesMap& icon_url_sizes) {
if (!CanAddURL(page_url))
return;
- ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon,
- page_url, icon_url,
- scoped_refptr<base::RefCountedMemory>(
- new base::RefCountedBytes(image_data)),
- icon_type);
+ ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicons, page_url,
+ icon_type, elements, icon_url_sizes);
}
-void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) {
+void HistoryService::SetFaviconsOutOfDateForPage(const GURL& page_url) {
ScheduleAndForget(PRIORITY_NORMAL,
- &HistoryBackend::SetFaviconOutOfDateForPage, page_url);
+ &HistoryBackend::SetFaviconsOutOfDateForPage, page_url);
}
void HistoryService::CloneFavicon(const GURL& old_page_url,

Powered by Google App Engine
This is Rietveld 408576698