| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 (section == SECTION_SHIPPING && !full_wallet->shipping_address())) { | 108 (section == SECTION_SHIPPING && !full_wallet->shipping_address())) { |
| 109 return; | 109 return; |
| 110 } | 110 } |
| 111 | 111 |
| 112 base::Callback<base::string16(const AutofillType&)> get_info = | 112 base::Callback<base::string16(const AutofillType&)> get_info = |
| 113 base::Bind(&FullWallet::GetInfo, | 113 base::Bind(&FullWallet::GetInfo, |
| 114 base::Unretained(full_wallet), | 114 base::Unretained(full_wallet), |
| 115 g_browser_process->GetApplicationLocale()); | 115 g_browser_process->GetApplicationLocale()); |
| 116 | 116 |
| 117 std::vector<ServerFieldType> types = common::TypesFromInputs(inputs); | 117 std::vector<ServerFieldType> types = common::TypesFromInputs(inputs); |
| 118 form_structure.FillFields(types, | 118 form_structure.FillFields( |
| 119 compare, | 119 types, |
| 120 get_info, | 120 compare, |
| 121 g_browser_process->GetApplicationLocale()); | 121 get_info, |
| 122 section == SECTION_CC_BILLING |
| 123 ? full_wallet->billing_address()->language_code() |
| 124 : full_wallet->shipping_address()->language_code(), |
| 125 g_browser_process->GetApplicationLocale()); |
| 122 } | 126 } |
| 123 | 127 |
| 124 void FillOutputForSection( | 128 void FillOutputForSection( |
| 125 DialogSection section, | 129 DialogSection section, |
| 126 FormStructure& form_structure, | 130 FormStructure& form_structure, |
| 127 FullWallet* full_wallet, | 131 FullWallet* full_wallet, |
| 128 const base::string16& email_address) { | 132 const base::string16& email_address) { |
| 129 DCHECK(section == SECTION_CC_BILLING || section == SECTION_SHIPPING); | 133 DCHECK(section == SECTION_CC_BILLING || section == SECTION_SHIPPING); |
| 130 DetailInputs inputs; | 134 DetailInputs inputs; |
| 131 if (section == SECTION_CC_BILLING) | 135 if (section == SECTION_CC_BILLING) |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 form_structure_); | 342 form_structure_); |
| 339 | 343 |
| 340 bool request_shipping_address = false; | 344 bool request_shipping_address = false; |
| 341 { | 345 { |
| 342 DetailInputs inputs; | 346 DetailInputs inputs; |
| 343 BuildShippingInputs(&inputs); | 347 BuildShippingInputs(&inputs); |
| 344 request_shipping_address = form_structure_.FillFields( | 348 request_shipping_address = form_structure_.FillFields( |
| 345 common::TypesFromInputs(inputs), | 349 common::TypesFromInputs(inputs), |
| 346 base::Bind(common::ServerTypeMatchesField, SECTION_SHIPPING), | 350 base::Bind(common::ServerTypeMatchesField, SECTION_SHIPPING), |
| 347 base::Bind(NullGetInfo), | 351 base::Bind(NullGetInfo), |
| 352 std::string(), |
| 348 g_browser_process->GetApplicationLocale()); | 353 g_browser_process->GetApplicationLocale()); |
| 349 } | 354 } |
| 350 | 355 |
| 351 bool last_used_choice_is_autofill = false; | 356 bool last_used_choice_is_autofill = false; |
| 352 base::string16 last_used_account_name; | 357 base::string16 last_used_account_name; |
| 353 std::string last_used_billing; | 358 std::string last_used_billing; |
| 354 std::string last_used_shipping; | 359 std::string last_used_shipping; |
| 355 std::string last_used_credit_card; | 360 std::string last_used_credit_card; |
| 356 { | 361 { |
| 357 const base::DictionaryValue* defaults = | 362 const base::DictionaryValue* defaults = |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 531 |
| 527 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { | 532 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { |
| 528 GetMetricLogger().LogDialogUiDuration( | 533 GetMetricLogger().LogDialogUiDuration( |
| 529 base::Time::Now() - dialog_shown_timestamp_, | 534 base::Time::Now() - dialog_shown_timestamp_, |
| 530 AutofillMetrics::DIALOG_CANCELED); | 535 AutofillMetrics::DIALOG_CANCELED); |
| 531 | 536 |
| 532 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); | 537 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); |
| 533 } | 538 } |
| 534 | 539 |
| 535 } // namespace autofill | 540 } // namespace autofill |
| OLD | NEW |