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

Unified Diff: components/favicon/content/content_favicon_driver.cc

Issue 1407353012: Refactor FaviconDriver::OnFaviconAvailable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initial_simplify
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « components/favicon/content/content_favicon_driver.h ('k') | components/favicon/core/favicon_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/content/content_favicon_driver.cc
diff --git a/components/favicon/content/content_favicon_driver.cc b/components/favicon/content/content_favicon_driver.cc
index 8cf90669a7e1b6b01a7eb4195e86da9227e9e31f..3ce69426458152656463e0fb78f3d30437dff2f0 100644
--- a/components/favicon/content/content_favicon_driver.cc
+++ b/components/favicon/content/content_favicon_driver.cc
@@ -113,27 +113,6 @@ GURL ContentFaviconDriver::GetActiveURL() {
return entry ? entry->GetURL() : GURL();
}
-void ContentFaviconDriver::SetActiveFaviconValidity(bool valid) {
- GetFaviconStatus().valid = valid;
-}
-
-GURL ContentFaviconDriver::GetActiveFaviconURL() {
- return GetFaviconStatus().url;
-}
-
-void ContentFaviconDriver::SetActiveFaviconURL(const GURL& url) {
- GetFaviconStatus().url = url;
-}
-
-void ContentFaviconDriver::SetActiveFaviconImage(const gfx::Image& image) {
- GetFaviconStatus().image = image;
-}
-
-content::FaviconStatus& ContentFaviconDriver::GetFaviconStatus() {
- DCHECK(web_contents()->GetController().GetLastCommittedEntry());
- return web_contents()->GetController().GetLastCommittedEntry()->GetFavicon();
-}
-
ContentFaviconDriver::ContentFaviconDriver(
content::WebContents* web_contents,
FaviconService* favicon_service,
@@ -146,9 +125,25 @@ ContentFaviconDriver::ContentFaviconDriver(
ContentFaviconDriver::~ContentFaviconDriver() {
}
-void ContentFaviconDriver::NotifyFaviconUpdated(bool icon_url_changed) {
- FaviconDriverImpl::NotifyFaviconUpdated(icon_url_changed);
- web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+void ContentFaviconDriver::OnFaviconUpdated(
+ const GURL& page_url,
+ FaviconDriverObserver::NotificationIconType notification_icon_type,
+ const GURL& icon_url,
+ bool icon_url_changed,
+ const gfx::Image& image) {
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetLastCommittedEntry();
+ DCHECK(entry && entry->GetURL() == page_url);
+
+ if (notification_icon_type == FaviconDriverObserver::NON_TOUCH_16_DIP) {
+ entry->GetFavicon().valid = true;
+ entry->GetFavicon().url = icon_url;
+ entry->GetFavicon().image = image;
+ web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB);
+ }
+
+ NotifyFaviconUpdatedObservers(notification_icon_type, icon_url,
+ icon_url_changed, image);
}
void ContentFaviconDriver::DidUpdateFaviconURL(
« no previous file with comments | « components/favicon/content/content_favicon_driver.h ('k') | components/favicon/core/favicon_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698