chromium/chrome/browser/ui/views/autofill/payments/payments_view_util.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_UTIL_H_
#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_UTIL_H_

#include <memory>
#include <string>

#include "base/memory/raw_ptr.h"
#include "components/autofill/core/browser/payments/legal_message_line.h"
#include "components/autofill/core/browser/ui/payments/payments_bubble_closed_reasons.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/models/image_model.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/table_layout_view.h"
#include "ui/views/view.h"

class GURL;

namespace views {
class Label;
class Throbber;
class Widget;
}  // namespace views

namespace autofill {

// Gets the user avatar icon if available, or else a placeholder.
ui::ImageModel GetProfileAvatar(const AccountInfo& account_info);

// Defines a title view with an icon, a separator, and a label, to be used
// by dialogs that need to present the Google or Google Pay logo with a
// separator and custom horizontal padding.
class TitleWithIconAndSeparatorView : public views::TableLayoutView {};

// Defines a title view with a label and an icon, to be used by dialogs
// that need to present the Google or Google Pay logo and custom
// horizontal padding.
//
// Unlike TitleWithIconAndSeparatorView, this view has no separator and places
// the icon after the title rather than before.
class TitleWithIconAfterLabelView : public views::BoxLayoutView {};

// An intermediary method to switch between TitleWithIconAndSeparatorView and
// TitleWithIconAfterLabelView protected by
// kAutofillEnableMovingGPayLogoToTheRightOnDesktop.
// TODO(crbug.com/40274277): Remove this method once
// kAutofillEnableMovingGPayLogoToTheRightOnDesktop is fully launched.
std::unique_ptr<views::View> CreateTitleView(
    const std::u16string& window_title,
    TitleWithIconAndSeparatorView::Icon icon_to_show);

// Defines a view with legal message. This class handles the legal message
// parsing and the links clicking events.
class LegalMessageView : public views::BoxLayoutView {};

PaymentsBubbleClosedReason GetPaymentsBubbleClosedReasonFromWidget(
    const views::Widget* widget);

// TODO(crbug.com/40197696): Replace all payments' progress bar usages with
// this. Creates a progress bar with an explanatory text below.
class ProgressBarWithTextView : public views::BoxLayoutView {};

}  // namespace autofill

#endif  // CHROME_BROWSER_UI_VIEWS_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_UTIL_H_