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

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: Add DISALLOW_COPY_AND_ASSIGN(FaviconUpdateWatcher) Created 5 years, 8 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 8832076f92ffe0732588f11937d8ed1453c4b622..e5e933417783ed62f8ffd0b85b2543a49cafa142 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -268,20 +268,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_,
@@ -289,6 +285,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,
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | chrome/browser/favicon/favicon_tab_helper_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698