| Index: ios/chrome/browser/payments/payment_request_edit_view_controller.h
|
| diff --git a/ios/chrome/browser/payments/payment_request_edit_view_controller.h b/ios/chrome/browser/payments/payment_request_edit_view_controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ca9d2319886ee67f494eac9dab5254e84aee7ca0
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/payments/payment_request_edit_view_controller.h
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_
|
| +#define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_
|
| +
|
| +#import <UIKit/UIKit.h>
|
| +#include <vector>
|
| +
|
| +#include "components/autofill/core/browser/field_types.h"
|
| +#import "ios/chrome/browser/ui/collection_view/collection_view_controller.h"
|
| +
|
| +// Field definition for an editor field. Used for building the UI and
|
| +// validation.
|
| +struct EditorField {
|
| + EditorField(autofill::ServerFieldType data_type,
|
| + const base::string16& label,
|
| + bool required,
|
| + int item_type,
|
| + int section_id)
|
| + : data_type(data_type),
|
| + label(label),
|
| + required(required),
|
| + item_type(item_type),
|
| + section_id(section_id) {}
|
| +
|
| + // Data type for the field.
|
| + const autofill::ServerFieldType data_type;
|
| + // Label for the field.
|
| + const base::string16 label;
|
| + // Whether the field is required.
|
| + bool required;
|
| + // Item type for the field.
|
| + int item_type;
|
| + // Section identifier for the field.
|
| + int section_id;
|
| +};
|
| +
|
| +// The collection view controller for a generic Payment Request edit screen. It
|
| +// features sections for every EditorField returned by -editorFields. Each
|
| +// section has a text field as well as an optional error message item.
|
| +@interface PaymentRequestEditViewController
|
| + : CollectionViewController<UITextFieldDelegate>
|
| +
|
| +// Subclasses override this method to return a list of field definitions for the
|
| +// editor.
|
| +- (std::vector<EditorField>)editorFields;
|
| +
|
| +- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
| +
|
| +- (instancetype)initWithStyle:(CollectionViewControllerStyle)style
|
| + NS_UNAVAILABLE;
|
| +
|
| +@end
|
| +
|
| +#endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_
|
|
|