| 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 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
| 6 | 6 |
| 7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
| 8 | 8 |
| 9 import org.chromium.base.CalledByNative; | 9 import org.chromium.base.CalledByNative; |
| 10 import org.chromium.base.JNINamespace; | 10 import org.chromium.base.JNINamespace; |
| 11 import org.chromium.chrome.browser.autofill.AutofillDialog.AutofillDialogDelegat
e; | 11 import org.chromium.chrome.browser.autofill.AutofillDialog.AutofillDialogDelegat
e; |
| 12 import org.chromium.ui.WindowAndroid; | 12 import org.chromium.ui.WindowAndroid; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * JNI call glue for AutofillDialog C++ and Java objects. | 15 * JNI call glue for AutofillDialog C++ and Java objects. |
| 16 */ | 16 */ |
| 17 @JNINamespace("autofill") | 17 @JNINamespace("autofill") |
| 18 public class AutofillDialogGlue implements AutofillDialogDelegate, | 18 public class AutofillDialogGlue implements AutofillDialogDelegate, |
| 19 AutofillDialogAccountHelper.SignInContinuation { | 19 AutofillDialogAccountHelper.SignInContinuation { |
| 20 @SuppressWarnings("unused") | 20 @SuppressWarnings("unused") |
| 21 private final int mNativeDialogPopup; | 21 private final int mNativeDialogPopup; |
| 22 private final AutofillDialog mAutofillDialog; | 22 private final AutofillDialog mAutofillDialog; |
| 23 private final AutofillDialogAccountHelper mAccountHelper; | 23 private final AutofillDialogAccountHelper mAccountHelper; |
| 24 | 24 |
| 25 public AutofillDialogGlue(int nativeAutofillDialogViewAndroid, WindowAndroid
nativeWindow, | 25 public AutofillDialogGlue(int nativeAutofillDialogViewAndroid, WindowAndroid
windowAndroid, |
| 26 String saveLocallyText) { | 26 String saveLocallyText) { |
| 27 mNativeDialogPopup = nativeAutofillDialogViewAndroid; | 27 mNativeDialogPopup = nativeAutofillDialogViewAndroid; |
| 28 mAccountHelper = new AutofillDialogAccountHelper(this, nativeWindow.getC
ontext()); | 28 mAccountHelper = new AutofillDialogAccountHelper(this, windowAndroid.get
Context()); |
| 29 | 29 |
| 30 mAutofillDialog = new AutofillDialog(nativeWindow.getContext(), this, sa
veLocallyText); | 30 mAutofillDialog = new AutofillDialog(windowAndroid.getContext(), this, s
aveLocallyText); |
| 31 mAutofillDialog.show(); | 31 mAutofillDialog.show(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 @CalledByNative | 34 @CalledByNative |
| 35 private static AutofillDialogGlue create(int nativeAutofillDialogViewAndroid
, | 35 private static AutofillDialogGlue create(int nativeAutofillDialogViewAndroid
, |
| 36 WindowAndroid nativeWindow, | 36 WindowAndroid windowAndroid, |
| 37 String saveLocallyText) { | 37 String saveLocallyText) { |
| 38 return new AutofillDialogGlue(nativeAutofillDialogViewAndroid, nativeWin
dow, | 38 return new AutofillDialogGlue(nativeAutofillDialogViewAndroid, windowAnd
roid, |
| 39 saveLocallyText); | 39 saveLocallyText); |
| 40 } | 40 } |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * @see AutofillDialog#updateNotificationArea(AutofillDialogNotification[]) | 43 * @see AutofillDialog#updateNotificationArea(AutofillDialogNotification[]) |
| 44 */ | 44 */ |
| 45 @CalledByNative | 45 @CalledByNative |
| 46 private void updateNotificationArea(AutofillDialogNotification[] notificatio
ns) { | 46 private void updateNotificationArea(AutofillDialogNotification[] notificatio
ns) { |
| 47 mAutofillDialog.updateNotificationArea(notifications); | 47 mAutofillDialog.updateNotificationArea(notifications); |
| 48 } | 48 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 private native void nativeDialogSubmit(int nativeAutofillDialogViewAndroid); | 300 private native void nativeDialogSubmit(int nativeAutofillDialogViewAndroid); |
| 301 private native void nativeDialogCancel(int nativeAutofillDialogViewAndroid); | 301 private native void nativeDialogCancel(int nativeAutofillDialogViewAndroid); |
| 302 private native String nativeGetLabelForSection(int nativeAutofillDialogViewA
ndroid, | 302 private native String nativeGetLabelForSection(int nativeAutofillDialogViewA
ndroid, |
| 303 int section); | 303 int section); |
| 304 private native String[] nativeGetListForField(int nativeAutofillDialogViewAn
droid, int field); | 304 private native String[] nativeGetListForField(int nativeAutofillDialogViewAn
droid, int field); |
| 305 private native Bitmap nativeGetIconForField(int nativeAutofillDialogViewAndr
oid, | 305 private native Bitmap nativeGetIconForField(int nativeAutofillDialogViewAndr
oid, |
| 306 int fieldType, String input); | 306 int fieldType, String input); |
| 307 private native String nativeGetPlaceholderForField(int nativeAutofillDialogV
iewAndroid, | 307 private native String nativeGetPlaceholderForField(int nativeAutofillDialogV
iewAndroid, |
| 308 int section, int fieldType); | 308 int section, int fieldType); |
| 309 } | 309 } |
| OLD | NEW |