Loading core/java/android/webkit/BrowserFrame.java +1 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ class BrowserFrame extends Handler { // Create a global JWebCoreJavaBridge to handle timers and // cookies in the WebCore thread. if (sJavaBridge == null) { sJavaBridge = new JWebCoreJavaBridge(appContext); sJavaBridge = new JWebCoreJavaBridge(); // set WebCore native cache size ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); Loading core/java/android/webkit/JWebCoreJavaBridge.java +31 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.webkit; import android.content.Context; import android.os.Handler; import android.os.Message; import android.util.Log; Loading @@ -43,7 +42,9 @@ final class JWebCoreJavaBridge extends Handler { private boolean mTimerPaused; private boolean mHasDeferredTimers; private Context mContext; // keep track of the main WebView attached to the current window so that we // can get the proper Context. private WebView mCurrentMainWebView; /* package */ static final int REFRESH_PLUGINS = 100; Loading @@ -52,8 +53,7 @@ final class JWebCoreJavaBridge extends Handler { * Construct a new JWebCoreJavaBridge to interface with * WebCore timers and cookies. */ public JWebCoreJavaBridge(Context context) { mContext = context; public JWebCoreJavaBridge() { nativeConstructor(); } Loading @@ -62,6 +62,22 @@ final class JWebCoreJavaBridge extends Handler { nativeFinalize(); } synchronized void setActiveWebView(WebView webview) { if (mCurrentMainWebView != null) { // it is possible if there is a sub-WebView. Do nothing. return; } mCurrentMainWebView = webview; } synchronized void removeActiveWebView(WebView webview) { if (mCurrentMainWebView != webview) { // it is possible if there is a sub-WebView. Do nothing. return; } mCurrentMainWebView = null; } /** * Call native timer callbacks. */ Loading Loading @@ -238,9 +254,17 @@ final class JWebCoreJavaBridge extends Handler { return CertTool.getKeyStrengthList(); } private String getSignedPublicKey(int index, String challenge, String url) { // generateKeyPair expects organizations which we don't have. Ignore url. return CertTool.getSignedPublicKey(mContext, index, challenge); synchronized private String getSignedPublicKey(int index, String challenge, String url) { if (mCurrentMainWebView != null) { // generateKeyPair expects organizations which we don't have. Ignore // url. return CertTool.getSignedPublicKey( mCurrentMainWebView.getContext(), index, challenge); } else { Log.e(LOGTAG, "There is no active WebView for getSignedPublicKey"); return ""; } } private native void nativeConstructor(); Loading core/java/android/webkit/WebView.java +18 −7 Original line number Diff line number Diff line Loading @@ -3916,13 +3916,14 @@ public class WebView extends AbsoluteLayout @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (hasWindowFocus()) onWindowFocusChanged(true); if (hasWindowFocus()) setActive(true); } @Override protected void onDetachedFromWindow() { clearTextEntry(false); dismissZoomControl(); if (hasWindowFocus()) setActive(false); super.onDetachedFromWindow(); } Loading @@ -3949,11 +3950,8 @@ public class WebView extends AbsoluteLayout public void onGlobalFocusChanged(View oldFocus, View newFocus) { } // To avoid drawing the cursor ring, and remove the TextView when our window // loses focus. @Override public void onWindowFocusChanged(boolean hasWindowFocus) { if (hasWindowFocus) { private void setActive(boolean active) { if (active) { if (hasFocus()) { // If our window regained focus, and we have focus, then begin // drawing the cursor ring Loading @@ -3973,7 +3971,8 @@ public class WebView extends AbsoluteLayout // false for the first parameter } } else { if (getSettings().getBuiltInZoomControls() && !getZoomButtonsController().isVisible()) { if (getSettings().getBuiltInZoomControls() && !getZoomButtonsController().isVisible()) { /* * The zoom controls come in their own window, so our window * loses focus. Our policy is to not draw the cursor ring if Loading @@ -3994,6 +3993,18 @@ public class WebView extends AbsoluteLayout setFocusControllerInactive(); } invalidate(); } // To avoid drawing the cursor ring, and remove the TextView when our window // loses focus. @Override public void onWindowFocusChanged(boolean hasWindowFocus) { setActive(hasWindowFocus); if (hasWindowFocus) { BrowserFrame.sJavaBridge.setActiveWebView(this); } else { BrowserFrame.sJavaBridge.removeActiveWebView(this); } super.onWindowFocusChanged(hasWindowFocus); } Loading Loading
core/java/android/webkit/BrowserFrame.java +1 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ class BrowserFrame extends Handler { // Create a global JWebCoreJavaBridge to handle timers and // cookies in the WebCore thread. if (sJavaBridge == null) { sJavaBridge = new JWebCoreJavaBridge(appContext); sJavaBridge = new JWebCoreJavaBridge(); // set WebCore native cache size ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); Loading
core/java/android/webkit/JWebCoreJavaBridge.java +31 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.webkit; import android.content.Context; import android.os.Handler; import android.os.Message; import android.util.Log; Loading @@ -43,7 +42,9 @@ final class JWebCoreJavaBridge extends Handler { private boolean mTimerPaused; private boolean mHasDeferredTimers; private Context mContext; // keep track of the main WebView attached to the current window so that we // can get the proper Context. private WebView mCurrentMainWebView; /* package */ static final int REFRESH_PLUGINS = 100; Loading @@ -52,8 +53,7 @@ final class JWebCoreJavaBridge extends Handler { * Construct a new JWebCoreJavaBridge to interface with * WebCore timers and cookies. */ public JWebCoreJavaBridge(Context context) { mContext = context; public JWebCoreJavaBridge() { nativeConstructor(); } Loading @@ -62,6 +62,22 @@ final class JWebCoreJavaBridge extends Handler { nativeFinalize(); } synchronized void setActiveWebView(WebView webview) { if (mCurrentMainWebView != null) { // it is possible if there is a sub-WebView. Do nothing. return; } mCurrentMainWebView = webview; } synchronized void removeActiveWebView(WebView webview) { if (mCurrentMainWebView != webview) { // it is possible if there is a sub-WebView. Do nothing. return; } mCurrentMainWebView = null; } /** * Call native timer callbacks. */ Loading Loading @@ -238,9 +254,17 @@ final class JWebCoreJavaBridge extends Handler { return CertTool.getKeyStrengthList(); } private String getSignedPublicKey(int index, String challenge, String url) { // generateKeyPair expects organizations which we don't have. Ignore url. return CertTool.getSignedPublicKey(mContext, index, challenge); synchronized private String getSignedPublicKey(int index, String challenge, String url) { if (mCurrentMainWebView != null) { // generateKeyPair expects organizations which we don't have. Ignore // url. return CertTool.getSignedPublicKey( mCurrentMainWebView.getContext(), index, challenge); } else { Log.e(LOGTAG, "There is no active WebView for getSignedPublicKey"); return ""; } } private native void nativeConstructor(); Loading
core/java/android/webkit/WebView.java +18 −7 Original line number Diff line number Diff line Loading @@ -3916,13 +3916,14 @@ public class WebView extends AbsoluteLayout @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (hasWindowFocus()) onWindowFocusChanged(true); if (hasWindowFocus()) setActive(true); } @Override protected void onDetachedFromWindow() { clearTextEntry(false); dismissZoomControl(); if (hasWindowFocus()) setActive(false); super.onDetachedFromWindow(); } Loading @@ -3949,11 +3950,8 @@ public class WebView extends AbsoluteLayout public void onGlobalFocusChanged(View oldFocus, View newFocus) { } // To avoid drawing the cursor ring, and remove the TextView when our window // loses focus. @Override public void onWindowFocusChanged(boolean hasWindowFocus) { if (hasWindowFocus) { private void setActive(boolean active) { if (active) { if (hasFocus()) { // If our window regained focus, and we have focus, then begin // drawing the cursor ring Loading @@ -3973,7 +3971,8 @@ public class WebView extends AbsoluteLayout // false for the first parameter } } else { if (getSettings().getBuiltInZoomControls() && !getZoomButtonsController().isVisible()) { if (getSettings().getBuiltInZoomControls() && !getZoomButtonsController().isVisible()) { /* * The zoom controls come in their own window, so our window * loses focus. Our policy is to not draw the cursor ring if Loading @@ -3994,6 +3993,18 @@ public class WebView extends AbsoluteLayout setFocusControllerInactive(); } invalidate(); } // To avoid drawing the cursor ring, and remove the TextView when our window // loses focus. @Override public void onWindowFocusChanged(boolean hasWindowFocus) { setActive(hasWindowFocus); if (hasWindowFocus) { BrowserFrame.sJavaBridge.setActiveWebView(this); } else { BrowserFrame.sJavaBridge.removeActiveWebView(this); } super.onWindowFocusChanged(hasWindowFocus); } Loading