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

Unified Diff: components/favicon/core/favicon_driver_impl.cc

Issue 1118073002: Simplify FaviconDriverImpl by removing extra FaviconHandler member. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: components/favicon/core/favicon_driver_impl.cc
diff --git a/components/favicon/core/favicon_driver_impl.cc b/components/favicon/core/favicon_driver_impl.cc
index c95bf3aae13dbed1276ab194ae3fbd211d910235..4ef08e228d805d0b6a4a3c5cb9f7c4aa4ac686f9 100644
--- a/components/favicon/core/favicon_driver_impl.cc
+++ b/components/favicon/core/favicon_driver_impl.cc
@@ -47,16 +47,13 @@ FaviconDriverImpl::FaviconDriverImpl(FaviconService* favicon_service,
: favicon_service_(favicon_service),
history_service_(history_service),
bookmark_model_(bookmark_model) {
+ bool download_large_icons = kEnableTouchIcon || IsIconNTPEnabled();
favicon_handler_.reset(new FaviconHandler(
- favicon_service_, this, FaviconHandler::FAVICON, kEnableTouchIcon));
- if (kEnableTouchIcon) {
+ favicon_service_, this, FaviconHandler::FAVICON, download_large_icons));
+ if (download_large_icons) {
touch_icon_handler_.reset(new FaviconHandler(favicon_service_, this,
FaviconHandler::TOUCH, true));
}
- if (IsIconNTPEnabled()) {
- large_icon_handler_.reset(new FaviconHandler(favicon_service_, this,
- FaviconHandler::LARGE, true));
- }
}
FaviconDriverImpl::~FaviconDriverImpl() {
@@ -66,8 +63,6 @@ void FaviconDriverImpl::FetchFavicon(const GURL& url) {
favicon_handler_->FetchFavicon(url);
if (touch_icon_handler_.get())
touch_icon_handler_->FetchFavicon(url);
- if (large_icon_handler_.get())
- large_icon_handler_->FetchFavicon(url);
}
void FaviconDriverImpl::SaveFavicon() {
@@ -113,10 +108,6 @@ void FaviconDriverImpl::DidDownloadFavicon(
touch_icon_handler_->OnDidDownloadFavicon(id, image_url, bitmaps,
original_bitmap_sizes);
}
- if (large_icon_handler_.get()) {
- large_icon_handler_->OnDidDownloadFavicon(id, image_url, bitmaps,
- original_bitmap_sizes);
- }
}
bool FaviconDriverImpl::IsBookmarked(const GURL& url) {
@@ -147,8 +138,6 @@ bool FaviconDriverImpl::HasPendingTasksForTest() {
return true;
if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest())
return true;
- if (large_icon_handler_ && large_icon_handler_->HasPendingTasksForTest())
- return true;
return false;
}
@@ -171,8 +160,6 @@ void FaviconDriverImpl::OnUpdateFaviconURL(
favicon_handler_->OnUpdateFaviconURL(candidates);
if (touch_icon_handler_.get())
touch_icon_handler_->OnUpdateFaviconURL(candidates);
- if (large_icon_handler_.get())
- large_icon_handler_->OnUpdateFaviconURL(candidates);
}
} // namespace favicon

Powered by Google App Engine
This is Rietveld 408576698