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

Unified Diff: components/favicon/ios/web_favicon_driver.mm

Issue 2732653002: Add favicon integration tests for FaviconDriverImpl (Closed)
Patch Set: Added verification of color Created 3 years, 10 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
« no previous file with comments | « components/favicon/ios/web_favicon_driver.h ('k') | components/history/core/browser/history_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/ios/web_favicon_driver.mm
diff --git a/components/favicon/ios/web_favicon_driver.mm b/components/favicon/ios/web_favicon_driver.mm
index 9e1b7e3dc00e51c30d9be6a3f8228c1d4bd30a8b..534c7b7f6637889552f42154b20f14a9eeef27c4 100644
--- a/components/favicon/ios/web_favicon_driver.mm
+++ b/components/favicon/ios/web_favicon_driver.mm
@@ -55,18 +55,6 @@ gfx::Image WebFaviconDriver::GetFavicon() const {
return item ? item->GetFavicon().image : gfx::Image();
}
-bool WebFaviconDriver::FaviconIsValid() const {
- web::NavigationItem* item =
- web_state()->GetNavigationManager()->GetLastCommittedItem();
- return item ? item->GetFavicon().valid : false;
-}
-
-GURL WebFaviconDriver::GetActiveURL() {
- web::NavigationItem* item =
- web_state()->GetNavigationManager()->GetVisibleItem();
- return item ? item->GetURL() : GURL();
-}
-
int WebFaviconDriver::DownloadImage(const GURL& url,
int max_image_size,
ImageDownloadCallback callback) {
@@ -131,7 +119,10 @@ WebFaviconDriver::WebFaviconDriver(web::WebState* web_state,
history::HistoryService* history_service,
bookmarks::BookmarkModel* bookmark_model)
: web::WebStateObserver(web_state),
- FaviconDriverImpl(favicon_service, history_service, bookmark_model),
+ FaviconDriverImpl(/*enable_touch_icons=*/true,
+ favicon_service,
+ history_service,
+ bookmark_model),
image_fetcher_(web_state->GetBrowserState()->GetRequestContext(),
web::WebThread::GetBlockingPool()) {}
@@ -141,7 +132,12 @@ WebFaviconDriver::~WebFaviconDriver() {
void WebFaviconDriver::FaviconUrlUpdated(
const std::vector<web::FaviconURL>& candidates) {
DCHECK(!candidates.empty());
- OnUpdateFaviconURL(GetActiveURL(), FaviconURLsFromWebFaviconURLs(candidates));
+
+ web::NavigationItem* item =
+ web_state()->GetNavigationManager()->GetVisibleItem();
+
+ OnUpdateFaviconURL(item ? item->GetURL() : GURL(),
+ FaviconURLsFromWebFaviconURLs(candidates));
}
} // namespace favicon
« no previous file with comments | « components/favicon/ios/web_favicon_driver.h ('k') | components/history/core/browser/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698