chromium/components/favicon/core/history_ui_favicon_request_handler_impl.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Parameter used for local bitmap queries by page url. The url is an origin,
// and it may not have had a favicon associated with it. A trickier case is when
// it only has domain-scoped cookies, but visitors are redirected to HTTPS on
// visiting. It defaults to a HTTP scheme, but the favicon will be associated
// with the HTTPS URL and hence won't be found if we include the scheme in the
// lookup. Set `fallback_to_host`=true so the favicon database will fall back to
// matching only the hostname to have the best chance of finding a favicon.
const bool kFallbackToHost =;

// Parameter used for local bitmap queries by page url.
favicon_base::IconTypeSet GetIconTypesForLocalQuery() {}

}  // namespace

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) {}

}  // namespace favicon