#include "chrome/browser/ui/views/autofill/payments/payments_view_util.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "build/branding_buildflags.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.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/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/text_constants.h"
#include "ui/views/border.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/separator.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/controls/throbber.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/style/typography.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace autofill {
namespace {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
constexpr int kGooglePayLogoWidth = 40;
#endif
constexpr int kIconHeight = …;
constexpr int kSeparatorHeight = …;
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
gfx::ImageSkia CreateTiledIcon(const ui::ColorProvider* provider) {
return gfx::ImageSkiaOperations::CreateTiledImage(
gfx::CreateVectorIcon(vector_icons::kGooglePayLogoIcon,
provider->GetColor(kColorPaymentsGooglePayLogo)),
0, 0, kGooglePayLogoWidth, kIconHeight);
}
#endif
std::unique_ptr<views::ImageView> CreateIconView(
TitleWithIconAndSeparatorView::Icon icon_to_show) { … }
}
ui::ImageModel GetProfileAvatar(const AccountInfo& account_info) { … }
TitleWithIconAndSeparatorView::TitleWithIconAndSeparatorView(
const std::u16string& window_title,
Icon icon_to_show) { … }
TitleWithIconAndSeparatorView::~TitleWithIconAndSeparatorView() = default;
gfx::Size TitleWithIconAndSeparatorView::GetMinimumSize() const { … }
BEGIN_METADATA(…)
TitleWithIconAfterLabelView::TitleWithIconAfterLabelView(
const std::u16string& window_title,
TitleWithIconAndSeparatorView::Icon icon_to_show) { … }
TitleWithIconAfterLabelView::~TitleWithIconAfterLabelView() = default;
gfx::Size TitleWithIconAfterLabelView::GetMinimumSize() const { … }
BEGIN_METADATA(…)
std::unique_ptr<views::View> CreateTitleView(
const std::u16string& window_title,
TitleWithIconAndSeparatorView::Icon icon_to_show) { … }
LegalMessageView::LegalMessageView(const LegalMessageLines& legal_message_lines,
const std::u16string& user_email,
const ui::ImageModel& user_avatar,
LinkClickedCallback callback) { … }
LegalMessageView::~LegalMessageView() = default;
BEGIN_METADATA(…)
PaymentsBubbleClosedReason GetPaymentsBubbleClosedReasonFromWidget(
const views::Widget* widget) { … }
ProgressBarWithTextView::ProgressBarWithTextView(
const std::u16string& progress_bar_text) { … }
ProgressBarWithTextView::~ProgressBarWithTextView() = default;
void ProgressBarWithTextView::OnThemeChanged() { … }
void ProgressBarWithTextView::AddedToWidget() { … }
BEGIN_METADATA(…)
}