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

Side by Side Diff: chrome/browser/ui/views/payments/editor_view_controller.h

Issue 2698353002: [Payments] Add the "Cards accepted" row at the top of CC editor. (Closed)
Patch Set: Initial 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h" 15 #include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
16 #include "chrome/browser/ui/views/payments/validation_delegate.h" 16 #include "chrome/browser/ui/views/payments/validation_delegate.h"
17 #include "components/autofill/core/browser/field_types.h" 17 #include "components/autofill/core/browser/field_types.h"
18 #include "ui/views/controls/button/vector_icon_button_delegate.h" 18 #include "ui/views/controls/button/vector_icon_button_delegate.h"
19 #include "ui/views/controls/combobox/combobox_listener.h" 19 #include "ui/views/controls/combobox/combobox_listener.h"
20 #include "ui/views/controls/textfield/textfield_controller.h" 20 #include "ui/views/controls/textfield/textfield_controller.h"
21 #include "ui/views/view.h"
21 22
22 namespace ui { 23 namespace ui {
23 class ComboboxModel; 24 class ComboboxModel;
24 } 25 }
25 26
26 namespace views { 27 namespace views {
27 class Textfield; 28 class Textfield;
28 class View; 29 class View;
29 } // namespace views 30 } // namespace views
30 31
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 std::unordered_map<ValidatingCombobox*, const EditorField>; 76 std::unordered_map<ValidatingCombobox*, const EditorField>;
76 77
77 // Does not take ownership of the arguments, which should outlive this object. 78 // Does not take ownership of the arguments, which should outlive this object.
78 EditorViewController(PaymentRequest* request, 79 EditorViewController(PaymentRequest* request,
79 PaymentRequestDialogView* dialog); 80 PaymentRequestDialogView* dialog);
80 ~EditorViewController() override; 81 ~EditorViewController() override;
81 82
82 // PaymentRequestSheetController: 83 // PaymentRequestSheetController:
83 std::unique_ptr<views::View> CreateView() override; 84 std::unique_ptr<views::View> CreateView() override;
84 85
86 virtual views::View* CreateHeaderView() = 0;
please use gerrit instead 2017/02/16 22:16:10 unique_ptr
Mathieu 2017/02/17 15:06:47 Done.
85 // Returns the field definitions used to build the UI. 87 // Returns the field definitions used to build the UI.
86 virtual std::vector<EditorField> GetFieldDefinitions() = 0; 88 virtual std::vector<EditorField> GetFieldDefinitions() = 0;
87 // Validates the data entered and attempts to save; returns true on success. 89 // Validates the data entered and attempts to save; returns true on success.
88 virtual bool ValidateModelAndSave() = 0; 90 virtual bool ValidateModelAndSave() = 0;
89 // Creates a ValidationDelegate which knows how to validate for a given 91 // Creates a ValidationDelegate which knows how to validate for a given
90 // |field| definition. 92 // |field| definition.
91 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate( 93 virtual std::unique_ptr<ValidationDelegate> CreateValidationDelegate(
92 const EditorField& field) = 0; 94 const EditorField& field) = 0;
93 virtual std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( 95 virtual std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType(
94 const autofill::ServerFieldType& type) = 0; 96 const autofill::ServerFieldType& type) = 0;
(...skipping 27 matching lines...) Expand all
122 // long as the input field is visible. 124 // long as the input field is visible.
123 TextFieldsMap text_fields_; 125 TextFieldsMap text_fields_;
124 ComboboxMap comboboxes_; 126 ComboboxMap comboboxes_;
125 127
126 DISALLOW_COPY_AND_ASSIGN(EditorViewController); 128 DISALLOW_COPY_AND_ASSIGN(EditorViewController);
127 }; 129 };
128 130
129 } // namespace payments 131 } // namespace payments
130 132
131 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_ 133 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_EDITOR_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698