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 #include "base/android/jni_android.h" | 6 #include "base/android/jni_android.h" |
7 #include "base/android/jni_array.h" | 7 #include "base/android/jni_array.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ScopedJavaLocalRef<jobjectArray> jaccount_names = | 97 ScopedJavaLocalRef<jobjectArray> jaccount_names = |
98 base::android::ToJavaArrayOfStrings(env, account_names); | 98 base::android::ToJavaArrayOfStrings(env, account_names); |
99 Java_AutofillDialogGlue_updateAccountChooser( | 99 Java_AutofillDialogGlue_updateAccountChooser( |
100 env, java_object_.obj(), jaccount_names.obj(), selected_account_index); | 100 env, java_object_.obj(), jaccount_names.obj(), selected_account_index); |
101 } | 101 } |
102 | 102 |
103 void AutofillDialogViewAndroid::UpdateButtonStrip() { | 103 void AutofillDialogViewAndroid::UpdateButtonStrip() { |
104 NOTIMPLEMENTED(); | 104 NOTIMPLEMENTED(); |
105 } | 105 } |
106 | 106 |
107 void AutofillDialogViewAndroid::UpdateSection(DialogSection section) { | 107 void AutofillDialogViewAndroid::UpdateSection(DialogSection section, |
| 108 UserInputAction action) { |
| 109 // TODO(estade): respect |action|. |
| 110 |
108 JNIEnv* env = base::android::AttachCurrentThread(); | 111 JNIEnv* env = base::android::AttachCurrentThread(); |
109 const DetailInputs& updated_inputs = | 112 const DetailInputs& updated_inputs = |
110 controller_->RequestedFieldsForSection(section); | 113 controller_->RequestedFieldsForSection(section); |
111 | 114 |
112 const size_t inputCount = updated_inputs.size(); | 115 const size_t inputCount = updated_inputs.size(); |
113 ScopedJavaLocalRef<jobjectArray> field_array = | 116 ScopedJavaLocalRef<jobjectArray> field_array = |
114 Java_AutofillDialogGlue_createAutofillDialogFieldArray( | 117 Java_AutofillDialogGlue_createAutofillDialogFieldArray( |
115 env, inputCount); | 118 env, inputCount); |
116 | 119 |
117 for (size_t i = 0; i < inputCount; ++i) { | 120 for (size_t i = 0; i < inputCount; ++i) { |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 env, error_array.obj(), i, invalid_inputs[i], error_text.obj()); | 446 env, error_array.obj(), i, invalid_inputs[i], error_text.obj()); |
444 } | 447 } |
445 Java_AutofillDialogGlue_updateSectionErrors(env, | 448 Java_AutofillDialogGlue_updateSectionErrors(env, |
446 java_object_.obj(), | 449 java_object_.obj(), |
447 section, | 450 section, |
448 error_array.obj()); | 451 error_array.obj()); |
449 return false; | 452 return false; |
450 } | 453 } |
451 | 454 |
452 } // namespace autofill | 455 } // namespace autofill |
OLD | NEW |