chrome/browser/ui/intents/web_intent_icon_loader.cc
// Decodes an |icon_repsonse| as delivered via URLFetcher. The response should
// be in PNG format, but is not guaranteed to be. Posts the |callback| task
// when done.
Decodes an |icon_repsonse| as delivered via URLFetcher. The response should
be in PNG format, but is not guaranteed to be. Posts the |callback| task
when done.
Decodes an |icon_repsonse| as delivered via URLFetcher . The response should be in PNG format but is not guaranteed to be . Posts the |callback| task when done .
void DecodeExtensionIconAndResize(
    scoped_ptr<std::string> icon_response,
    const ExtensionIconAvailableCallback& callback) {
  SkBitmap icon_bitmap;
  if (gfx::PNGCodec::Decode(
        reinterpret_cast<const unsigned char*>(icon_response->data()),
        icon_response->length(),
        &icon_bitmap)) {
    SkBitmap resized_icon = skia::ImageOperations::Resize(
        icon_bitmap,
        skia::ImageOperations::RESIZE_BEST,
        gfx::kFaviconSize, gfx::kFaviconSize);
    gfx::Image icon_image(resized_icon);
    content::BrowserThread::PostTask(
        content::BrowserThread::UI,
        FROM_HERE,
        base::Bind(callback, icon_image));
  }
}
void DecodeExtensionIconAndResize ( scoped_ptr < std :: string > icon_response , const ExtensionIconAvailableCallback & callback ) { SkBitmap icon_bitmap ; if ( gfx :: PNGCodec :: Decode ( reinterpret_cast < const unsigned char * > ( icon_response -> data ( ) ) , icon_response -> length ( ) , & icon_bitmap ) ) { SkBitmap resized_icon = skia :: ImageOperations :: Resize ( icon_bitmap , skia :: ImageOperations :: RESIZE_BEST , gfx :: kFaviconSize , gfx :: kFaviconSize ) ; gfx :: Image icon_image ( resized_icon ) ; content :: BrowserThread :: PostTask ( content :: BrowserThread :: UI , FROM_HERE , base :: Bind ( callback , icon_image ) ) ; } }
Decodes an |icon_repsonse| as delivered via URLFetcher.
Decodes an |icon_repsonse| as delivered via URLFetcher .