Chromium Code Reviews| Index: android_webview/java/src/org/chromium/android_webview/AwContents.java |
| 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 f0f286ffb8adcaf325ccd72bb5cb971b6c1d55ae..ab8700ae06a0b844851b85c355aef5cd173ca82d 100644 |
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
| @@ -4,6 +4,8 @@ |
| package org.chromium.android_webview; |
| +import android.content.ComponentCallbacks2; |
| +import android.content.Context; |
| import android.content.pm.PackageManager; |
| import android.content.res.Configuration; |
| import android.graphics.Bitmap; |
| @@ -523,6 +525,23 @@ public class AwContents { |
| onVisibilityChanged(mContainerView, mContainerView.getVisibility()); |
| onWindowVisibilityChanged(mContainerView.getWindowVisibility()); |
| + |
| + containerView.getContext().registerComponentCallbacks( |
|
joth
2013/10/02 10:47:01
could you move this up to line 520? onVisibilityCh
boliu
2013/10/02 14:09:55
This moved to attach/detach since we need to expli
|
| + new ComponentCallbacks2() { |
| + @Override |
| + public void onTrimMemory(int level) { |
| + if (mNativeAwContents == 0) return; |
| + nativeTrimMemory(mNativeAwContents, level); |
| + } |
| + |
| + @Override |
| + public void onLowMemory() { |
| + } |
| + |
| + @Override |
| + public void onConfigurationChanged(Configuration configuration) { |
| + } |
| + }); |
| } |
| /** |
| @@ -1967,4 +1986,6 @@ public class AwContents { |
| int nativeAwContents, boolean value, String requestingFrame); |
| private native void nativeSetJsOnlineProperty(int nativeAwContents, boolean networkUp); |
| + |
| + private native void nativeTrimMemory(int nativeAwContents, int level); |
| } |