diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 22:00:30 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 22:00:30 +0000 |
commit | 456671a07d53630e53a80b1abbb019f3fac5f6f7 (patch) | |
tree | 79f8ee3874cd8d854c3c9c75824415a13f34bc2e /android_webview/java | |
parent | c02f79da5f0b86bdef6a4104021e77ed77acc1b5 (diff) | |
download | chromium_src-456671a07d53630e53a80b1abbb019f3fac5f6f7.zip chromium_src-456671a07d53630e53a80b1abbb019f3fac5f6f7.tar.gz chromium_src-456671a07d53630e53a80b1abbb019f3fac5f6f7.tar.bz2 |
Revert "Implement the autofill UI for chromium powered android webview."
This reverts r208986
Review URL: https://codereview.chromium.org/18121004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/java')
-rw-r--r-- | android_webview/java/src/org/chromium/android_webview/AwAutofillManagerDelegate.java | 123 | ||||
-rw-r--r-- | android_webview/java/src/org/chromium/android_webview/AwContents.java | 16 |
2 files changed, 0 insertions, 139 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwAutofillManagerDelegate.java b/android_webview/java/src/org/chromium/android_webview/AwAutofillManagerDelegate.java deleted file mode 100644 index c526e58..0000000 --- a/android_webview/java/src/org/chromium/android_webview/AwAutofillManagerDelegate.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.android_webview; - -import android.content.Context; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AbsoluteLayout; - -import org.chromium.base.CalledByNative; -import org.chromium.base.JNINamespace; -import org.chromium.content.browser.ContentViewCore; -import org.chromium.ui.ViewAndroidDelegate; -import org.chromium.ui.autofill.AutofillPopup; -import org.chromium.ui.autofill.AutofillSuggestion; - -// Java counterpart to the AwAutofillManagerDelegate. This class is owned by -// AwContents and has a weak reference from native side. -@JNINamespace("android_webview") -public class AwAutofillManagerDelegate { - - private final int mNativeAwAutofillManagerDelegate; - private AutofillPopup mAutofillPopup; - private ViewGroup mContainerView; - private double mDIPScale; - private ContentViewCore mContentViewCore; - - @CalledByNative - public static AwAutofillManagerDelegate create(int nativeDelegate) { - return new AwAutofillManagerDelegate(nativeDelegate); - } - - private AwAutofillManagerDelegate(int nativeAwAutofillManagerDelegate) { - mNativeAwAutofillManagerDelegate = nativeAwAutofillManagerDelegate; - } - - public void init(ContentViewCore contentViewCore, double DIPScale) { - mContentViewCore = contentViewCore; - mContainerView = contentViewCore.getContainerView(); - mDIPScale = DIPScale; - } - - @CalledByNative - private void showAutofillPopup(float x, float y, float width, float height, - AutofillSuggestion[] suggestions) { - - if (mContentViewCore == null) return; - - if (mAutofillPopup == null) { - mAutofillPopup = new AutofillPopup( - mContentViewCore.getContext(), - getViewAndroidDelegate(), - new AutofillPopup.AutofillPopupDelegate() { - public void requestHide() { } - public void suggestionSelected(int listIndex) { - nativeSuggestionSelected(mNativeAwAutofillManagerDelegate, listIndex); - } - }); - } - mAutofillPopup.setAnchorRect(x, y, width, height); - mAutofillPopup.show(suggestions); - } - - @CalledByNative - public void hideAutofillPopup() { - if (mAutofillPopup == null) - return; - mAutofillPopup.hide(); - mAutofillPopup = null; - } - - private ViewAndroidDelegate getViewAndroidDelegate() { - return new ViewAndroidDelegate() { - @Override - public View acquireAnchorView() { - View anchorView = new View(mContentViewCore.getContext()); - mContainerView.addView(anchorView); - return anchorView; - } - - @Override - public void setAnchorViewPosition( - View view, float x, float y, float width, float height) { - assert(view.getParent() == mContainerView); - - int leftMargin = (int)Math.round(x * mDIPScale); - int topMargin = (int)mContentViewCore.getRenderCoordinates().getContentOffsetYPix() - + (int)Math.round(y * mDIPScale); - - AbsoluteLayout.LayoutParams lp = new AbsoluteLayout.LayoutParams((int)width, - (int)height, leftMargin, topMargin); - view.setLayoutParams(lp); - } - - @Override - public void releaseAnchorView(View anchorView) { - mContainerView.removeView(anchorView); - } - }; - } - - @CalledByNative - private static AutofillSuggestion[] createAutofillSuggestionArray(int size) { - return new AutofillSuggestion[size]; - } - - /** - * @param array AutofillSuggestion array that should get a new suggestion added. - * @param index Index in the array where to place a new suggestion. - * @param name Name of the suggestion. - * @param label Label of the suggestion. - * @param uniqueId Unique suggestion id. - */ - @CalledByNative - private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, - String name, String label, int uniqueId) { - array[index] = new AutofillSuggestion(name, label, uniqueId); - } - - private native void nativeSuggestionSelected(int nativeAwAutofillManagerDelegate, int position); -} diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index f2f80b6..9da7fd5 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java @@ -153,8 +153,6 @@ public class AwContents { private boolean mContainerViewFocused; private boolean mWindowFocused; - private AwAutofillManagerDelegate mAwAutofillManagerDelegate; - private static final class DestroyRunnable implements Runnable { private int mNativeAwContents; private DestroyRunnable(int nativeAwContents) { @@ -1332,14 +1330,6 @@ public class AwContents { return mContentViewCore.performAccessibilityAction(action, arguments); } - /** - * @see android.webkit.WebView#clearFormData() - */ - public void hideAutofillPopup() { - if (mAwAutofillManagerDelegate != null) - mAwAutofillManagerDelegate.hideAutofillPopup(); - } - //-------------------------------------------------------------------------------------------- // Methods called from native via JNI //-------------------------------------------------------------------------------------------- @@ -1479,12 +1469,6 @@ public class AwContents { mScrollOffsetManager.scrollContainerViewTo(x, y); } - @CalledByNative - private void setAwAutofillManagerDelegate(AwAutofillManagerDelegate delegate) { - mAwAutofillManagerDelegate = delegate; - delegate.init(mContentViewCore, mDIPScale); - } - // ------------------------------------------------------------------------------------------- // Helper methods // ------------------------------------------------------------------------------------------- |