#include "components/omnibox/browser/omnibox_view.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/omnibox/browser/autocomplete_controller.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/location_bar_model.h"
#include "components/omnibox/browser/omnibox_controller.h"
#include "components/omnibox/browser/omnibox_edit_model.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/search/search.h"
#include "components/search_engines/template_url_service.h"
#include "extensions/buildflags/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_features.h"
#include "url/url_constants.h"
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
#include "components/omnibox/browser/vector_icons.h"
#include "ui/gfx/paint_vector_icon.h"
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/constants.h"
#endif
namespace {
bool RichAutocompletionEitherNonPrefixEnabled() { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
bool HasVectorIconBackground(const AutocompleteMatch& match) { … }
#endif
}
OmniboxView::State::State() = default;
OmniboxView::State::State(const State& state) = default;
std::u16string OmniboxView::StripJavascriptSchemas(const std::u16string& text) { … }
std::u16string OmniboxView::SanitizeTextForPaste(const std::u16string& text) { … }
OmniboxView::~OmniboxView() = default;
bool OmniboxView::IsEditingOrEmpty() const { … }
ui::ImageModel OmniboxView::GetIcon(int dip_size,
SkColor color_current_page_icon,
SkColor color_vectors,
SkColor color_bright_vectors,
SkColor color_vectors_with_background,
IconFetchedCallback on_icon_fetched,
bool dark_mode) const { … }
void OmniboxView::SetUserText(const std::u16string& text) { … }
void OmniboxView::SetUserText(const std::u16string& text, bool update_popup) { … }
void OmniboxView::RevertAll() { … }
void OmniboxView::CloseOmniboxPopup() { … }
bool OmniboxView::IsImeShowingPopup() const { … }
void OmniboxView::ShowVirtualKeyboardIfEnabled() { … }
void OmniboxView::HideImeIfNeeded() { … }
bool OmniboxView::IsIndicatingQueryRefinement() const { … }
void OmniboxView::GetState(State* state) { … }
OmniboxView::StateChanges OmniboxView::GetStateChanges(const State& before,
const State& after) { … }
OmniboxView::OmniboxView(std::unique_ptr<OmniboxClient> client)
: … { … }
OmniboxEditModel* OmniboxView::model() { … }
const OmniboxEditModel* OmniboxView::model() const { … }
OmniboxController* OmniboxView::controller() { … }
const OmniboxController* OmniboxView::controller() const { … }
void OmniboxView::TextChanged() { … }
void OmniboxView::UpdateTextStyle(
const std::u16string& display_text,
const bool text_is_url,
const AutocompleteSchemeClassifier& classifier) { … }