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

Unified Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.h

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: re-enable test, addressed comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
index 15e07fc6eef20bce22e62b52e261eff10e3688c6..40420f288175da09ca192de4d2babbd4bfaf2e7b 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
@@ -7,7 +7,8 @@
#include "base/macros.h"
#include "chrome/browser/ui/views/payments/editor_view_controller.h"
-#include "chrome/browser/ui/views/payments/validating_textfield.h"
+#include "chrome/browser/ui/views/payments/validation_delegate.h"
+#include "ui/base/models/simple_combobox_model.h"
namespace payments {
@@ -25,22 +26,28 @@ class CreditCardEditorViewController : public EditorViewController {
// EditorViewController:
std::vector<EditorField> GetFieldDefinitions() override;
bool ValidateModelAndSave() override;
- std::unique_ptr<ValidatingTextfield::Delegate> CreateValidationDelegate(
+ std::unique_ptr<ValidationDelegate> CreateValidationDelegate(
const EditorField& field) override;
+ std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType(
+ const autofill::ServerFieldType& type) override;
private:
- class ValidationDelegate : public ValidatingTextfield::Delegate {
+ class CreditCardValidationDelegate : public ValidationDelegate {
public:
- explicit ValidationDelegate(const EditorField& field);
- ~ValidationDelegate() override;
+ explicit CreditCardValidationDelegate(const EditorField& field);
+ ~CreditCardValidationDelegate() override;
- // ValidatingTextfield::Delegate:
+ // ValidationDelegate:
bool ValidateTextfield(views::Textfield* textfield) override;
+ bool ValidateCombobox(views::Combobox* combobox) override;
private:
+ // Validates a specific |value|.
+ bool ValidateValue(const base::string16& value);
+
EditorField field_;
- DISALLOW_COPY_AND_ASSIGN(ValidationDelegate);
+ DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};
DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController);
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698