Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "chrome/browser/ui/views/payments/validation_delegate.h" | |
| 10 #include "ui/views/controls/combobox/combobox.h" | |
| 11 | |
| 12 namespace payments { | |
| 13 | |
| 14 class ValidatingCombobox : public views::Combobox { | |
| 15 public: | |
| 16 explicit ValidatingCombobox(std::unique_ptr<ui::ComboboxModel> model, | |
| 
 
please use gerrit instead
2017/02/15 15:59:39
No need for "explicit" keyword with more than one
 
Mathieu
2017/02/15 19:55:51
Done.
 
 | |
| 17 std::unique_ptr<ValidationDelegate> delegate); | |
| 18 ~ValidatingCombobox() override; | |
| 19 | |
| 20 // Combobox: | |
| 21 // The first validation will happen on blur. | |
| 22 void OnBlur() override; | |
| 23 | |
| 24 // Called when the combobox contents is changed. May do validation. | |
| 25 void OnContentsChanged(); | |
| 26 | |
| 27 private: | |
| 28 // Will call to the ValidationDelegate to validate the contents of the | |
| 29 // combobox. | |
| 30 void Validate(); | |
| 31 | |
| 32 std::unique_ptr<ValidationDelegate> delegate_; | |
| 33 bool was_validated_ = false; | |
| 
 
please use gerrit instead
2017/02/15 15:59:39
Haven't see this done before. Perhaps it's best to
 
Mathieu
2017/02/15 19:55:51
Done.
 
 | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(ValidatingCombobox); | |
| 36 }; | |
| 37 | |
| 38 } // namespace payments | |
| 39 | |
| 40 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_ | |
| OLD | NEW |