#include "chrome/browser/ui/search_engines/template_url_table_model.h"
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/i18n/string_compare.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/grit/generated_resources.h"
#include "components/omnibox/browser/omnibox_field_trial.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 "third_party/icu/source/common/unicode/locid.h"
#include "third_party/icu/source/i18n/unicode/coll.h"
#include "third_party/icu/source/i18n/unicode/ucol.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/table_model_observer.h"
namespace {
class OrderByManagedAndAlphabetically { … };
OrderByManagedAndAlphabetically::OrderByManagedAndAlphabetically() { … }
bool OrderByManagedAndAlphabetically::operator()(const TemplateURL* lhs,
const TemplateURL* rhs) const { … }
std::string OrderByManagedAndAlphabetically::GetShortNameSortKey(
const std::u16string& short_name) const { … }
}
TemplateURLTableModel::TemplateURLTableModel(
TemplateURLService* template_url_service)
: … { … }
TemplateURLTableModel::~TemplateURLTableModel() { … }
void TemplateURLTableModel::Reload() { … }
size_t TemplateURLTableModel::RowCount() { … }
std::u16string TemplateURLTableModel::GetText(size_t row, int col_id) { … }
void TemplateURLTableModel::SetObserver(ui::TableModelObserver* observer) { … }
std::u16string TemplateURLTableModel::GetKeywordToDisplay(size_t row) { … }
void TemplateURLTableModel::Remove(size_t index) { … }
void TemplateURLTableModel::Add(size_t index,
const std::u16string& short_name,
const std::u16string& keyword,
const std::string& url) { … }
void TemplateURLTableModel::ModifyTemplateURL(size_t index,
const std::u16string& title,
const std::u16string& keyword,
const std::string& url) { … }
TemplateURL* TemplateURLTableModel::GetTemplateURL(size_t index) { … }
std::optional<size_t> TemplateURLTableModel::IndexOfTemplateURL(
const TemplateURL* template_url) { … }
void TemplateURLTableModel::MakeDefaultTemplateURL(
size_t index,
search_engines::ChoiceMadeLocation choice_location) { … }
void TemplateURLTableModel::SetIsActiveTemplateURL(size_t index,
bool is_active) { … }
void TemplateURLTableModel::OnTemplateURLServiceChanged() { … }