Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h

Issue 2876603005: [Payment Request] Refactors the edit view controller (Closed)
Patch Set: Addressed comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_
6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_ 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H_
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 #include <vector> 9 #include <vector>
10 10
11 #import "ios/chrome/browser/ui/autofill/autofill_ui_type.h" 11 #import "ios/chrome/browser/ui/autofill/autofill_ui_type.h"
12 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" 12 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h"
13 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_dat a_source.h" 13 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_dat a_source.h"
14 14
15 extern NSString* const kWarningMessageAccessibilityID; 15 extern NSString* const kWarningMessageAccessibilityID;
16 16
17 @class EditorField;
17 @class PaymentRequestEditViewController; 18 @class PaymentRequestEditViewController;
18 19
20 // Delegate protocol for PaymentRequestEditViewController.
21 @protocol PaymentRequestEditViewControllerDelegate<NSObject>
22
23 // Notifies the delegate that the user has selected |field|.
24 - (void)paymentRequestEditViewController:
25 (PaymentRequestEditViewController*)controller
26 didSelectField:(EditorField*)field;
27
28 @end
29
19 // Validator protocol for PaymentRequestEditViewController. 30 // Validator protocol for PaymentRequestEditViewController.
20 @protocol PaymentRequestEditViewControllerValidator<NSObject> 31 @protocol PaymentRequestEditViewControllerValidator<NSObject>
21 32
22 // Returns the validation error string for |value| which has the type 33 // Returns the validation error string for |field|. Returns nil if there are no
23 // |autofillUIType|. |required| indicates whether this is a required field. 34 // validation errors.
24 // Returns nil if there are no validation errors.
25 - (NSString*)paymentRequestEditViewController: 35 - (NSString*)paymentRequestEditViewController:
26 (PaymentRequestEditViewController*)controller 36 (PaymentRequestEditViewController*)controller
27 validateValue:(NSString*)value 37 validateField:(EditorField*)field;
28 autofillUIType:(AutofillUIType)autofillUIType
29 required:(BOOL)required;
30 38
31 @end 39 @end
32 40
33 // The collection view controller for a generic Payment Request edit screen. It 41 // The collection view controller for a generic Payment Request edit screen. It
34 // features sections for every EditorField supplied to the initializer. Each 42 // features sections for every EditorField supplied to the initializer. Each
35 // section has a text field as well as an error message item which is visible 43 // section has a text field as well as an error message item which is visible
36 // when the value of its respective text field is invalid. 44 // when the value of its respective text field is invalid.
37 @interface PaymentRequestEditViewController : CollectionViewController 45 @interface PaymentRequestEditViewController : CollectionViewController
38 46
39 // The data source for this view controller. 47 // The data source for this view controller.
40 @property(nonatomic, weak) id<PaymentRequestEditViewControllerDataSource> 48 @property(nonatomic, weak) id<PaymentRequestEditViewControllerDataSource>
41 dataSource; 49 dataSource;
42 50
51 // The delegate to be notified when the user selects an editor field.
52 @property(nonatomic, weak) id<PaymentRequestEditViewControllerDelegate>
53 delegate;
54
43 // The delegate to be called for validating the fields. By default, the 55 // The delegate to be called for validating the fields. By default, the
44 // controller is the validator. 56 // controller is the validator.
45 @property(nonatomic, weak) id<PaymentRequestEditViewControllerValidator> 57 @property(nonatomic, weak) id<PaymentRequestEditViewControllerValidator>
46 validatorDelegate; 58 validatorDelegate;
47 59
48 @end 60 @end
49 61
50 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H _ 62 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698