Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| 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 6d44e042af538f17c108e45c3c0b3dc3706ee2b3..75eb6e8f9cd1c497376c08c0a4cd0396b71eadc8 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 |
| @@ -10,6 +10,7 @@ import android.content.pm.ActivityInfo; |
| import android.content.pm.PackageManager; |
| import android.content.res.Configuration; |
| import android.graphics.Bitmap; |
| +import android.graphics.BitmapFactory; |
| import android.graphics.Canvas; |
| import android.graphics.Color; |
| import android.graphics.Rect; |
| @@ -554,6 +555,9 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| initPopupZoomer(mContext); |
| mImeAdapter = createImeAdapter(mContext); |
| + |
| + initOverscrollResources(mContext); |
| + |
| TraceEvent.end(); |
| } |
| @@ -614,6 +618,14 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| mPopupZoomer.setOnTapListener(listener); |
| } |
| + private void initOverscrollResources(Context context) { |
|
mkosiba (inactive)
2013/04/18 11:11:28
make this resilient to the resources not existing.
jdduke (slow)
2013/04/18 15:18:35
This is all going away =/ Resource acquisition wil
|
| + Bitmap edge = BitmapFactory.decodeResource(mContext.getResources(), |
| + R.drawable.overscroll_edge); |
| + Bitmap glow = BitmapFactory.decodeResource(mContext.getResources(), |
| + R.drawable.overscroll_glow); |
| + setOverscrollResources(edge, glow); |
| + } |
| + |
| /** |
| * @return Whether the configured personality of this ContentView is {@link #PERSONALITY_VIEW}. |
| */ |
| @@ -710,6 +722,12 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| } |
| } |
| + public void setOverscrollResources(Bitmap edge, Bitmap glow) { |
| + if (mNativeContentViewCore != 0 && edge != null && glow != null) { |
| + nativeSetOverscrollResources(mNativeContentViewCore, edge, glow); |
| + } |
| + } |
| + |
| @CalledByNative |
| private void onBackgroundColorChanged(int color) { |
| getContentViewClient().onBackgroundColorChanged(color); |
| @@ -2772,6 +2790,9 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| private native void nativeSetBackgroundColor(int nativeContentViewCoreImpl, int color); |
| + private native void nativeSetOverscrollResources(int nativeContentViewCoreImpl, |
| + Bitmap edge, Bitmap glow); |
| + |
| private native void nativeOnShow(int nativeContentViewCoreImpl); |
| private native void nativeOnHide(int nativeContentViewCoreImpl); |