Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogGlue.java

Issue 14018004: [Android] Refactor NativeView to be able to use it for AutofillDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698