| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return scoped_ptr<DataModelWrapper>(); | 76 return scoped_ptr<DataModelWrapper>(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void FillOutputForSectionWithComparator( | 79 void FillOutputForSectionWithComparator( |
| 80 DialogSection section, const DetailInputs& inputs, | 80 DialogSection section, const DetailInputs& inputs, |
| 81 const InputFieldComparator& compare, | 81 const InputFieldComparator& compare, |
| 82 FormStructure& form_structure, wallet::FullWallet* full_wallet, | 82 FormStructure& form_structure, wallet::FullWallet* full_wallet, |
| 83 const base::string16& email_address) { | 83 const base::string16& email_address) { |
| 84 | 84 |
| 85 // Email is hidden while using Wallet, special case it. | 85 // Email is hidden while using Wallet, special case it. |
| 86 if (section == SECTION_EMAIL) { | 86 if (section == SECTION_CC_BILLING) { |
| 87 AutofillProfile profile; | 87 AutofillProfile profile; |
| 88 profile.SetRawInfo(EMAIL_ADDRESS, email_address); | 88 profile.SetRawInfo(EMAIL_ADDRESS, email_address); |
| 89 AutofillProfileWrapper profile_wrapper(&profile, 0); | 89 AutofillProfileWrapper profile_wrapper(&profile, 0); |
| 90 profile_wrapper.FillFormStructure(inputs, compare, &form_structure); | 90 profile_wrapper.FillFormStructure(inputs, compare, &form_structure); |
| 91 return; | 91 return; |
| 92 } | 92 } |
| 93 | 93 |
| 94 scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section, full_wallet); | 94 scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section, full_wallet); |
| 95 if (wrapper) | 95 if (wrapper) |
| 96 wrapper->FillFormStructure(inputs, compare, &form_structure); | 96 wrapper->FillFormStructure(inputs, compare, &form_structure); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 const std::string last_used_billing = | 350 const std::string last_used_billing = |
| 351 base::android::ConvertJavaStringToUTF8(env, jlast_used_billing); | 351 base::android::ConvertJavaStringToUTF8(env, jlast_used_billing); |
| 352 const std::string last_used_shipping = | 352 const std::string last_used_shipping = |
| 353 base::android::ConvertJavaStringToUTF8(env, jlast_used_shipping); | 353 base::android::ConvertJavaStringToUTF8(env, jlast_used_shipping); |
| 354 const std::string last_used_card = | 354 const std::string last_used_card = |
| 355 base::android::ConvertJavaStringToUTF8(env, jlast_used_card); | 355 base::android::ConvertJavaStringToUTF8(env, jlast_used_card); |
| 356 | 356 |
| 357 scoped_ptr<wallet::FullWallet> full_wallet = | 357 scoped_ptr<wallet::FullWallet> full_wallet = |
| 358 AutofillDialogResult::ConvertFromJava(env, wallet); | 358 AutofillDialogResult::ConvertFromJava(env, wallet); |
| 359 FillOutputForSection( | 359 FillOutputForSection( |
| 360 SECTION_EMAIL, form_structure_, full_wallet.get(), email); | |
| 361 FillOutputForSection( | |
| 362 SECTION_CC_BILLING, form_structure_, full_wallet.get(), email); | 360 SECTION_CC_BILLING, form_structure_, full_wallet.get(), email); |
| 363 FillOutputForSection( | 361 FillOutputForSection( |
| 364 SECTION_SHIPPING, form_structure_, full_wallet.get(), email); | 362 SECTION_SHIPPING, form_structure_, full_wallet.get(), email); |
| 365 | 363 |
| 366 { | 364 { |
| 367 DictionaryPrefUpdate updater(profile_->GetPrefs(), | 365 DictionaryPrefUpdate updater(profile_->GetPrefs(), |
| 368 ::prefs::kAutofillDialogDefaults); | 366 ::prefs::kAutofillDialogDefaults); |
| 369 base::DictionaryValue* defaults = updater.Get(); | 367 base::DictionaryValue* defaults = updater.Get(); |
| 370 if (defaults) { | 368 if (defaults) { |
| 371 const bool last_used_choice_is_autofill = !!jlast_used_choice_is_autofill; | 369 const bool last_used_choice_is_autofill = !!jlast_used_choice_is_autofill; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 435 |
| 438 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { | 436 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { |
| 439 GetMetricLogger().LogDialogUiDuration( | 437 GetMetricLogger().LogDialogUiDuration( |
| 440 base::Time::Now() - dialog_shown_timestamp_, | 438 base::Time::Now() - dialog_shown_timestamp_, |
| 441 AutofillMetrics::DIALOG_CANCELED); | 439 AutofillMetrics::DIALOG_CANCELED); |
| 442 | 440 |
| 443 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); | 441 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); |
| 444 } | 442 } |
| 445 | 443 |
| 446 } // namespace autofill | 444 } // namespace autofill |
| OLD | NEW |