#include "chrome/browser/ui/views/payments/editor_view_controller.h"
#include <algorithm>
#include <map>
#include <memory>
#include <utility>
#include "base/not_fatal_until.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
#include "chrome/browser/ui/views/payments/validating_combobox.h"
#include "chrome/browser/ui/views/payments/validating_textfield.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/combobox_model.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/table_layout_view.h"
#include "ui/views/view.h"
namespace payments {
namespace {
constexpr int kErrorLabelTopPadding = …;
std::unique_ptr<views::Label> CreateErrorLabel(const std::u16string& error,
autofill::FieldType type) { … }
}
EditorViewController::EditorViewController(
base::WeakPtr<PaymentRequestSpec> spec,
base::WeakPtr<PaymentRequestState> state,
base::WeakPtr<PaymentRequestDialogView> dialog,
BackNavigationType back_navigation_type,
bool is_incognito)
: … { … }
EditorViewController::~EditorViewController() { … }
void EditorViewController::DisplayErrorMessageForField(
autofill::FieldType type,
const std::u16string& error_message) { … }
int EditorViewController::GetInputFieldViewId(autofill::FieldType type) { … }
std::unique_ptr<views::View> EditorViewController::CreateHeaderView() { … }
std::unique_ptr<views::View> EditorViewController::CreateCustomFieldView(
autofill::FieldType type,
views::View** focusable_field,
bool* valid,
std::u16string* error_message) { … }
std::unique_ptr<views::View> EditorViewController::CreateExtraViewForField(
autofill::FieldType type) { … }
bool EditorViewController::ValidateInputFields() { … }
void EditorViewController::Stop() { … }
std::u16string EditorViewController::GetPrimaryButtonLabel() { … }
PaymentRequestSheetController::ButtonCallback
EditorViewController::GetPrimaryButtonCallback() { … }
int EditorViewController::GetPrimaryButtonId() { … }
bool EditorViewController::GetPrimaryButtonEnabled() { … }
bool EditorViewController::ShouldShowSecondaryButton() { … }
void EditorViewController::FillContentView(views::View* content_view) { … }
bool EditorViewController::ShouldAccelerateEnterKey() { … }
void EditorViewController::UpdateEditorView() { … }
views::View* EditorViewController::GetFirstFocusedView() { … }
std::unique_ptr<ValidatingCombobox>
EditorViewController::CreateComboboxForField(const EditorField& field,
std::u16string* error_message) { … }
void EditorViewController::ContentsChanged(views::Textfield* sender,
const std::u16string& new_contents) { … }
void EditorViewController::OnPerformAction(ValidatingCombobox* sender) { … }
std::unique_ptr<views::View> EditorViewController::CreateEditorView() { … }
views::View* EditorViewController::CreateInputField(views::View* editor_view,
const EditorField& field,
bool* valid) { … }
int EditorViewController::ComputeWidestExtraViewWidth(
EditorField::LengthHint size) { … }
void EditorViewController::AddOrUpdateErrorMessageForField(
autofill::FieldType type,
const std::u16string& error_message) { … }
void EditorViewController::SaveButtonPressed(const ui::Event& event) { … }
void EditorViewController::ClearViewPointers() { … }
}