chromium/components/omnibox/browser/featured_search_provider.cc

// Copyright 2024 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/featured_search_provider.h"

#include <stddef.h>

#include <climits>
#include <iterator>
#include <ranges>
#include <string>
#include <vector>

#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/history_embeddings/history_embeddings_features.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/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/in_memory_url_index_types.h"
#include "components/omnibox/browser/keyword_provider.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/prefs/pref_service.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_starter_pack_data.h"
#include "components/strings/grit/components_strings.h"
#include "components/url_formatter/url_formatter.h"
#include "third_party/metrics_proto/omnibox_focus_type.pb.h"
#include "third_party/metrics_proto/omnibox_input_type.pb.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"

namespace  // namespace

// Scored higher than history URL provider suggestions since inputs like '@b'
// would default 'bing.com' instead (history URL provider seems to ignore '@'
// prefix in the input). Featured Enterprise search ranks higher than "ask
// google" suggestions, which ranks higher than the other starter pack
// suggestions.
const int FeaturedSearchProvider::kGeminiRelevance =;
const int FeaturedSearchProvider::kFeaturedEnterpriseSearchRelevance =;
const int FeaturedSearchProvider::kStarterPackRelevance =;

FeaturedSearchProvider::FeaturedSearchProvider(
    AutocompleteProviderClient* client)
    :{}

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

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

FeaturedSearchProvider::~FeaturedSearchProvider() = default;

void FeaturedSearchProvider::DoStarterPackAutocompletion(
    const AutocompleteInput& input) {}

void FeaturedSearchProvider::AddStarterPackMatch(
    const TemplateURL& template_url,
    const AutocompleteInput& input) {}

void FeaturedSearchProvider::AddIPHMatch(IphType iph_type,
                                         const std::u16string& iph_contents,
                                         const std::u16string& matched_term,
                                         const std::u16string& iph_link_text,
                                         const GURL& iph_link_url,
                                         bool deletable) {}

void FeaturedSearchProvider::RegisterDisplayedMatches(
    const AutocompleteResult& result) {}

void FeaturedSearchProvider::AddFeaturedEnterpriseSearchMatch(
    const TemplateURL& template_url,
    const AutocompleteInput& input) {}

bool FeaturedSearchProvider::ShouldShowGeminiIPHMatch(
    const AutocompleteInput& input) const {}

bool FeaturedSearchProvider::ShouldShowEnterpriseFeaturedSearchIPHMatch(
    const AutocompleteInput& input) const {}

bool FeaturedSearchProvider::ShouldShowIPH(IphType iph_type) const {}

void FeaturedSearchProvider::AddFeaturedEnterpriseSearchIPHMatch() {}

bool FeaturedSearchProvider::ShouldShowHistoryEmbeddingsSettingsPromoIphMatch()
    const {}

void FeaturedSearchProvider::AddHistoryEmbeddingsSettingsPromoIphMatch() {}

bool FeaturedSearchProvider::ShouldShowHistoryEmbeddingsDisclaimerIphMatch()
    const {}

void FeaturedSearchProvider::AddHistoryEmbeddingsDisclaimerIphMatch() {}

bool FeaturedSearchProvider::ShouldShowHistoryScopePromoIphMatch(
    const AutocompleteInput& input) const {}

void FeaturedSearchProvider::AddHistoryScopePromoIphMatch() {}

bool FeaturedSearchProvider::ShouldShowHistoryEmbeddingsScopePromoIphMatch(
    const AutocompleteInput& input) const {}

void FeaturedSearchProvider::AddHistoryEmbeddingsScopePromoIphMatch() {}