diff options
author | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 21:56:48 +0000 |
---|---|---|
committer | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 21:56:48 +0000 |
commit | 0189bc72c90fab03afab623d0b2d8be3d35af3e7 (patch) | |
tree | a1962c2ecddcaf1eb1f1a27f6dde6991d19a9b07 /chrome/browser/bookmarks | |
parent | 34a6418e00deca16a311b331ab4b2f257c674d74 (diff) | |
download | chromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.zip chromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.tar.gz chromium_src-0189bc72c90fab03afab623d0b2d8be3d35af3e7.tar.bz2 |
Adds a FaviconService class tied to the profile.
Original issue: http://codereview.chromium.org/115212/show
The favicons service is the entry point to getting favicons.
Make the DOMUIFactory handle the favicons of DOMUI pages so since DOMUI pages
are never added to the history.
BUG=5840
TEST=Open a new window and open history and downloads (Ctrl+H and Ctrl+J) in
this window. Then close the window and open the NTP. The recently closed
windows/tabs should show the favicons for the hsitroy and downloads page.
Review URL: http://codereview.chromium.org/178001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.cc | 23 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.h | 5 |
2 files changed, 14 insertions, 14 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 5bb5bb9..4769f90 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -632,7 +632,7 @@ BookmarkNode* BookmarkModel::CreateRootNodeFromStarredEntry( } void BookmarkModel::OnFavIconDataAvailable( - HistoryService::Handle handle, + FaviconService::Handle handle, bool know_favicon, scoped_refptr<RefCountedBytes> data, bool expired, @@ -640,7 +640,7 @@ void BookmarkModel::OnFavIconDataAvailable( SkBitmap fav_icon; BookmarkNode* node = load_consumer_.GetClientData( - profile_->GetHistoryService(Profile::EXPLICIT_ACCESS), handle); + profile_->GetFaviconService(Profile::EXPLICIT_ACCESS), handle); DCHECK(node); node->set_favicon_load_handle(0); if (know_favicon && data.get() && @@ -655,24 +655,23 @@ void BookmarkModel::LoadFavIcon(BookmarkNode* node) { return; DCHECK(node->GetURL().is_valid()); - HistoryService* history_service = - profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); - if (!history_service) + FaviconService* favicon_service = + profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); + if (!favicon_service) return; - - HistoryService::Handle handle = history_service->GetFavIconForURL( + FaviconService::Handle handle = favicon_service->GetFaviconForURL( node->GetURL(), &load_consumer_, NewCallback(this, &BookmarkModel::OnFavIconDataAvailable)); - load_consumer_.SetClientData(history_service, handle, node); + load_consumer_.SetClientData(favicon_service, handle, node); node->set_favicon_load_handle(handle); } void BookmarkModel::CancelPendingFavIconLoadRequests(BookmarkNode* node) { if (node->favicon_load_handle()) { - HistoryService* history = - profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); - if (history) - history->CancelRequest(node->favicon_load_handle()); + FaviconService* favicon_service = + profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); + if (favicon_service) + favicon_service->CancelRequest(node->favicon_load_handle()); node->set_favicon_load_handle(0); } } diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 8da3bcd..3ff1533 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -19,6 +19,7 @@ #include "chrome/browser/bookmarks/bookmark_storage.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/cancelable_request.h" +#include "chrome/browser/favicon_service.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_types.h" #include "chrome/common/notification_registrar.h" @@ -367,14 +368,14 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { // Notification that a favicon has finished loading. If we can decode the // favicon, FaviconLoaded is invoked. void OnFavIconDataAvailable( - HistoryService::Handle handle, + FaviconService::Handle handle, bool know_favicon, scoped_refptr<RefCountedBytes> data, bool expired, GURL icon_url); // Invoked from the node to load the favicon. Requests the favicon from the - // history service. + // favicon service. void LoadFavIcon(BookmarkNode* node); // If we're waiting on a favicon for node, the load request is canceled. |