#include "chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h"
#include <algorithm>
#include <optional>
#include "base/metrics/field_trial_params.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/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/omnibox/omnibox_popup_view_views.h"
#include "chrome/browser/ui/views/omnibox/omnibox_text_view.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "components/omnibox/browser/autocomplete_provider.h"
#include "components/omnibox/browser/omnibox_feature_configs.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/suggestion_answer.h"
#include "components/omnibox/browser/vector_icons.h"
#include "components/omnibox/common/omnibox_features.h"
#include "content/public/common/color_parser.h"
#include "skia/ext/image_operations.h"
#include "third_party/omnibox_proto/answer_type.pb.h"
#include "third_party/omnibox_proto/rich_answer_template.pb.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/pointer/touch_ui_controller.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/render_text.h"
#include "ui/views/border.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/link.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/layout/layout_types.h"
#include "ui/views/style/typography.h"
namespace {
static constexpr int kUniformRowHeightIconSize = …;
static constexpr int kIphTextIndent = …;
int GetAnswerImageSize() { … }
int GetEntityImageSize() { … }
int GetIconAndImageCornerRadius() { … }
double GetEntityBackgroundScale() { … }
int GetWeatherImageSize() { … }
int GetWeatherBackgroundSize() { … }
class PlaceholderImageSource : public gfx::CanvasImageSource { … };
PlaceholderImageSource::PlaceholderImageSource(const gfx::Size& canvas_size,
SkColor color)
: … { … }
void PlaceholderImageSource::Draw(gfx::Canvas* canvas) { … }
class RoundedCornerImageView : public views::ImageView { … };
void RoundedCornerImageView::OnPaint(gfx::Canvas* canvas) { … }
BEGIN_METADATA(…)
}
void OmniboxMatchCellView::ComputeMatchMaxWidths(
int contents_width,
int separator_width,
int description_width,
int iph_link_width,
int available_width,
bool description_on_separate_line,
bool allow_shrinking_contents,
int* contents_max_width,
int* description_max_width,
int* iph_link_max_width) { … }
OmniboxMatchCellView::OmniboxMatchCellView(OmniboxResultView* result_view) { … }
OmniboxMatchCellView::~OmniboxMatchCellView() = default;
bool OmniboxMatchCellView::ShouldDisplayImage(const AutocompleteMatch& match) { … }
void OmniboxMatchCellView::OnMatchUpdate(const OmniboxResultView* result_view,
const AutocompleteMatch& match) { … }
void OmniboxMatchCellView::SetIcon(const gfx::ImageSkia& image,
const AutocompleteMatch& match) { … }
void OmniboxMatchCellView::ClearIcon() { … }
void OmniboxMatchCellView::SetImage(const gfx::ImageSkia& image,
const AutocompleteMatch& match) { … }
gfx::Insets OmniboxMatchCellView::GetInsets() const { … }
void OmniboxMatchCellView::Layout(PassKey) { … }
gfx::Size OmniboxMatchCellView::CalculatePreferredSize(
const views::SizeBounds& available_size) const { … }
int OmniboxMatchCellView::GetImageIndent() const { … }
int OmniboxMatchCellView::GetTextIndent() const { … }
void OmniboxMatchCellView::SetTailSuggestCommonPrefixWidth(
const std::u16string& common_prefix) { … }
BEGIN_METADATA(…)