Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.content.Context; | |
| 8 | |
| 7 import org.chromium.base.CalledByNative; | 9 import org.chromium.base.CalledByNative; |
| 8 import org.chromium.base.JNINamespace; | 10 import org.chromium.base.JNINamespace; |
| 9 import org.chromium.ui.ViewAndroid; | 11 import org.chromium.ui.ViewAndroid; |
| 10 import org.chromium.ui.ViewAndroidDelegate; | 12 import org.chromium.ui.ViewAndroidDelegate; |
| 11 import org.chromium.ui.WindowAndroid; | 13 import org.chromium.ui.WindowAndroid; |
| 12 import org.chromium.ui.autofill.AutofillPopup; | 14 import org.chromium.ui.autofill.AutofillPopup; |
| 13 import org.chromium.ui.autofill.AutofillPopup.AutofillPopupDelegate; | 15 import org.chromium.ui.autofill.AutofillPopup.AutofillPopupDelegate; |
| 14 import org.chromium.ui.autofill.AutofillSuggestion; | 16 import org.chromium.ui.autofill.AutofillSuggestion; |
| 15 | 17 |
| 16 /** | 18 /** |
| 17 * JNI call glue for AutofillExternalDelagate C++ and Java objects. | 19 * JNI call glue for AutofillExternalDelagate C++ and Java objects. |
| 18 */ | 20 */ |
| 19 @JNINamespace("autofill") | 21 @JNINamespace("autofill") |
| 20 public class AutofillPopupGlue implements AutofillPopupDelegate{ | 22 public class AutofillPopupGlue implements AutofillPopupDelegate{ |
| 21 private final int mNativeAutofillPopup; | 23 private final int mNativeAutofillPopup; |
| 22 private final AutofillPopup mAutofillPopup; | 24 private final AutofillPopup mAutofillPopup; |
| 23 | 25 |
| 24 public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid w indowAndroid, | 26 public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid w indowAndroid, |
| 25 ViewAndroidDelegate containerViewDelegate) { | 27 ViewAndroidDelegate containerViewDelegate) { |
| 26 mNativeAutofillPopup = nativeAutofillPopupViewAndroid; | 28 mNativeAutofillPopup = nativeAutofillPopupViewAndroid; |
| 27 mAutofillPopup = new AutofillPopup(windowAndroid.getContext(), container ViewDelegate, this); | 29 Context context = windowAndroid.getContext(); |
| 30 assert context != null; | |
| 31 mAutofillPopup = new AutofillPopup(context, containerViewDelegate, this) ; | |
|
joth
2013/11/01 18:45:01
Is the edit in this file really needed? You're goi
michaelbai
2013/11/01 21:27:05
I am planing to remove this deprecated method comp
| |
| 28 } | 32 } |
| 29 | 33 |
| 30 @CalledByNative | 34 @CalledByNative |
| 31 private static AutofillPopupGlue create(int nativeAutofillPopupViewAndroid, | 35 private static AutofillPopupGlue create(int nativeAutofillPopupViewAndroid, |
| 32 WindowAndroid windowAndroid, ViewAndroid viewAndroid) { | 36 WindowAndroid windowAndroid, ViewAndroid viewAndroid) { |
| 33 return new AutofillPopupGlue(nativeAutofillPopupViewAndroid, windowAndro id, | 37 return new AutofillPopupGlue(nativeAutofillPopupViewAndroid, windowAndro id, |
| 34 viewAndroid.getViewAndroidDelegate()); | 38 viewAndroid.getViewAndroidDelegate()); |
| 35 } | 39 } |
| 36 | 40 |
| 37 @Override | 41 @Override |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 @CalledByNative | 94 @CalledByNative |
| 91 private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, | 95 private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, |
| 92 String label, String sublabel, int uniqueId) { | 96 String label, String sublabel, int uniqueId) { |
| 93 array[index] = new AutofillSuggestion(label, sublabel, uniqueId); | 97 array[index] = new AutofillSuggestion(label, sublabel, uniqueId); |
| 94 } | 98 } |
| 95 | 99 |
| 96 private native void nativeRequestHide(int nativeAutofillPopupViewAndroid); | 100 private native void nativeRequestHide(int nativeAutofillPopupViewAndroid); |
| 97 private native void nativeSuggestionSelected(int nativeAutofillPopupViewAndr oid, | 101 private native void nativeSuggestionSelected(int nativeAutofillPopupViewAndr oid, |
| 98 int listIndex); | 102 int listIndex); |
| 99 } | 103 } |
| OLD | NEW |