chromium/components/omnibox/browser/shortcuts_backend.cc

// Copyright 2012 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/shortcuts_backend.h"

#include <stddef.h>

#include <map>
#include <memory>
#include <set>
#include <string>
#include <utility>

#include "base/functional/bind.h"
#include "base/i18n/case_conversion.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/uuid.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_result.h"
#include "components/omnibox/browser/base_search_provider.h"
#include "components/omnibox/browser/in_memory_url_index_types.h"
#include "components/omnibox/browser/shortcuts_database.h"
#include "components/omnibox/browser/tailored_word_break_iterator.h"

namespace {

// Takes Match classification vector and removes all matched positions,
// compacting repetitions if necessary.
std::string StripMatchMarkers(const ACMatchClassifications& matches) {}

// Normally shortcuts have the same match type as the original match they were
// created from, but for certain match types, we should modify the shortcut's
// type slightly to reflect that the origin of the shortcut is historical.
AutocompleteMatch::Type GetTypeForShortcut(AutocompleteMatch::Type type) {}

// Expand the last word in `text` to a full word in `match_text`. E.g., if
// `text` is 'Cha Aznav' and the `match_text` is 'Charles Aznavour', will return
// 'Cha Aznavour'. Inlining 'Cha Aznav' would look incomplete.
// - `trimmed_text` and `match_text` should have original capitalization as
//   `ExpandToFullWord()` tries to preserve it.
// - `trimmed_text` should be trimmed for efficiency since the callers already
//   have it available.
// - `is_existing_shortcut` is true when updating existing shortcuts and false
//    when creating new shortcuts. See comment below.
std::u16string ExpandToFullWord(std::u16string trimmed_text,
                                std::u16string match_text,
                                bool is_existing_shortcut) {}

}  // namespace

// ShortcutsBackend -----------------------------------------------------------

// static
const std::u16string& ShortcutsBackend::GetDescription(
    const AutocompleteMatch& match) {}

// static
const std::u16string& ShortcutsBackend::GetSwappedDescription(
    const AutocompleteMatch& match) {}

// static
const ACMatchClassifications& ShortcutsBackend::GetDescriptionClass(
    const AutocompleteMatch& match) {}

// static
const std::u16string& ShortcutsBackend::GetContents(
    const AutocompleteMatch& match) {}

// static
const std::u16string& ShortcutsBackend::GetSwappedContents(
    const AutocompleteMatch& match) {}

// static
const ACMatchClassifications& ShortcutsBackend::GetContentsClass(
    const AutocompleteMatch& match) {}

ShortcutsBackend::ShortcutsBackend(
    TemplateURLService* template_url_service,
    std::unique_ptr<SearchTermsData> search_terms_data,
    history::HistoryService* history_service,
    base::FilePath database_path,
    bool suppress_db)
    :{}

bool ShortcutsBackend::Init() {}

bool ShortcutsBackend::DeleteShortcutsWithURL(const GURL& shortcut_url) {}

bool ShortcutsBackend::DeleteShortcutsBeginningWithURL(
    const GURL& shortcut_url) {}

void ShortcutsBackend::AddObserver(ShortcutsBackendObserver* obs) {}

void ShortcutsBackend::RemoveObserver(ShortcutsBackendObserver* obs) {}

void ShortcutsBackend::AddOrUpdateShortcut(const std::u16string& text,
                                           const AutocompleteMatch& match) {}

ShortcutsBackend::~ShortcutsBackend() {}

// static
ShortcutsDatabase::Shortcut::MatchCore ShortcutsBackend::MatchToMatchCore(
    const AutocompleteMatch& match,
    TemplateURLService* template_url_service,
    SearchTermsData* search_terms_data) {}

void ShortcutsBackend::ShutdownOnUIThread() {}

void ShortcutsBackend::OnHistoryDeletions(
    history::HistoryService* history_service,
    const history::DeletionInfo& deletion_info) {}

void ShortcutsBackend::InitInternal() {}

void ShortcutsBackend::InitCompleted() {}

bool ShortcutsBackend::AddShortcut(
    const ShortcutsDatabase::Shortcut& shortcut) {}

bool ShortcutsBackend::UpdateShortcut(
    const ShortcutsDatabase::Shortcut& shortcut) {}

bool ShortcutsBackend::DeleteShortcutsWithIDs(
    const ShortcutsDatabase::ShortcutIDs& shortcut_ids) {}

bool ShortcutsBackend::DeleteShortcutsWithURL(const GURL& url,
                                              bool exact_match) {}

bool ShortcutsBackend::DeleteAllShortcuts() {}