chromium/components/omnibox/browser/most_visited_sites_provider.cc

// Copyright 2020 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/omnibox/browser/most_visited_sites_provider.h"

#include <string>
#include <vector>

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/escape.h"
#include "components/history/core/browser/top_sites.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_classification.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search_engines/template_url_service.h"
#include "components/url_formatter/url_formatter.h"
#include "third_party/metrics_proto/omnibox_event.pb.h"
#include "third_party/omnibox_proto/types.pb.h"
#include "ui/base/device_form_factor.h"
#include "url/gurl.h"

namespace {
// The relevance score for suggest tiles represented as a single tiling match.
// Suggest tiles are placed in a dedicated SECTION_MOBILE_MOST_VISITED
// making its relative relevance score not important.
constexpr const int kMostVisitedTilesAggregateRelevance =;

// The relevance score for suggest tiles represented as individual matches.
// Repeatable Queries are recognized as searches, and may get merged to higher
// ranking search suggestions listed below the carousel.
constexpr const int kMostVisitedTilesIndividualHighRelevance =;
// Matches known to be off-screen by default are listed as low-relevance.
// If we have additional AutocompleteMatches listed below the MV carousel
// pointing to the same destination, we want the tiles to be deduplicated to
// these matches.
constexpr const int kMostVisitedTilesIndividualLowRelevance =;
// Index of the last high-relevance tile.
constexpr const int kLastHighRelevanceIndividualTile =;

constexpr const int kMaxRecordedTileIndex =;

constexpr char kHistogramTileTypeCountSearch[] =;
constexpr char kHistogramTileTypeCountURL[] =;
constexpr char kHistogramDeletedTileType[] =;
constexpr char kHistogramDeletedTileIndex[] =;

// GENERATED_JAVA_ENUM_PACKAGE: (
// org.chromium.chrome.browser.omnibox.suggestions.mostvisited)
// GENERATED_JAVA_CLASS_NAME_OVERRIDE: SuggestTileType
enum SuggestTileType {};

// Constructs an AutocompleteMatch from supplied details.
AutocompleteMatch BuildMatch(AutocompleteProvider* provider,
                             AutocompleteProviderClient* client,
                             const std::u16string& description,
                             const GURL& url,
                             int relevance,
                             AutocompleteMatchType::Type type) {}

template <typename TileContainer>
bool BuildTileSuggest(AutocompleteProvider* provider,
                      AutocompleteProviderClient* const client,
                      ui::DeviceFormFactor device_form_factor,
                      const TileContainer& container,
                      ACMatches& matches) {}
}  // namespace

void MostVisitedSitesProvider::Start(const AutocompleteInput& input,
                                     bool minimal_changes) {}

void MostVisitedSitesProvider::Stop(bool clear_cached_results,
                                    bool due_to_user_inactivity) {}

MostVisitedSitesProvider::MostVisitedSitesProvider(
    AutocompleteProviderClient* client,
    AutocompleteProviderListener* listener)
    :{}

MostVisitedSitesProvider::~MostVisitedSitesProvider() = default;

void MostVisitedSitesProvider::OnMostVisitedUrlsAvailable(
    const history::MostVisitedURLList& urls) {}

bool MostVisitedSitesProvider::AllowMostVisitedSitesSuggestions(
    const AutocompleteInput& input) const {}

void MostVisitedSitesProvider::BlockURL(const GURL& site_url) {}

void MostVisitedSitesProvider::DeleteMatch(const AutocompleteMatch& match) {}

void MostVisitedSitesProvider::DeleteMatchElement(
    const AutocompleteMatch& source_match,
    size_t element_index) {}