Loading api/current.xml +13 −0 Original line number Diff line number Diff line Loading @@ -227783,6 +227783,19 @@ visibility="public" > </method> <method name="removeJavascriptInterface" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="interfaceName" type="java.lang.String"> </parameter> </method> <method name="requestFocusNodeHref" return="void" abstract="false" core/java/android/webkit/BrowserFrame.java +8 −1 Original line number Diff line number Diff line Loading @@ -599,13 +599,20 @@ class BrowserFrame extends Handler { public void addJavascriptInterface(Object obj, String interfaceName) { assert obj != null; removeJavascriptInterface(interfaceName); if (mJSInterfaceMap == null) { mJSInterfaceMap = new HashMap<String, Object>(); } mJSInterfaceMap.put(interfaceName, obj); } public void removeJavascriptInterface(String interfaceName) { if (mJSInterfaceMap == null) { return; } if (mJSInterfaceMap.containsKey(interfaceName)) { mJSInterfaceMap.remove(interfaceName); } mJSInterfaceMap.put(interfaceName, obj); } /** Loading core/java/android/webkit/WebView.java +12 −1 Original line number Diff line number Diff line Loading @@ -3523,7 +3523,8 @@ public class WebView extends AbsoluteLayout * </ul></p> * @param obj The class instance to bind to Javascript, null instances are * ignored. * @param interfaceName The name to used to expose the class in JavaScript. * @param interfaceName The name to used to expose the instance in * JavaScript. */ public void addJavascriptInterface(Object obj, String interfaceName) { if (obj == null) { Loading @@ -3535,6 +3536,16 @@ public class WebView extends AbsoluteLayout mWebViewCore.sendMessage(EventHub.ADD_JS_INTERFACE, arg); } /** * Removes a previously added JavaScript interface with the given name. * @param interfaceName The name of the interface to remove. */ public void removeJavascriptInterface(String interfaceName) { WebViewCore.JSInterfaceData arg = new WebViewCore.JSInterfaceData(); arg.mInterfaceName = interfaceName; mWebViewCore.sendMessage(EventHub.REMOVE_JS_INTERFACE, arg); } /** * Return the WebSettings object used to control the settings for this * WebView. Loading core/java/android/webkit/WebViewCore.java +9 −0 Original line number Diff line number Diff line Loading @@ -852,6 +852,7 @@ final class WebViewCore { "VALID_NODE_BOUNDS", // = 146 "SAVE_WEBARCHIVE", // = 147 "WEBKIT_DRAW_LAYERS", // = 148; "REMOVE_JS_INTERFACE", // = 149; }; class EventHub { Loading Loading @@ -925,6 +926,8 @@ final class WebViewCore { // Update layers static final int WEBKIT_DRAW_LAYERS = 148; static final int REMOVE_JS_INTERFACE = 149; // Network-based messaging static final int CLEAR_SSL_PREF_TABLE = 150; Loading Loading @@ -1290,6 +1293,12 @@ final class WebViewCore { jsData.mInterfaceName); break; case REMOVE_JS_INTERFACE: jsData = (JSInterfaceData) msg.obj; mBrowserFrame.removeJavascriptInterface( jsData.mInterfaceName); break; case REQUEST_EXT_REPRESENTATION: mBrowserFrame.externalRepresentation( (Message) msg.obj); Loading Loading
api/current.xml +13 −0 Original line number Diff line number Diff line Loading @@ -227783,6 +227783,19 @@ visibility="public" > </method> <method name="removeJavascriptInterface" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="interfaceName" type="java.lang.String"> </parameter> </method> <method name="requestFocusNodeHref" return="void" abstract="false"
core/java/android/webkit/BrowserFrame.java +8 −1 Original line number Diff line number Diff line Loading @@ -599,13 +599,20 @@ class BrowserFrame extends Handler { public void addJavascriptInterface(Object obj, String interfaceName) { assert obj != null; removeJavascriptInterface(interfaceName); if (mJSInterfaceMap == null) { mJSInterfaceMap = new HashMap<String, Object>(); } mJSInterfaceMap.put(interfaceName, obj); } public void removeJavascriptInterface(String interfaceName) { if (mJSInterfaceMap == null) { return; } if (mJSInterfaceMap.containsKey(interfaceName)) { mJSInterfaceMap.remove(interfaceName); } mJSInterfaceMap.put(interfaceName, obj); } /** Loading
core/java/android/webkit/WebView.java +12 −1 Original line number Diff line number Diff line Loading @@ -3523,7 +3523,8 @@ public class WebView extends AbsoluteLayout * </ul></p> * @param obj The class instance to bind to Javascript, null instances are * ignored. * @param interfaceName The name to used to expose the class in JavaScript. * @param interfaceName The name to used to expose the instance in * JavaScript. */ public void addJavascriptInterface(Object obj, String interfaceName) { if (obj == null) { Loading @@ -3535,6 +3536,16 @@ public class WebView extends AbsoluteLayout mWebViewCore.sendMessage(EventHub.ADD_JS_INTERFACE, arg); } /** * Removes a previously added JavaScript interface with the given name. * @param interfaceName The name of the interface to remove. */ public void removeJavascriptInterface(String interfaceName) { WebViewCore.JSInterfaceData arg = new WebViewCore.JSInterfaceData(); arg.mInterfaceName = interfaceName; mWebViewCore.sendMessage(EventHub.REMOVE_JS_INTERFACE, arg); } /** * Return the WebSettings object used to control the settings for this * WebView. Loading
core/java/android/webkit/WebViewCore.java +9 −0 Original line number Diff line number Diff line Loading @@ -852,6 +852,7 @@ final class WebViewCore { "VALID_NODE_BOUNDS", // = 146 "SAVE_WEBARCHIVE", // = 147 "WEBKIT_DRAW_LAYERS", // = 148; "REMOVE_JS_INTERFACE", // = 149; }; class EventHub { Loading Loading @@ -925,6 +926,8 @@ final class WebViewCore { // Update layers static final int WEBKIT_DRAW_LAYERS = 148; static final int REMOVE_JS_INTERFACE = 149; // Network-based messaging static final int CLEAR_SSL_PREF_TABLE = 150; Loading Loading @@ -1290,6 +1293,12 @@ final class WebViewCore { jsData.mInterfaceName); break; case REMOVE_JS_INTERFACE: jsData = (JSInterfaceData) msg.obj; mBrowserFrame.removeJavascriptInterface( jsData.mInterfaceName); break; case REQUEST_EXT_REPRESENTATION: mBrowserFrame.externalRepresentation( (Message) msg.obj); Loading