OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/autofill/autofill_dialog_controller_android.
h" | 5 #include "chrome/browser/ui/android/autofill/autofill_dialog_controller_android.
h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (wrapper) | 85 if (wrapper) |
86 wrapper->FillFormStructure(inputs, compare, &form_structure); | 86 wrapper->FillFormStructure(inputs, compare, &form_structure); |
87 } | 87 } |
88 | 88 |
89 void FillOutputForSection( | 89 void FillOutputForSection( |
90 DialogSection section, | 90 DialogSection section, |
91 FormStructure& form_structure, | 91 FormStructure& form_structure, |
92 wallet::FullWallet* full_wallet, | 92 wallet::FullWallet* full_wallet, |
93 const base::string16& email_address) { | 93 const base::string16& email_address) { |
94 DetailInputs inputs; | 94 DetailInputs inputs; |
95 common::BuildInputsForSection(section, &inputs); | 95 common::BuildInputsForSection(section, "US", &inputs); |
96 | 96 |
97 FillOutputForSectionWithComparator( | 97 FillOutputForSectionWithComparator( |
98 section, inputs, | 98 section, inputs, |
99 base::Bind(common::DetailInputMatchesField, section), | 99 base::Bind(common::DetailInputMatchesField, section), |
100 form_structure, full_wallet, email_address); | 100 form_structure, full_wallet, email_address); |
101 | 101 |
102 if (section == SECTION_CC_BILLING) { | 102 if (section == SECTION_CC_BILLING) { |
103 // Email is hidden while using Wallet, special case it. | 103 // Email is hidden while using Wallet, special case it. |
104 for (size_t i = 0; i < form_structure.field_count(); ++i) { | 104 for (size_t i = 0; i < form_structure.field_count(); ++i) { |
105 AutofillField* field = form_structure.field(i); | 105 AutofillField* field = form_structure.field(i); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 PHONE_BILLING_WHOLE_NUMBER, | 243 PHONE_BILLING_WHOLE_NUMBER, |
244 form_structure_) || | 244 form_structure_) || |
245 IsSectionInputUsedInFormStructure( | 245 IsSectionInputUsedInFormStructure( |
246 SECTION_SHIPPING, | 246 SECTION_SHIPPING, |
247 PHONE_HOME_WHOLE_NUMBER, | 247 PHONE_HOME_WHOLE_NUMBER, |
248 form_structure_); | 248 form_structure_); |
249 | 249 |
250 bool request_shipping_address = false; | 250 bool request_shipping_address = false; |
251 { | 251 { |
252 DetailInputs inputs; | 252 DetailInputs inputs; |
253 common::BuildInputsForSection(SECTION_SHIPPING, &inputs); | 253 common::BuildInputsForSection(SECTION_SHIPPING, "US", &inputs); |
254 EmptyDataModelWrapper empty_wrapper; | 254 EmptyDataModelWrapper empty_wrapper; |
255 request_shipping_address = empty_wrapper.FillFormStructure( | 255 request_shipping_address = empty_wrapper.FillFormStructure( |
256 inputs, | 256 inputs, |
257 base::Bind(common::DetailInputMatchesField, SECTION_SHIPPING), | 257 base::Bind(common::DetailInputMatchesField, SECTION_SHIPPING), |
258 &form_structure_); | 258 &form_structure_); |
259 } | 259 } |
260 | 260 |
261 const bool incognito_mode = profile_->IsOffTheRecord(); | 261 const bool incognito_mode = profile_->IsOffTheRecord(); |
262 | 262 |
263 bool last_used_choice_is_autofill = false; | 263 bool last_used_choice_is_autofill = false; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { | 417 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { |
418 GetMetricLogger().LogDialogUiDuration( | 418 GetMetricLogger().LogDialogUiDuration( |
419 base::Time::Now() - dialog_shown_timestamp_, | 419 base::Time::Now() - dialog_shown_timestamp_, |
420 AutofillMetrics::DIALOG_CANCELED); | 420 AutofillMetrics::DIALOG_CANCELED); |
421 | 421 |
422 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); | 422 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); |
423 } | 423 } |
424 | 424 |
425 } // namespace autofill | 425 } // namespace autofill |
OLD | NEW |