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

Side by Side Diff: chrome/browser/ui/views/payments/validating_combobox.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 unified diff | Download patch
OLDNEW
(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 ValidatingCombobox(std::unique_ptr<ui::ComboboxModel> model,
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_blurred_;
34
35 DISALLOW_COPY_AND_ASSIGN(ValidatingCombobox);
36 };
37
38 } // namespace payments
39
40 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATING_COMBOBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698