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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 get_info, | 84 get_info, |
85 g_browser_process->GetApplicationLocale()); | 85 g_browser_process->GetApplicationLocale()); |
86 } | 86 } |
87 | 87 |
88 void FillOutputForSection( | 88 void FillOutputForSection( |
89 DialogSection section, | 89 DialogSection section, |
90 FormStructure& form_structure, | 90 FormStructure& form_structure, |
91 FullWallet* full_wallet, | 91 FullWallet* full_wallet, |
92 const base::string16& email_address) { | 92 const base::string16& email_address) { |
93 DetailInputs inputs; | 93 DetailInputs inputs; |
94 common::BuildInputsForSection(section, "US", &inputs); | 94 common::BuildInputsForSection(section, "US", &inputs, NULL); |
95 | 95 |
96 FillOutputForSectionWithComparator( | 96 FillOutputForSectionWithComparator( |
97 section, inputs, | 97 section, inputs, |
98 base::Bind(common::ServerTypeMatchesField, section), | 98 base::Bind(common::ServerTypeMatchesField, section), |
99 form_structure, full_wallet, email_address); | 99 form_structure, full_wallet, email_address); |
100 | 100 |
101 if (section == SECTION_CC_BILLING) { | 101 if (section == SECTION_CC_BILLING) { |
102 // Email is hidden while using Wallet, special case it. | 102 // Email is hidden while using Wallet, special case it. |
103 for (size_t i = 0; i < form_structure.field_count(); ++i) { | 103 for (size_t i = 0; i < form_structure.field_count(); ++i) { |
104 AutofillField* field = form_structure.field(i); | 104 AutofillField* field = form_structure.field(i); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 PHONE_BILLING_WHOLE_NUMBER, | 241 PHONE_BILLING_WHOLE_NUMBER, |
242 form_structure_) || | 242 form_structure_) || |
243 IsSectionInputUsedInFormStructure( | 243 IsSectionInputUsedInFormStructure( |
244 SECTION_SHIPPING, | 244 SECTION_SHIPPING, |
245 PHONE_HOME_WHOLE_NUMBER, | 245 PHONE_HOME_WHOLE_NUMBER, |
246 form_structure_); | 246 form_structure_); |
247 | 247 |
248 bool request_shipping_address = false; | 248 bool request_shipping_address = false; |
249 { | 249 { |
250 DetailInputs inputs; | 250 DetailInputs inputs; |
251 common::BuildInputsForSection(SECTION_SHIPPING, "US", &inputs); | 251 common::BuildInputsForSection(SECTION_SHIPPING, "US", &inputs, NULL); |
252 request_shipping_address = form_structure_.FillFields( | 252 request_shipping_address = form_structure_.FillFields( |
253 common::TypesFromInputs(inputs), | 253 common::TypesFromInputs(inputs), |
254 base::Bind(common::ServerTypeMatchesField, SECTION_SHIPPING), | 254 base::Bind(common::ServerTypeMatchesField, SECTION_SHIPPING), |
255 base::Bind(NullGetInfo), | 255 base::Bind(NullGetInfo), |
256 g_browser_process->GetApplicationLocale()); | 256 g_browser_process->GetApplicationLocale()); |
257 } | 257 } |
258 | 258 |
259 const bool incognito_mode = profile_->IsOffTheRecord(); | 259 const bool incognito_mode = profile_->IsOffTheRecord(); |
260 | 260 |
261 bool last_used_choice_is_autofill = false; | 261 bool last_used_choice_is_autofill = false; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { | 415 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { |
416 GetMetricLogger().LogDialogUiDuration( | 416 GetMetricLogger().LogDialogUiDuration( |
417 base::Time::Now() - dialog_shown_timestamp_, | 417 base::Time::Now() - dialog_shown_timestamp_, |
418 AutofillMetrics::DIALOG_CANCELED); | 418 AutofillMetrics::DIALOG_CANCELED); |
419 | 419 |
420 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); | 420 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); |
421 } | 421 } |
422 | 422 |
423 } // namespace autofill | 423 } // namespace autofill |
OLD | NEW |