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

Side by Side Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc

Issue 2841603004: [Payments] Update some editor titles to reflect missing information (Closed)
Patch Set: Initial Created 3 years, 7 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 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll er.h" 5 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll er.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 views::Combobox* country_combo_box = static_cast<views::Combobox*>( 200 views::Combobox* country_combo_box = static_cast<views::Combobox*>(
201 dialog()->GetViewByID(autofill::ADDRESS_HOME_COUNTRY)); 201 dialog()->GetViewByID(autofill::ADDRESS_HOME_COUNTRY));
202 DCHECK(country_combo_box); 202 DCHECK(country_combo_box);
203 country_combo_box->SetSelectedIndex(chosen_country_index_); 203 country_combo_box->SetSelectedIndex(chosen_country_index_);
204 } 204 }
205 // Ignore temporary profile once the editor view has been updated. 205 // Ignore temporary profile once the editor view has been updated.
206 temporary_profile_.reset(nullptr); 206 temporary_profile_.reset(nullptr);
207 } 207 }
208 208
209 base::string16 ShippingAddressEditorViewController::GetSheetTitle() { 209 base::string16 ShippingAddressEditorViewController::GetSheetTitle() {
210 return l10n_util::GetStringUTF16( 210 // TODO(crbug.com/712074): Editor title should reflect the missing information
211 IDS_PAYMENT_REQUEST_ADDRESS_EDITOR_ADD_TITLE); 211 // in the case that one or more fields are missing.
212 return profile_to_edit_ ? l10n_util::GetStringUTF16(IDS_PAYMENTS_EDIT_ADDRESS)
213 : l10n_util::GetStringUTF16(
214 IDS_PAYMENT_REQUEST_ADDRESS_EDITOR_ADD_TITLE);
212 } 215 }
213 216
214 void ShippingAddressEditorViewController::UpdateEditorFields() { 217 void ShippingAddressEditorViewController::UpdateEditorFields() {
215 editor_fields_.clear(); 218 editor_fields_.clear();
216 std::string chosen_country_code; 219 std::string chosen_country_code;
217 if (chosen_country_index_ < country_codes_.size()) 220 if (chosen_country_index_ < country_codes_.size())
218 chosen_country_code = country_codes_[chosen_country_index_]; 221 chosen_country_code = country_codes_[chosen_country_index_];
219 222
220 std::unique_ptr<base::ListValue> components(new base::ListValue); 223 std::unique_ptr<base::ListValue> components(new base::ListValue);
221 std::string unused; 224 std::string unused;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 bool is_required_valid = !field_.required; 407 bool is_required_valid = !field_.required;
405 const base::string16 displayed_message = 408 const base::string16 displayed_message =
406 is_required_valid ? base::ASCIIToUTF16("") 409 is_required_valid ? base::ASCIIToUTF16("")
407 : l10n_util::GetStringUTF16( 410 : l10n_util::GetStringUTF16(
408 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); 411 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE);
409 controller_->DisplayErrorMessageForField(field_, displayed_message); 412 controller_->DisplayErrorMessageForField(field_, displayed_message);
410 return is_required_valid; 413 return is_required_valid;
411 } 414 }
412 415
413 } // namespace payments 416 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698