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

Unified Diff: chrome/browser/fav_icon_helper.cc

Issue 149239: Split out some of the RVHDelegate functions into separate sub-classes. To lim... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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/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_ &&

Powered by Google App Engine
This is Rietveld 408576698