summaryrefslogtreecommitdiffstats
path: root/chrome/android
diff options
context:
space:
mode:
authoryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 22:35:34 +0000
committeryfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 22:35:34 +0000
commit3e546a1419486836e40403146a5518039008ff4d (patch)
treef2c38be062150d30937142b76e91c29dc33cef38 /chrome/android
parent10f588e305a3e74c6f6d8387ad7eda930f90f30c (diff)
downloadchromium_src-3e546a1419486836e40403146a5518039008ff4d.zip
chromium_src-3e546a1419486836e40403146a5518039008ff4d.tar.gz
chromium_src-3e546a1419486836e40403146a5518039008ff4d.tar.bz2
[Android] Cleanup JNI usage in ChromeWebContentsDelegateAndroid.
Adds private accessors to create types needed by the public API to avoid manual bindings. NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12827005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java
index f7abbc8..546f302 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java
@@ -4,6 +4,9 @@
package org.chromium.chrome.browser;
+import android.graphics.Rect;
+import android.graphics.RectF;
+
import org.chromium.base.CalledByNative;
import org.chromium.components.web_contents_delegate_android.WebContentsDelegateAndroid;
@@ -22,4 +25,35 @@ public class ChromeWebContentsDelegateAndroid extends WebContentsDelegateAndroid
@CalledByNative
public void onFindMatchRectsAvailable(FindMatchRectsDetails result) {
}
+
+ // Helper functions used to create types that are part of the public interface
+ @CalledByNative
+ private static Rect createRect(int x, int y, int right, int bottom) {
+ return new Rect(x, y, right, bottom);
+ }
+
+ @CalledByNative
+ private static RectF createRectF(float x, float y, float right, float bottom) {
+ return new RectF(x, y, right, bottom);
+ }
+
+ @CalledByNative
+ private static FindNotificationDetails createFindNotificationDetails(
+ int numberOfMatches, Rect rendererSelectionRect,
+ int activeMatchOrdinal, boolean finalUpdate) {
+ return new FindNotificationDetails(numberOfMatches, rendererSelectionRect,
+ activeMatchOrdinal, finalUpdate);
+ }
+
+ @CalledByNative
+ private static FindMatchRectsDetails createFindMatchRectsDetails(
+ int version, int numRects, RectF activeRect) {
+ return new FindMatchRectsDetails(version, new RectF[numRects], activeRect);
+ }
+
+ @CalledByNative
+ private static void setMatchRectByIndex(
+ FindMatchRectsDetails findMatchRectsDetails, int index, RectF rect) {
+ findMatchRectsDetails.rects[index] = rect;
+ }
}