Index: chrome/renderer/chrome_render_view_observer.cc |
=================================================================== |
--- chrome/renderer/chrome_render_view_observer.cc (revision 150276) |
+++ chrome/renderer/chrome_render_view_observer.cc (working copy) |
@@ -698,21 +698,23 @@ |
routing_id(), render_view()->GetPageId(), osd_url, |
search_provider::AUTODETECTED_PROVIDER)); |
} |
-} |
-void ChromeRenderViewObserver::DidFinishLoad(WebKit::WebFrame* frame) { |
- if (frame->parent()) |
- return; |
- |
- // Please note that we are updating favicons only for the _main_ frame. |
- // Updating Favicon URLs at DidFinishLoad ensures that icon loads always get |
- // initiated after all of the other page resources have been fetched, so icon |
- // loads should not compete with page resources for network bandwidth. |
int icon_types = WebIconURL::TypeFavicon; |
if (chrome::kEnableTouchIcon) |
icon_types |= WebIconURL::TypeTouchPrecomposed | WebIconURL::TypeTouch; |
- CollectAndUpdateFaviconURLs(frame, icon_types); |
+ WebVector<WebIconURL> icon_urls = |
+ render_view()->GetWebView()->mainFrame()->iconURLs(icon_types); |
+ std::vector<FaviconURL> urls; |
+ for (size_t i = 0; i < icon_urls.size(); i++) { |
+ WebURL url = icon_urls[i].iconURL(); |
+ if (!url.isEmpty()) |
+ urls.push_back(FaviconURL(url, ToFaviconType(icon_urls[i].iconType()))); |
+ } |
+ if (!urls.empty()) { |
+ Send(new IconHostMsg_UpdateFaviconURL( |
+ routing_id(), render_view()->GetPageId(), urls)); |
+ } |
} |
void ChromeRenderViewObserver::DidChangeIcon(WebFrame* frame, |
@@ -724,7 +726,14 @@ |
icon_type != WebIconURL::TypeFavicon) |
return; |
- CollectAndUpdateFaviconURLs(frame, icon_type); |
+ WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); |
+ std::vector<FaviconURL> urls; |
+ for (size_t i = 0; i < icon_urls.size(); i++) { |
+ urls.push_back(FaviconURL(icon_urls[i].iconURL(), |
+ ToFaviconType(icon_urls[i].iconType()))); |
+ } |
+ Send(new IconHostMsg_UpdateFaviconURL( |
+ routing_id(), render_view()->GetPageId(), urls)); |
} |
void ChromeRenderViewObserver::DidCommitProvisionalLoad( |
@@ -1089,21 +1098,6 @@ |
return SkBitmap(); |
} |
-void ChromeRenderViewObserver::CollectAndUpdateFaviconURLs( |
- WebKit::WebFrame* frame, int icon_types) { |
- WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_types); |
- std::vector<FaviconURL> urls; |
- for (size_t i = 0; i < icon_urls.size(); i++) { |
- WebURL url = icon_urls[i].iconURL(); |
- if (!url.isEmpty()) |
- urls.push_back(FaviconURL(url, ToFaviconType(icon_urls[i].iconType()))); |
- } |
- if (!urls.empty()) { |
- Send(new IconHostMsg_UpdateFaviconURL( |
- routing_id(), render_view()->GetPageId(), urls)); |
- } |
-} |
- |
bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
} |