| Index: chrome/browser/ui/app_list/search/common/url_icon_source.cc
|
| diff --git a/chrome/browser/ui/app_list/search/common/url_icon_source.cc b/chrome/browser/ui/app_list/search/common/url_icon_source.cc
|
| index acb2d288161215d7f30c4116502206bba80ba149..8b71e5afaa65ac16cce9ed37d03cb01d6ea29aa3 100644
|
| --- a/chrome/browser/ui/app_list/search/common/url_icon_source.cc
|
| +++ b/chrome/browser/ui/app_list/search/common/url_icon_source.cc
|
| @@ -33,8 +33,7 @@ UrlIconSource::UrlIconSource(
|
| }
|
|
|
| UrlIconSource::~UrlIconSource() {
|
| - if (image_decoder_.get())
|
| - image_decoder_->set_delegate(NULL);
|
| + ImageDecoder::GetInstance()->RemoveDelegate(this);
|
| }
|
|
|
| void UrlIconSource::StartIconFetch() {
|
| @@ -72,14 +71,12 @@ void UrlIconSource::OnURLFetchComplete(
|
| std::string unsafe_icon_data;
|
| fetcher->GetResponseAsString(&unsafe_icon_data);
|
|
|
| - image_decoder_ =
|
| - new ImageDecoder(this, unsafe_icon_data, ImageDecoder::DEFAULT_CODEC);
|
| - image_decoder_->Start(
|
| - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
|
| + ImageDecoder::GetInstance()->Start(
|
| + this, unsafe_icon_data, ImageDecoder::DEFAULT_CODEC,
|
| + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), false);
|
| }
|
|
|
| -void UrlIconSource::OnImageDecoded(const ImageDecoder* decoder,
|
| - const SkBitmap& decoded_image) {
|
| +void UrlIconSource::OnImageDecoded(const SkBitmap& decoded_image) {
|
| icon_ = gfx::ImageSkiaOperations::CreateResizedImage(
|
| gfx::ImageSkia::CreateFrom1xBitmap(decoded_image),
|
| skia::ImageOperations::RESIZE_BEST,
|
| @@ -88,8 +85,7 @@ void UrlIconSource::OnImageDecoded(const ImageDecoder* decoder,
|
| icon_loaded_callback_.Run();
|
| }
|
|
|
| -void UrlIconSource::OnDecodeImageFailed(
|
| - const ImageDecoder* decoder) {
|
| +void UrlIconSource::OnDecodeImageFailed() {
|
| // Failed to decode image. Do nothing and just use the default icon.
|
| }
|
|
|
|
|