chromium/components/search_engines/keyword_table.cc

// Copyright 2014 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/search_engines/keyword_table.h"

#include <stddef.h>

#include <memory>
#include <set>
#include <string_view>
#include <tuple>

#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/database_utils/url_converter.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "components/webdata/common/web_database.h"
#include "sql/statement.h"
#include "sql/transaction.h"
#include "url/gurl.h"

Time;

// static
constexpr char KeywordTable::kDefaultSearchProviderKey[] =;

namespace {

// Keys used in the meta table.
constexpr char kBuiltinKeywordDataVersion[] =;
constexpr char kBuiltinKeywordMilestone[] =;
constexpr char kBuiltinKeywordCountry[] =;
constexpr char kStarterPackKeywordVersion[] =;

const std::string ColumnsForVersion(int version, bool concatenated) {}

// Inserts the data from |data| into |s|.  |s| is assumed to have slots for all
// the columns in the keyword table.  |id_column| is the slot number to bind
// |data|'s |id| to; |starting_column| is the slot number of the first of a
// contiguous set of slots to bind all the other fields to.
void BindURLToStatement(const TemplateURLData& data,
                        sql::Statement* s,
                        int id_column,
                        int starting_column) {}

WebDatabaseTable::TypeKey GetKey() {}

}  // namespace

KeywordTable::KeywordTable() {}

KeywordTable::~KeywordTable() {}

KeywordTable* KeywordTable::FromWebDatabase(WebDatabase* db) {}

WebDatabaseTable::TypeKey KeywordTable::GetTypeKey() const {}

bool KeywordTable::CreateTablesIfNecessary() {}

bool KeywordTable::MigrateToVersion(int version,
                                    bool* update_compatible_version) {}

bool KeywordTable::PerformOperations(const Operations& operations) {}

bool KeywordTable::GetKeywords(Keywords* keywords) {}

bool KeywordTable::SetDefaultSearchProviderID(int64_t id) {}

int64_t KeywordTable::GetDefaultSearchProviderID() {}

bool KeywordTable::SetBuiltinKeywordDataVersion(int version) {}

int KeywordTable::GetBuiltinKeywordDataVersion() {}

bool KeywordTable::ClearBuiltinKeywordMilestone() {}

bool KeywordTable::SetBuiltinKeywordCountry(int country_id) {}

int KeywordTable::GetBuiltinKeywordCountry() {}

bool KeywordTable::SetStarterPackKeywordVersion(int version) {}

int KeywordTable::GetStarterPackKeywordVersion() {}

// static
std::string KeywordTable::GetKeywordColumns() {}

bool KeywordTable::MigrateToVersion53AddNewTabURLColumn() {}

bool KeywordTable::MigrateToVersion59RemoveExtensionKeywords() {}

// SQLite does not support DROP COLUMN operation. So A new table is created
// without the show_in_default_list column. Data from all but the dropped column
// of the old table is copied into it. After that, the old table is dropped and
// the new table is renamed to it.
bool KeywordTable::MigrateToVersion68RemoveShowInDefaultListColumn() {}

bool KeywordTable::MigrateToVersion69AddLastVisitedColumn() {}

// SQLite does not support DROP COLUMN operation. So a new table is created
// without the removed columns. Data from all but the dropped columns of the old
// table is copied into it. After that, the old table is dropped and the new
// table is renamed to it.
bool KeywordTable::MigrateToVersion76RemoveInstantColumns() {}

bool KeywordTable::MigrateToVersion77IncreaseTimePrecision() {}

bool KeywordTable::MigrateToVersion82AddCreatedFromPlayApiColumn() {}

bool KeywordTable::MigrateToVersion97AddIsActiveColumn() {}

bool KeywordTable::MigrateToVersion103AddStarterPackIdColumn() {}

bool KeywordTable::MigrateToVersion112AddEnforcedByPolicyColumn() {}

bool KeywordTable::MigrateToVersion122AddSiteSearchPolicyColumns() {}

// static
bool KeywordTable::GetKeywordDataFromStatement(sql::Statement& s,
                                               TemplateURLData* data) {}

bool KeywordTable::AddKeyword(const TemplateURLData& data) {}

bool KeywordTable::RemoveKeyword(TemplateURLID id) {}

bool KeywordTable::UpdateKeyword(const TemplateURLData& data) {}

bool KeywordTable::GetKeywordAsString(TemplateURLID id,
                                      const std::string& table_name,
                                      std::string* result) {}