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

Unified Diff: chrome/browser/ui/views/payments/validating_textfield.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
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..c7d87de3dec5488245409006494ea7f0a0303283 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,11 +24,12 @@ 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_;
- bool was_validated_ = false;
+ std::unique_ptr<ValidationDelegate> delegate_;
+ bool was_blurred_;
DISALLOW_COPY_AND_ASSIGN(ValidatingTextfield);
};
« no previous file with comments | « chrome/browser/ui/views/payments/validating_combobox.cc ('k') | chrome/browser/ui/views/payments/validating_textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698