OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 | 9 |
10 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
11 import org.chromium.base.JNINamespace; | 11 import org.chromium.base.JNINamespace; |
| 12 import org.chromium.chrome.browser.ResourceId; |
12 import org.chromium.ui.autofill.AutofillPopup; | 13 import org.chromium.ui.autofill.AutofillPopup; |
13 import org.chromium.ui.autofill.AutofillPopup.AutofillPopupDelegate; | 14 import org.chromium.ui.autofill.AutofillPopup.AutofillPopupDelegate; |
14 import org.chromium.ui.autofill.AutofillSuggestion; | 15 import org.chromium.ui.autofill.AutofillSuggestion; |
15 import org.chromium.ui.base.ViewAndroid; | 16 import org.chromium.ui.base.ViewAndroid; |
16 import org.chromium.ui.base.ViewAndroidDelegate; | 17 import org.chromium.ui.base.ViewAndroidDelegate; |
17 import org.chromium.ui.base.WindowAndroid; | 18 import org.chromium.ui.base.WindowAndroid; |
18 | 19 |
19 /** | 20 /** |
20 * JNI call glue for AutofillExternalDelagate C++ and Java objects. | 21 * JNI call glue for AutofillExternalDelagate C++ and Java objects. |
21 */ | 22 */ |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 99 |
99 /** | 100 /** |
100 * @param array AutofillSuggestion array that should get a new suggestion ad
ded. | 101 * @param array AutofillSuggestion array that should get a new suggestion ad
ded. |
101 * @param index Index in the array where to place a new suggestion. | 102 * @param index Index in the array where to place a new suggestion. |
102 * @param label First line of the suggestion. | 103 * @param label First line of the suggestion. |
103 * @param sublabel Second line of the suggestion. | 104 * @param sublabel Second line of the suggestion. |
104 * @param uniqueId Unique suggestion id. | 105 * @param uniqueId Unique suggestion id. |
105 */ | 106 */ |
106 @CalledByNative | 107 @CalledByNative |
107 private static void addToAutofillSuggestionArray(AutofillSuggestion[] array,
int index, | 108 private static void addToAutofillSuggestionArray(AutofillSuggestion[] array,
int index, |
108 String label, String sublabel, int uniqueId) { | 109 String label, String sublabel, int iconId, int suggestionId) { |
109 array[index] = new AutofillSuggestion(label, sublabel, uniqueId); | 110 int drawableId = iconId == 0 ? 0 : ResourceId.mapToDrawableId(iconId); |
| 111 array[index] = new AutofillSuggestion(label, sublabel, drawableId, sugge
stionId); |
110 } | 112 } |
111 | 113 |
112 private native void nativePopupDismissed(long nativeAutofillPopupViewAndroid
); | 114 private native void nativePopupDismissed(long nativeAutofillPopupViewAndroid
); |
113 private native void nativeSuggestionSelected(long nativeAutofillPopupViewAnd
roid, | 115 private native void nativeSuggestionSelected(long nativeAutofillPopupViewAnd
roid, |
114 int listIndex); | 116 int listIndex); |
115 } | 117 } |
OLD | NEW |