#include "content/browser/payments/payment_instrument_icon_fetcher.h"
#include <limits>
#include <string_view>
#include <utility>
#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/task/sequenced_task_runner.h"
#include "components/payments/content/icon/icon_size.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/manifest_icon_downloader.h"
#include "third_party/blink/public/common/manifest/manifest_icon_selector.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
namespace content {
namespace {
void DownloadBestMatchingIcon(
const GURL& scope,
std::unique_ptr<std::vector<GlobalRenderFrameHostId>> frame_routing_ids,
const std::vector<blink::Manifest::ImageResource>& icons,
PaymentInstrumentIconFetcher::PaymentInstrumentIconFetcherCallback
callback);
WebContents* GetWebContentsFromFrameRoutingIds(
const GURL& scope,
const std::vector<GlobalRenderFrameHostId>& frame_routing_ids);
void OnIconFetched(
const GURL& scope,
std::unique_ptr<std::vector<GlobalRenderFrameHostId>> frame_routing_ids,
const std::vector<blink::Manifest::ImageResource>& icons,
PaymentInstrumentIconFetcher::PaymentInstrumentIconFetcherCallback callback,
const SkBitmap& bitmap) { … }
void DownloadBestMatchingIcon(
const GURL& scope,
std::unique_ptr<std::vector<GlobalRenderFrameHostId>> frame_routing_ids,
const std::vector<blink::Manifest::ImageResource>& icons,
PaymentInstrumentIconFetcher::PaymentInstrumentIconFetcherCallback
callback) { … }
WebContents* GetWebContentsFromFrameRoutingIds(
const GURL& scope,
const std::vector<GlobalRenderFrameHostId>& frame_routing_ids) { … }
}
void PaymentInstrumentIconFetcher::Start(
const GURL& scope,
std::unique_ptr<std::vector<GlobalRenderFrameHostId>> provider_hosts,
const std::vector<blink::Manifest::ImageResource>& icons,
PaymentInstrumentIconFetcherCallback callback) { … }
}