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

Unified Diff: chrome/browser/favicon/favicon_tab_helper.cc

Issue 1059743003: Remove NOTIFICATION_FAVICON_UPDATED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-active-title
Patch Set: Created 5 years, 9 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/favicon/favicon_tab_helper.cc
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index df6c1a95c25181b3b8d3dd1f443838998576eb22..1c63c7f71796640d215138e7648c6f7f2539ab60 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -256,20 +256,16 @@ void FaviconTabHelper::OnFaviconAvailable(const gfx::Image& image,
const GURL& icon_url,
bool is_active_favicon) {
if (is_active_favicon) {
+ bool icon_url_changed = GetActiveFaviconURL() != icon_url;
// No matter what happens, we need to mark the favicon as being set.
SetActiveFaviconValidity(true);
- bool icon_url_changed = GetActiveFaviconURL() != icon_url;
SetActiveFaviconURL(icon_url);
if (image.IsEmpty())
return;
SetActiveFaviconImage(image);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_FAVICON_UPDATED,
- content::Source<WebContents>(web_contents()),
- content::Details<bool>(&icon_url_changed));
- web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+ NotifyFaviconUpdated(icon_url_changed);
}
if (!image.IsEmpty()) {
FOR_EACH_OBSERVER(favicon::FaviconDriverObserver, observer_list_,
@@ -277,6 +273,12 @@ void FaviconTabHelper::OnFaviconAvailable(const gfx::Image& image,
}
}
+void FaviconTabHelper::NotifyFaviconUpdated(bool icon_url_changed) {
+ FOR_EACH_OBSERVER(favicon::FaviconDriverObserver, observer_list_,
+ OnFaviconUpdated(this, icon_url_changed));
+ web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+}
+
void FaviconTabHelper::DidDownloadFavicon(
int id,
int http_status_code,

Powered by Google App Engine
This is Rietveld 408576698