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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2918903002: Move IconURLs method from WebFrame to WebLocalFrame (Closed)
Patch Set: Fixing compile problems in chrome/browser/extensions/favicon_downloader_unittest.cc Created 3 years, 6 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cef65a924bd6e3cc1036361d9f338427a92ec0de..0b3c0d0689574e5524517f6f655ea2387d36c156 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -780,7 +780,6 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHostImpl* render_view_host,
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission,
OnRequestPpapiBrokerPermission)
#endif
- IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage,
OnShowValidationMessage)
IPC_MESSAGE_HANDLER(ViewHostMsg_HideValidationMessage,
@@ -835,6 +834,7 @@ bool WebContentsImpl::OnMessageReceived(RenderFrameHostImpl* render_frame_host,
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals,
OnUpdatePageImportanceSignals)
IPC_MESSAGE_HANDLER(FrameHostMsg_Find_Reply, OnFindReply)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
#if BUILDFLAG(ENABLE_PLUGINS)
IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated,
OnPepperInstanceCreated)
@@ -4149,13 +4149,19 @@ void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host,
#endif // BUILDFLAG(ENABLE_PLUGINS)
void WebContentsImpl::OnUpdateFaviconURL(
- RenderViewHostImpl* source,
+ RenderFrameHostImpl* source,
const std::vector<FaviconURL>& candidates) {
+ // Ignore favicons for non-main frame.
+ if (source->GetParent()) {
+ NOTREACHED();
+ return;
+ }
+
// We get updated favicon URLs after the page stops loading. If a cross-site
// navigation occurs while a page is still loading, the initial page
// may stop loading and send us updated favicon URLs after the navigation
// for the new page has committed.
- if (!source->is_active())
+ if (!source->IsCurrent())
return;
for (auto& observer : observers_)

Powered by Google App Engine
This is Rietveld 408576698