| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 void AutofillDialogControllerAndroid::TabActivated() {} | 423 void AutofillDialogControllerAndroid::TabActivated() {} |
| 424 | 424 |
| 425 // static | 425 // static |
| 426 bool AutofillDialogControllerAndroid:: | 426 bool AutofillDialogControllerAndroid:: |
| 427 RegisterAutofillDialogControllerAndroid(JNIEnv* env) { | 427 RegisterAutofillDialogControllerAndroid(JNIEnv* env) { |
| 428 return RegisterNativesImpl(env); | 428 return RegisterNativesImpl(env); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void AutofillDialogControllerAndroid::DialogCancel(JNIEnv* env, | 431 void AutofillDialogControllerAndroid::DialogCancel( |
| 432 jobject obj) { | 432 JNIEnv* env, |
| 433 const JavaParamRef<jobject>& obj) { |
| 433 LogOnCancelMetrics(); | 434 LogOnCancelMetrics(); |
| 434 callback_.Run(AutofillClient::AutocompleteResultErrorCancel, | 435 callback_.Run(AutofillClient::AutocompleteResultErrorCancel, |
| 435 base::string16(), | 436 base::string16(), |
| 436 NULL); | 437 NULL); |
| 437 } | 438 } |
| 438 | 439 |
| 439 void AutofillDialogControllerAndroid::DialogContinue( | 440 void AutofillDialogControllerAndroid::DialogContinue( |
| 440 JNIEnv* env, | 441 JNIEnv* env, |
| 441 jobject obj, | 442 const JavaParamRef<jobject>& obj, |
| 442 jobject wallet, | 443 const JavaParamRef<jobject>& wallet, |
| 443 jboolean jlast_used_choice_is_autofill, | 444 jboolean jlast_used_choice_is_autofill, |
| 444 jstring jlast_used_account_name, | 445 const JavaParamRef<jstring>& jlast_used_account_name, |
| 445 jstring jlast_used_billing, | 446 const JavaParamRef<jstring>& jlast_used_billing, |
| 446 jstring jlast_used_shipping, | 447 const JavaParamRef<jstring>& jlast_used_shipping, |
| 447 jstring jlast_used_card) { | 448 const JavaParamRef<jstring>& jlast_used_card) { |
| 448 const base::string16 email = | 449 const base::string16 email = |
| 449 AutofillDialogResult::GetWalletEmail(env, wallet); | 450 AutofillDialogResult::GetWalletEmail(env, wallet); |
| 450 const std::string google_transaction_id = | 451 const std::string google_transaction_id = |
| 451 AutofillDialogResult::GetWalletGoogleTransactionId(env, wallet); | 452 AutofillDialogResult::GetWalletGoogleTransactionId(env, wallet); |
| 452 | 453 |
| 453 const base::string16 last_used_account_name = | 454 const base::string16 last_used_account_name = |
| 454 base::android::ConvertJavaStringToUTF16(env, jlast_used_account_name); | 455 base::android::ConvertJavaStringToUTF16(env, jlast_used_account_name); |
| 455 const std::string last_used_billing = | 456 const std::string last_used_billing = |
| 456 base::android::ConvertJavaStringToUTF8(env, jlast_used_billing); | 457 base::android::ConvertJavaStringToUTF8(env, jlast_used_billing); |
| 457 const std::string last_used_shipping = | 458 const std::string last_used_shipping = |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 526 |
| 526 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { | 527 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { |
| 527 AutofillMetrics::LogDialogUiDuration( | 528 AutofillMetrics::LogDialogUiDuration( |
| 528 base::Time::Now() - dialog_shown_timestamp_, | 529 base::Time::Now() - dialog_shown_timestamp_, |
| 529 AutofillMetrics::DIALOG_CANCELED); | 530 AutofillMetrics::DIALOG_CANCELED); |
| 530 | 531 |
| 531 AutofillMetrics::LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); | 532 AutofillMetrics::LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); |
| 532 } | 533 } |
| 533 | 534 |
| 534 } // namespace autofill | 535 } // namespace autofill |
| OLD | NEW |