| 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 cf5185f2f817f1ab7ef0cdbffceccb3c7255825a..9e1b7e3dc00e51c30d9be6a3f8228c1d4bd30a8b 100644
|
| --- a/components/favicon/ios/web_favicon_driver.mm
|
| +++ b/components/favicon/ios/web_favicon_driver.mm
|
| @@ -61,7 +61,15 @@ bool WebFaviconDriver::FaviconIsValid() const {
|
| return item ? item->GetFavicon().valid : false;
|
| }
|
|
|
| -int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) {
|
| +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) {
|
| if (WasUnableToDownloadFavicon(url)) {
|
| DVLOG(1) << "Skip Failed FavIcon: " << url;
|
| return 0;
|
| @@ -70,8 +78,6 @@ int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) {
|
| static int downloaded_image_count = 0;
|
| int local_download_id = ++downloaded_image_count;
|
|
|
| - ImageDownloadCallback local_image_callback = base::Bind(
|
| - &FaviconDriverImpl::DidDownloadFavicon, base::Unretained(this));
|
| GURL local_url(url);
|
|
|
| image_fetcher::IOSImageDataFetcherCallback local_callback =
|
| @@ -88,8 +94,8 @@ int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) {
|
| sizes.push_back(gfx::Size(frame.width(), frame.height()));
|
| }
|
| }
|
| - local_image_callback.Run(local_download_id, metadata.response_code,
|
| - local_url, frames, sizes);
|
| + callback.Run(local_download_id, metadata.response_code, local_url,
|
| + frames, sizes);
|
| };
|
| image_fetcher_.FetchImageDataWebpDecoded(url, local_callback);
|
|
|
| @@ -101,12 +107,6 @@ bool WebFaviconDriver::IsOffTheRecord() {
|
| return web_state()->GetBrowserState()->IsOffTheRecord();
|
| }
|
|
|
| -GURL WebFaviconDriver::GetActiveURL() {
|
| - web::NavigationItem* item =
|
| - web_state()->GetNavigationManager()->GetVisibleItem();
|
| - return item ? item->GetURL() : GURL();
|
| -}
|
| -
|
| void WebFaviconDriver::OnFaviconUpdated(
|
| const GURL& page_url,
|
| FaviconDriverObserver::NotificationIconType notification_icon_type,
|
|
|