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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_common.cc

Issue 157093002: rAc - hardcode wallet billing address to US in i18n mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests find bugs, me fix bugs, tests have bugs, me fix tests Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_dialog_common.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_common.cc b/chrome/browser/ui/autofill/autofill_dialog_common.cc
index 0c4ef13ecee695e701b7023c790066d4be274e65..6da5516e90b6b12319afd2ec0c4bbb68646ef73e 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_common.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_common.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/autofill/autofill_dialog_common.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "components/autofill/core/browser/autofill_country.h"
#include "components/autofill/core/browser/autofill_field.h"
@@ -203,10 +204,19 @@ void BuildInputsForSection(DialogSection dialog_section,
case SECTION_CC_BILLING:
BuildInputs(kCCInputs, arraysize(kCCInputs), inputs);
- if (IsI18nInputEnabled())
- BuildI18nAddressInputs(ADDRESS_TYPE_BILLING, country_code, inputs);
- else
+ if (IsI18nInputEnabled()) {
+ // Wallet only supports US billing addresses.
+ const std::string hardcoded_country_code = "US";
+ BuildI18nAddressInputs(ADDRESS_TYPE_BILLING,
+ hardcoded_country_code,
+ inputs);
+ DCHECK_EQ(inputs->back().type, ADDRESS_BILLING_COUNTRY);
+ inputs->back().length = DetailInput::NONE;
+ inputs->back().initial_value =
+ base::ASCIIToUTF16(hardcoded_country_code);
+ } else {
BuildInputs(kBillingInputs, arraysize(kBillingInputs), inputs);
+ }
BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), inputs);
break;

Powered by Google App Engine
This is Rietveld 408576698