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

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: else 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..51b4006414a2055ce578ae7428f333fecb871596 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_HOME_COUNTRY);
Dan Beam 2014/02/08 03:43:09 ^ did you mean ADDRESS_BILLING_COUNTRY?
Evan Stade 2014/02/10 19:07:31 probably
+ 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;
@@ -265,8 +275,7 @@ AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent(
base::string16 GetHardcodedValueForType(ServerFieldType type) {
// TODO(dbeam): remove this entire function when i18n inputs are the default.
- if (IsI18nInputEnabled())
- return base::string16();
+ DCHECK(!IsI18nInputEnabled());
if (AutofillType(type).GetStorableType() == ADDRESS_HOME_COUNTRY) {
AutofillCountry country("US", g_browser_process->GetApplicationLocale());
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698