summaryrefslogtreecommitdiffstats
path: root/content/public/android
diff options
context:
space:
mode:
authoraurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 02:09:00 +0000
committeraurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 02:09:00 +0000
commita933d8458ba13ede28d012ba241b9d00216c7598 (patch)
tree30021cc1b00abdaeb86685b9cfa245a7b66972ce /content/public/android
parentd50c6868b828cbbd2a748065f829c69e264e68c7 (diff)
downloadchromium_src-a933d8458ba13ede28d012ba241b9d00216c7598.zip
chromium_src-a933d8458ba13ede28d012ba241b9d00216c7598.tar.gz
chromium_src-a933d8458ba13ede28d012ba241b9d00216c7598.tar.bz2
Upstream Autofill functionality for Android.
Upstream Autofill functionality for Android. BUG=138235 Review URL: https://chromiumcodereview.appspot.com/11187054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/android')
-rw-r--r--content/public/android/java/src/org/chromium/content/app/AppResource.java9
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContainerViewDelegate.java25
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java26
3 files changed, 60 insertions, 0 deletions
diff --git a/content/public/android/java/src/org/chromium/content/app/AppResource.java b/content/public/android/java/src/org/chromium/content/app/AppResource.java
index 3a2d06e..9a260f8f 100644
--- a/content/public/android/java/src/org/chromium/content/app/AppResource.java
+++ b/content/public/android/java/src/org/chromium/content/app/AppResource.java
@@ -60,6 +60,12 @@ public class AppResource {
/** Drawable resource for the link preview popup overlay. */
public static int DRAWABLE_LINK_PREVIEW_POPUP_OVERLAY;
+ /** Id of the autofill label. */
+ public static int ID_AUTOFILL_LABEL;
+
+ /** Id of the autofill name. */
+ public static int ID_AUTOFILL_NAME;
+
/** Id of the date picker view. */
public static int ID_DATE_PICKER;
@@ -93,6 +99,9 @@ public class AppResource {
/** Id of the view containing the month and year pickers. */
public static int ID_MONTH_YEAR_PICKERS_CONTAINER;
+ /** Layout of the autofill popup. */
+ public static int LAYOUT_AUTOFILL_TEXT;
+
/** Layout of the date/time picker dialog. */
public static int LAYOUT_DATE_TIME_PICKER_DIALOG;
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContainerViewDelegate.java b/content/public/android/java/src/org/chromium/content/browser/ContainerViewDelegate.java
new file mode 100644
index 0000000..8417345
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/ContainerViewDelegate.java
@@ -0,0 +1,25 @@
+// Copyright (c) 2012 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.content.browser;
+
+import android.view.View;
+
+/**
+ * Interface to add and remove views from the implementing view.
+ */
+public interface ContainerViewDelegate {
+
+ /**
+ * Add the view.
+ * @param view The view to be added.
+ */
+ public void addViewToContainerView(View view);
+
+ /**
+ * Remove the view if it is present, otherwise do nothing.
+ * @param view The view to be removed.
+ */
+ public void removeViewFromContainerView(View view);
+} \ No newline at end of file
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 5941d8d..0812b1a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -304,6 +304,32 @@ public class ContentViewCore implements MotionEventDelegate {
return mContainerView;
}
+ /**
+ * Returns a delegate that can be used to add and remove views from the ContainerView.
+ *
+ * NOTE: Use with care, as not all ContentViewCore users setup their ContainerView in the same
+ * way. In particular, the Android WebView has limitations on what implementation details can
+ * be provided via a child view, as they are visible in the API and could introduce
+ * compatibility breaks with existing applications. If in doubt, contact the
+ * android_webview/OWNERS
+ *
+ * @return A ContainerViewDelegate that can be used to add and remove views.
+ */
+ @CalledByNative
+ public ContainerViewDelegate getContainerViewDelegate() {
+ return new ContainerViewDelegate() {
+ @Override
+ public void addViewToContainerView(View view) {
+ mContainerView.addView(view);
+ }
+
+ @Override
+ public void removeViewFromContainerView(View view) {
+ mContainerView.removeView(view);
+ }
+ };
+ }
+
private ImeAdapter createImeAdapter(Context context) {
return new ImeAdapter(context, getSelectionHandleController(),
getInsertionHandleController(),