OLD | NEW |
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 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" | 5 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/ui/views/payments/validating_textfield.h" | 8 #include "chrome/browser/ui/views/payments/validating_textfield.h" |
9 #include "components/autofill/core/browser/autofill_country.h" | 9 #include "components/autofill/core/browser/autofill_country.h" |
10 #include "components/autofill/core/browser/autofill_profile.h" | 10 #include "components/autofill/core/browser/autofill_profile.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 void ContactInfoEditorViewController::PopulateProfile( | 125 void ContactInfoEditorViewController::PopulateProfile( |
126 autofill::AutofillProfile* profile) { | 126 autofill::AutofillProfile* profile) { |
127 for (const auto& field : text_fields()) { | 127 for (const auto& field : text_fields()) { |
128 profile->SetInfo(autofill::AutofillType(field.second.type), | 128 profile->SetInfo(autofill::AutofillType(field.second.type), |
129 field.first->text(), state()->GetApplicationLocale()); | 129 field.first->text(), state()->GetApplicationLocale()); |
130 } | 130 } |
131 profile->set_origin(autofill::kSettingsOrigin); | 131 profile->set_origin(autofill::kSettingsOrigin); |
132 } | 132 } |
133 | 133 |
| 134 bool ContactInfoEditorViewController::GetSheetId(DialogViewID* sheet_id) { |
| 135 *sheet_id = DialogViewID::CONTACT_INFO_EDITOR_SHEET; |
| 136 return true; |
| 137 } |
| 138 |
134 ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 139 ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
135 ContactInfoValidationDelegate(const EditorField& field, | 140 ContactInfoValidationDelegate(const EditorField& field, |
136 const std::string& locale, | 141 const std::string& locale, |
137 EditorViewController* controller) | 142 EditorViewController* controller) |
138 : field_(field), controller_(controller), locale_(locale) {} | 143 : field_(field), controller_(controller), locale_(locale) {} |
139 | 144 |
140 ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 145 ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
141 ~ContactInfoValidationDelegate() {} | 146 ~ContactInfoValidationDelegate() {} |
142 | 147 |
143 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 148 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 195 } |
191 | 196 |
192 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: | 197 bool ContactInfoEditorViewController::ContactInfoValidationDelegate:: |
193 ValidateCombobox(views::Combobox* combobox) { | 198 ValidateCombobox(views::Combobox* combobox) { |
194 // This UI doesn't contain any comboboxes. | 199 // This UI doesn't contain any comboboxes. |
195 NOTREACHED(); | 200 NOTREACHED(); |
196 return true; | 201 return true; |
197 } | 202 } |
198 | 203 |
199 } // namespace payments | 204 } // namespace payments |
OLD | NEW |