| Index: chrome/browser/fav_icon_helper.cc
|
| ===================================================================
|
| --- chrome/browser/fav_icon_helper.cc (revision 19988)
|
| +++ chrome/browser/fav_icon_helper.cc (working copy)
|
| @@ -40,28 +40,6 @@
|
| }
|
| }
|
|
|
| -void FavIconHelper::SetFavIconURL(const GURL& icon_url) {
|
| - NavigationEntry* entry = GetEntry();
|
| - if (!entry)
|
| - return;
|
| -
|
| - got_fav_icon_url_ = true;
|
| -
|
| - if (!GetHistoryService())
|
| - return;
|
| -
|
| - if (!fav_icon_expired_ && entry->favicon().is_valid() &&
|
| - entry->favicon().url() == icon_url) {
|
| - // We already have the icon, no need to proceed.
|
| - return;
|
| - }
|
| -
|
| - entry->favicon().set_url(icon_url);
|
| -
|
| - if (got_fav_icon_from_history_)
|
| - DownloadFavIconOrAskHistory(entry);
|
| -}
|
| -
|
| Profile* FavIconHelper::profile() {
|
| return tab_contents_->profile();
|
| }
|
| @@ -126,6 +104,41 @@
|
| tab_contents_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TAB);
|
| }
|
|
|
| +void FavIconHelper::UpdateFavIconURL(RenderViewHost* render_view_host,
|
| + int32 page_id,
|
| + const GURL& icon_url) {
|
| + NavigationEntry* entry = GetEntry();
|
| + if (!entry)
|
| + return;
|
| +
|
| + got_fav_icon_url_ = true;
|
| +
|
| + if (!GetHistoryService())
|
| + return;
|
| +
|
| + if (!fav_icon_expired_ && entry->favicon().is_valid() &&
|
| + entry->favicon().url() == icon_url) {
|
| + // We already have the icon, no need to proceed.
|
| + return;
|
| + }
|
| +
|
| + entry->favicon().set_url(icon_url);
|
| +
|
| + if (got_fav_icon_from_history_)
|
| + DownloadFavIconOrAskHistory(entry);
|
| +}
|
| +
|
| +void FavIconHelper::DidDownloadImage(RenderViewHost* render_view_host,
|
| + int id,
|
| + const GURL& image_url,
|
| + bool errored,
|
| + const SkBitmap& image) {
|
| + if (errored)
|
| + FavIconDownloadFailed(id);
|
| + else
|
| + SetFavIcon(id, image_url, image);
|
| +}
|
| +
|
| NavigationEntry* FavIconHelper::GetEntry() {
|
| NavigationEntry* entry = tab_contents_->controller().GetActiveEntry();
|
| if (entry && entry->url() == url_ &&
|
|
|