#include "chrome/browser/ui/views/omnibox/omnibox_result_view.h"
#include <limits.h>
#include <algorithm>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/omnibox/omnibox_theme.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/location_bar/selected_keyword_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_popup_view_views.h"
#include "chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_text_view.h"
#include "chrome/browser/ui/views/omnibox/remove_suggestion_bubble.h"
#include "chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h"
#include "chrome/grit/generated_resources.h"
#include "components/omnibox/browser/actions/omnibox_pedal.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/omnibox.mojom-shared.h"
#include "components/omnibox/browser/omnibox_client.h"
#include "components/omnibox/browser/omnibox_controller.h"
#include "components/omnibox/browser/omnibox_edit_model.h"
#include "components/omnibox/browser/omnibox_feature_configs.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_popup_selection.h"
#include "components/omnibox/browser/vector_icons.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "third_party/metrics_proto/omnibox_event.pb.h"
#include "third_party/omnibox_proto/answer_data.pb.h"
#include "third_party/omnibox_proto/rich_answer_template.pb.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_id.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/link.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/metadata/type_conversion.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/atl.h"
#endif
namespace {
class OmniboxResultViewButton : public views::ImageButton { … };
BEGIN_METADATA(…)
}
class OmniboxResultSelectionIndicator : public views::View { … };
BEGIN_METADATA(…)
OmniboxResultView::OmniboxResultView(OmniboxPopupViewViews* popup_view,
size_t model_index)
: … { … }
OmniboxResultView::~OmniboxResultView() { … }
std::unique_ptr<views::Background> OmniboxResultView::GetPopupCellBackground(
views::View* view,
OmniboxPartState part_state) { … }
void OmniboxResultView::SetMatch(const AutocompleteMatch& match) { … }
void OmniboxResultView::ApplyThemeAndRefreshIcons(bool force_reapply_styles) { … }
void OmniboxResultView::OnSelectionStateChanged() { … }
bool OmniboxResultView::GetMatchSelected() const { … }
views::Button* OmniboxResultView::GetActiveAuxiliaryButtonForAccessibility() { … }
OmniboxPartState OmniboxResultView::GetThemeState() const { … }
void OmniboxResultView::OnMatchIconUpdated() { … }
void OmniboxResultView::SetRichSuggestionImage(const gfx::ImageSkia& image) { … }
void OmniboxResultView::ButtonPressed(OmniboxPopupSelection::LineState state,
const ui::Event& event) { … }
bool OmniboxResultView::OnMousePressed(const ui::MouseEvent& event) { … }
bool OmniboxResultView::OnMouseDragged(const ui::MouseEvent& event) { … }
void OmniboxResultView::OnMouseReleased(const ui::MouseEvent& event) { … }
void OmniboxResultView::OnMouseEntered(const ui::MouseEvent& event) { … }
void OmniboxResultView::OnMouseExited(const ui::MouseEvent& event) { … }
void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { … }
void OmniboxResultView::OnThemeChanged() { … }
void OmniboxResultView::EmitTextChangedAccessiblityEvent() { … }
void OmniboxResultView::UpdateAccessibilityProperties() { … }
void OmniboxResultView::OpenIphLink() { … }
gfx::Image OmniboxResultView::GetIcon() const { … }
void OmniboxResultView::UpdateHoverState() { … }
void OmniboxResultView::UpdateFeedbackButtonsVisibility() { … }
void OmniboxResultView::UpdateRemoveSuggestionVisibility() { … }
void OmniboxResultView::UpdateAccessibilitySelectedState() { … }
void OmniboxResultView::OnBoundsChanged(const gfx::Rect& previous_bounds) { … }
DEFINE_ENUM_CONVERTERS(…)
BEGIN_METADATA(…)