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

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

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: fix test 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
Index: chrome/browser/ui/views/payments/validating_textfield.h
diff --git a/chrome/browser/ui/views/payments/validating_textfield.h b/chrome/browser/ui/views/payments/validating_textfield.h
index 44cb5af4372dc3d0afb75e139fe3e28cf8c48a53..32e63ee67df1f866415230a3c9c3b6fabfca201e 100644
--- a/chrome/browser/ui/views/payments/validating_textfield.h
+++ b/chrome/browser/ui/views/payments/validating_textfield.h
@@ -6,26 +6,14 @@
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_TEXTFIELD_H_
#include "base/macros.h"
+#include "chrome/browser/ui/views/payments/validation_delegate.h"
#include "ui/views/controls/textfield/textfield.h"
namespace payments {
class ValidatingTextfield : public views::Textfield {
public:
- class Delegate {
- public:
- Delegate() {}
- virtual ~Delegate() {}
-
- // Only the delegate knows how to validate the textfield.
- virtual bool ValidateTextfield(views::Textfield* textfield) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Delegate);
- };
-
- explicit ValidatingTextfield(
- std::unique_ptr<ValidatingTextfield::Delegate> delegate);
+ explicit ValidatingTextfield(std::unique_ptr<ValidationDelegate> delegate);
~ValidatingTextfield() override;
// Textfield:
@@ -36,10 +24,11 @@ class ValidatingTextfield : public views::Textfield {
void OnContentsChanged();
private:
- // Will call to the Delegate to validate the contents of the textfield.
+ // Will call to the ValidationDelegate to validate the contents of the
+ // textfield.
void Validate();
- std::unique_ptr<ValidatingTextfield::Delegate> delegate_;
+ std::unique_ptr<ValidationDelegate> delegate_;
bool was_validated_ = false;
DISALLOW_COPY_AND_ASSIGN(ValidatingTextfield);

Powered by Google App Engine
This is Rietveld 408576698