#include "components/favicon/core/history_ui_favicon_request_handler_impl.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "components/favicon/core/favicon_service.h"
#include "components/favicon/core/large_icon_service.h"
#include "components/favicon_base/favicon_types.h"
#include "components/favicon_base/favicon_util.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "ui/gfx/image/image_png_rep.h"
namespace favicon {
namespace {
void RecordFaviconAvailabilityAndLatencyMetric(
HistoryUiFaviconRequestOrigin origin_for_uma,
FaviconAvailability availability) { … }
const bool kFallbackToHost = …;
favicon_base::IconTypeSet GetIconTypesForLocalQuery() { … }
}
HistoryUiFaviconRequestHandlerImpl::HistoryUiFaviconRequestHandlerImpl(
const CanSendHistoryDataGetter& can_send_history_data_getter,
FaviconService* favicon_service,
LargeIconService* large_icon_service)
: … { … }
HistoryUiFaviconRequestHandlerImpl::~HistoryUiFaviconRequestHandlerImpl() { … }
void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL(
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
HistoryUiFaviconRequestOrigin request_origin_for_uma) { … }
void HistoryUiFaviconRequestHandlerImpl::GetFaviconImageForPageURL(
const GURL& page_url,
favicon_base::FaviconImageCallback callback,
HistoryUiFaviconRequestOrigin request_origin_for_uma) { … }
void HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable(
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback response_callback,
HistoryUiFaviconRequestOrigin origin_for_uma,
const favicon_base::FaviconRawBitmapResult& bitmap_result) { … }
void HistoryUiFaviconRequestHandlerImpl::OnImageLocalDataAvailable(
const GURL& page_url,
favicon_base::FaviconImageCallback response_callback,
HistoryUiFaviconRequestOrigin origin_for_uma,
const favicon_base::FaviconImageResult& image_result) { … }
void HistoryUiFaviconRequestHandlerImpl::RequestFromGoogleServer(
const GURL& page_url,
base::OnceClosure empty_response_callback,
base::OnceClosure local_lookup_callback,
HistoryUiFaviconRequestOrigin origin_for_uma) { … }
void HistoryUiFaviconRequestHandlerImpl::OnGoogleServerDataAvailable(
base::OnceClosure empty_response_callback,
base::OnceClosure local_lookup_callback,
HistoryUiFaviconRequestOrigin origin_for_uma,
favicon_base::GoogleFaviconServerRequestStatus status) { … }
}