| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_view_android.h" | 5 #include "chrome/browser/ui/android/autofill/autofill_dialog_view_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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 env, java_object_.obj(), | 251 env, java_object_.obj(), |
| 252 controller_->ShouldShowSpinner()); | 252 controller_->ShouldShowSpinner()); |
| 253 UpdateSection(SECTION_EMAIL); | 253 UpdateSection(SECTION_EMAIL); |
| 254 UpdateSection(SECTION_CC); | 254 UpdateSection(SECTION_CC); |
| 255 UpdateSection(SECTION_BILLING); | 255 UpdateSection(SECTION_BILLING); |
| 256 UpdateSection(SECTION_CC_BILLING); | 256 UpdateSection(SECTION_CC_BILLING); |
| 257 UpdateSection(SECTION_SHIPPING); | 257 UpdateSection(SECTION_SHIPPING); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void AutofillDialogViewAndroid::SubmitForTesting() { | 260 void AutofillDialogViewAndroid::SubmitForTesting() { |
| 261 controller_->OnSubmit(); | 261 controller_->OnAccept(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void AutofillDialogViewAndroid::CancelForTesting() { | 264 void AutofillDialogViewAndroid::CancelForTesting() { |
| 265 controller_->OnCancel(); | 265 controller_->OnCancel(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 // TODO(aruslan): bind to the list of accounts population. | 268 // TODO(aruslan): bind to the list of accounts population. |
| 269 std::vector<std::string> AutofillDialogViewAndroid::GetAvailableUserAccounts() { | 269 std::vector<std::string> AutofillDialogViewAndroid::GetAvailableUserAccounts() { |
| 270 std::vector<std::string> account_names; | 270 std::vector<std::string> account_names; |
| 271 JNIEnv* env = base::android::AttachCurrentThread(); | 271 JNIEnv* env = base::android::AttachCurrentThread(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // TODO(aruslan): http://crbug.com/188844 We still need to validate the data. | 305 // TODO(aruslan): http://crbug.com/188844 We still need to validate the data. |
| 306 } | 306 } |
| 307 | 307 |
| 308 void AutofillDialogViewAndroid::EditingCancel(JNIEnv* env, jobject obj, | 308 void AutofillDialogViewAndroid::EditingCancel(JNIEnv* env, jobject obj, |
| 309 jint section) { | 309 jint section) { |
| 310 controller_->EditCancelledForSection(static_cast<DialogSection>(section)); | 310 controller_->EditCancelledForSection(static_cast<DialogSection>(section)); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void AutofillDialogViewAndroid::DialogSubmit(JNIEnv* env, jobject obj) { | 313 void AutofillDialogViewAndroid::DialogSubmit(JNIEnv* env, jobject obj) { |
| 314 // TODO(aurimas): add validation step. | 314 // TODO(aurimas): add validation step. |
| 315 controller_->OnSubmit(); | 315 controller_->OnAccept(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void AutofillDialogViewAndroid::DialogCancel(JNIEnv* env, jobject obj) { | 318 void AutofillDialogViewAndroid::DialogCancel(JNIEnv* env, jobject obj) { |
| 319 controller_->OnCancel(); | 319 controller_->OnCancel(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 ScopedJavaLocalRef<jstring> AutofillDialogViewAndroid::GetLabelForSection( | 322 ScopedJavaLocalRef<jstring> AutofillDialogViewAndroid::GetLabelForSection( |
| 323 JNIEnv* env, | 323 JNIEnv* env, |
| 324 jobject obj, | 324 jobject obj, |
| 325 jint section) { | 325 jint section) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 340 // TODO(aruslan): bind to the automatic sign-in. | 340 // TODO(aruslan): bind to the automatic sign-in. |
| 341 // controller_->ContinueAutomaticSignIn(account_name, sid, lsid); | 341 // controller_->ContinueAutomaticSignIn(account_name, sid, lsid); |
| 342 } | 342 } |
| 343 | 343 |
| 344 // static | 344 // static |
| 345 bool AutofillDialogViewAndroid::RegisterAutofillDialogViewAndroid(JNIEnv* env) { | 345 bool AutofillDialogViewAndroid::RegisterAutofillDialogViewAndroid(JNIEnv* env) { |
| 346 return RegisterNativesImpl(env); | 346 return RegisterNativesImpl(env); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace autofill | 349 } // namespace autofill |
| OLD | NEW |