public final class WebViewClassic extends Object implements WebViewProvider, WebViewProvider.ScrollDelegate, WebViewProvider.ViewDelegate
WebView
public API.Modifier and Type | Class and Description |
---|---|
static interface |
WebViewClassic.PageSwapDelegate |
static interface |
WebViewClassic.TitleBarDelegate |
WebViewProvider.ScrollDelegate, WebViewProvider.ViewDelegate
Modifier and Type | Field and Description |
---|---|
static String |
SCHEME_GEO
URI scheme for map address
|
static String |
SCHEME_MAILTO
URI scheme for email address
|
static String |
SCHEME_TEL
URI scheme for telephone number
|
Constructor and Description |
---|
WebViewClassic(WebView webView,
android.webkit.WebView.PrivateAccess privateAccess) |
Modifier and Type | Method and Description |
---|---|
void |
addJavascriptInterface(Object object,
String name)
|
boolean |
canGoBack()
|
boolean |
canGoBackOrForward(int steps)
|
boolean |
canGoForward()
|
boolean |
canZoomIn()
See
WebView#canZoomIn() |
boolean |
canZoomOut()
See
WebView#canZoomOut() |
Picture |
capturePicture()
|
void |
clearCache(boolean includeDiskFiles)
See
WebView#clearCache(boolean) |
void |
clearFormData()
|
void |
clearHistory()
|
void |
clearMatches()
See
WebView#clearMatches() |
void |
clearSslPreferences()
|
void |
clearView()
|
void |
clearViewState()
Clears the view state set with
loadViewState(InputStream) . |
int |
computeHorizontalScrollOffset()
|
int |
computeHorizontalScrollRange()
|
void |
computeScroll()
|
int |
computeVerticalScrollExtent()
|
int |
computeVerticalScrollOffset()
|
int |
computeVerticalScrollRange()
|
protected void |
contentInvalidateAll()
send content invalidate
|
android.webkit.WebBackForwardListClassic |
copyBackForwardList()
|
boolean |
copySelection()
Copy the selection to the clipboard
This is an implementation detail.
|
void |
cutSelection()
Cut the selected text into the clipboard
This is an implementation detail
|
void |
destroy()
|
static void |
disablePlatformNotifications()
Deprecated.
|
void |
discardAllTextures()
discard all textures from tiles.
|
boolean |
dispatchKeyEvent(KeyEvent event) |
void |
documentAsText(Message callback) |
void |
documentHasImages(Message response)
|
void |
dumpDisplayTree()
Dump the display tree to "/sdcard/displayTree.txt"
debug only
|
void |
dumpDomTree(boolean toFile)
Dump the dom tree to adb shell if "toFile" is False, otherwise dump it to
"/sdcard/domTree.txt"
debug only
|
void |
dumpRenderTree(boolean toFile)
Dump the render tree to adb shell if "toFile" is False, otherwise dump it
to "/sdcard/renderTree.txt"
debug only
|
void |
dumpViewHierarchyWithProperties(BufferedWriter out,
int level) |
static void |
enablePlatformNotifications()
Deprecated.
|
void |
externalRepresentation(Message callback) |
protected void |
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
static String |
findAddress(String addr)
Return the first substring consisting of the address of a physical
location.
|
static String |
findAddress(String addr,
boolean caseInsensitive)
Return the first substring consisting of the address of a physical
location.
|
int |
findAll(String find)
See
WebView#findAll(String) |
void |
findAllAsync(String find) |
View |
findHierarchyView(String className,
int hashCode) |
void |
findNext(boolean forward)
See
WebView#findNext(boolean) |
void |
flingScroll(int vx,
int vy) |
void |
freeMemory()
See
WebView#freeMemory() |
static WebViewClassic |
fromWebView(WebView webView) |
SslCertificate |
getCertificate()
See
WebView#getCertificate() |
int |
getContentHeight()
|
int |
getContentWidth()
See
WebView#getContentWidth() |
Bitmap |
getFavicon()
|
HitTestResult |
getHitTestResult()
See
WebView#getHitTestResult() |
String[] |
getHttpAuthUsernamePassword(String host,
String realm)
|
String |
getOriginalUrl()
See
WebView#getOriginalUrl() |
int |
getPageBackgroundColor() |
static PluginList |
getPluginList()
Deprecated.
|
int |
getProgress()
|
float |
getScale()
|
WebViewProvider.ScrollDelegate |
getScrollDelegate() |
WebSettingsClassic |
getSettings()
See
WebView.getSettings()
Note this returns WebSettingsClassic, a sub-class of WebSettings, which can be used
to access extension APIs. |
String |
getTitle()
|
protected int |
getTitleHeight()
Returns the height (in pixels) of the embedded title bar (if any).
|
String |
getTouchIconUrl()
See
WebView#getTouchIconUrl() |
String |
getUrl()
See
WebView.getUrl() |
WebViewProvider.ViewDelegate |
getViewDelegate() |
int |
getVisibleTitleHeight()
Deprecated.
|
WebBackForwardListClient |
getWebBackForwardListClient()
Gets the WebBackForwardListClient.
|
WebChromeClient |
getWebChromeClient()
Gets the chrome handler.
|
WebView |
getWebView() |
WebViewClient |
getWebViewClient()
Gets the WebViewClient
|
WebViewCore |
getWebViewCore() |
View |
getZoomControls()
Deprecated.
|
void |
goBack()
See
WebView.goBack() |
void |
goBackOrForward(int steps)
|
void |
goForward()
|
void |
init(Map<String,Object> javaScriptInterfaces,
boolean privateBrowsing)
|
void |
invokeZoomPicker()
|
boolean |
isPaused()
See
WebView#isPaused() |
boolean |
isPrivateBrowsingEnabled()
See
WebView#isPrivateBrowsingEnabled() |
void |
loadData(String data,
String mimeType,
String encoding)
|
void |
loadDataWithBaseURL(String baseUrl,
String data,
String mimeType,
String encoding,
String historyUrl)
|
void |
loadUrl(String url)
|
void |
loadUrl(String url,
Map<String,String> additionalHttpHeaders)
See
WebView#loadUrl(String, Map) |
void |
loadViewState(InputStream stream)
Loads the view data from the input stream.
|
void |
onAttachedToWindow() |
void |
onConfigurationChanged(Configuration newConfig) |
InputConnection |
onCreateInputConnection(EditorInfo outAttrs) |
void |
onDetachedFromWindow() |
void |
onDraw(Canvas canvas) |
void |
onDrawVerticalScrollBar(Canvas canvas,
Drawable scrollBar,
int l,
int t,
int r,
int b) |
void |
onFocusChanged(boolean focused,
int direction,
Rect previouslyFocusedRect) |
boolean |
onGenericMotionEvent(MotionEvent event) |
boolean |
onHoverEvent(MotionEvent event) |
void |
onInitializeAccessibilityEvent(AccessibilityEvent event) |
void |
onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) |
boolean |
onKeyDown(int keyCode,
KeyEvent event) |
boolean |
onKeyMultiple(int keyCode,
int repeatCount,
KeyEvent event) |
boolean |
onKeyPreIme(int keyCode,
KeyEvent event) |
boolean |
onKeyUp(int keyCode,
KeyEvent event) |
void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onOverScrolled(int scrollX,
int scrollY,
boolean clampedX,
boolean clampedY) |
void |
onPause()
See
WebView#onPause() |
void |
onResume()
See
WebView#onResume() |
void |
onScrollChanged(int l,
int t,
int oldl,
int oldt) |
void |
onSizeChanged(int w,
int h,
int ow,
int oh) |
boolean |
onTouchEvent(MotionEvent ev) |
boolean |
onTrackballEvent(MotionEvent ev) |
void |
onVisibilityChanged(View changedView,
int visibility) |
void |
onWindowFocusChanged(boolean hasWindowFocus) |
void |
onWindowVisibilityChanged(int visibility) |
boolean |
overlayHorizontalScrollbar()
|
boolean |
overlayVerticalScrollbar()
|
boolean |
pageDown(boolean bottom)
|
protected void |
pageSwapCallback(boolean notifyAnimationStarted)
Called by JNI when pages are swapped (only occurs with hardware
acceleration)
|
boolean |
pageUp(boolean top)
|
void |
pasteFromClipboard()
Paste text from the clipboard to the cursor position.
|
void |
pauseTimers()
|
boolean |
performAccessibilityAction(int action,
Bundle arguments) |
boolean |
performLongClick() |
void |
postUrl(String url,
byte[] postData)
See
WebView#postUrl(String, byte[]) |
void |
refreshPlugins(boolean reloadOpenPages)
Deprecated.
|
void |
reload()
See
WebView.reload() |
void |
removeJavascriptInterface(String interfaceName)
See
WebView#removeJavascriptInterface(String) |
boolean |
requestChildRectangleOnScreen(View child,
Rect rect,
boolean immediate) |
boolean |
requestFocus(int direction,
Rect previouslyFocusedRect) |
void |
requestFocusNodeHref(Message hrefMsg)
|
void |
requestImageRef(Message msg)
|
boolean |
restorePicture(Bundle b,
File src)
Deprecated.
|
WebBackForwardList |
restoreState(Bundle inState)
|
void |
resumeTimers()
|
void |
savePassword(String host,
String username,
String password)
|
boolean |
savePicture(Bundle b,
File dest)
Deprecated.
|
WebBackForwardList |
saveState(Bundle outState)
|
void |
saveViewState(OutputStream stream,
ValueCallback<Boolean> callback)
Saves the view data to the output stream.
|
void |
saveWebArchive(String filename)
See
WebView#saveWebArchive(String) |
void |
saveWebArchive(String basename,
boolean autoname,
ValueCallback<String> callback)
See
WebView#saveWebArchive(String, boolean, ValueCallback) |
void |
selectAll()
Select all of the text in this WebView.
|
boolean |
selectText()
Select the word at the last click point.
|
void |
setBackgroundColor(int color)
|
void |
setCertificate(SslCertificate certificate)
See
WebView#setCertificate(SslCertificate) |
void |
setDownloadListener(DownloadListener listener)
|
void |
setFindListener(android.webkit.WebView.FindListener listener)
See
WebView#setFindListener(WebView.FindListener) . |
boolean |
setFrame(int left,
int top,
int right,
int bottom) |
void |
setHorizontalScrollbarOverlay(boolean overlay)
|
void |
setHTML5VideoViewProxy(android.webkit.HTML5VideoViewProxy proxy)
Enable the communication b/t the webView and VideoViewProxy
only used by the Browser
|
void |
setHttpAuthUsernamePassword(String host,
String realm,
String username,
String password)
|
void |
setInitialScale(int scaleInPercent)
|
void |
setJsFlags(String flags)
Sets JavaScript engine flags.
|
void |
setLayerType(int layerType,
Paint paint) |
void |
setLayoutParams(ViewGroup.LayoutParams params) |
void |
setMapTrackballToArrowKeys(boolean setMap) |
void |
setMockDeviceOrientation(boolean canProvideAlpha,
double alpha,
boolean canProvideBeta,
double beta,
boolean canProvideGamma,
double gamma)
Called by DRT on WebCore thread.
|
void |
setMockGeolocationError(int code,
String message)
Called by DRT on WebCore thread.
|
void |
setMockGeolocationPermission(boolean allow)
Called by DRT on WebCore thread.
|
void |
setMockGeolocationPosition(double latitude,
double longitude,
double accuracy)
Called by DRT on WebCore thread.
|
void |
setNetworkAvailable(boolean networkUp)
See
WebView#setNetworkAvailable(boolean) |
void |
setNetworkType(String type,
String subtype)
Inform WebView about the current network type.
|
void |
setOverScrollMode(int mode) |
void |
setPictureListener(PictureListener listener)
Deprecated.
|
void |
setScrollBarStyle(int style) |
static void |
setShouldMonitorWebCoreThread() |
void |
setTouchInterval(int interval)
Set the time to wait between passing touches to WebCore.
|
void |
setUseMockDeviceOrientation()
Called by DRT on UI thread, need to proxy to WebCore thread.
|
void |
setUseMockGeolocation()
Sets use of the Geolocation mock client.
|
void |
setVerticalScrollbarOverlay(boolean overlay)
See {@link WebView#setVerticalScrollbarOverlay(boolean)
|
void |
setWebBackForwardListClient(WebBackForwardListClient client)
Set the back/forward list client.
|
void |
setWebChromeClient(WebChromeClient client)
|
void |
setWebViewClient(WebViewClient client)
|
boolean |
shouldDelayChildPressedState() |
boolean |
showFindDialog(String text,
boolean showIme)
Start an ActionMode for finding text in this WebView.
|
void |
stopLoading()
|
void |
stopScroll()
Request the scroller to abort any ongoing animation
|
void |
tileProfilingClear()
only used by profiling tests
|
float |
tileProfilingGetFloat(int frame,
int tile,
String key)
only used by profiling tests
|
int |
tileProfilingGetInt(int frame,
int tile,
String key)
only used by profiling tests
|
int |
tileProfilingNumFrames()
only used by profiling tests
|
int |
tileProfilingNumTilesInFrame(int frame)
only used by profiling tests
|
void |
tileProfilingStart()
Begin collecting per-tile profiling data
only used by profiling tests
|
float |
tileProfilingStop()
Return per-tile profiling data
only used by profiling tests
|
boolean |
zoomIn()
See
WebView.zoomIn() |
boolean |
zoomOut()
|
public static final String SCHEME_TEL
public static final String SCHEME_MAILTO
public static final String SCHEME_GEO
public WebViewClassic(WebView webView, android.webkit.WebView.PrivateAccess privateAccess)
public void init(Map<String,Object> javaScriptInterfaces, boolean privateBrowsing)
init
in interface WebViewProvider
javaScriptInterfaces
- is a Map of interface names, as keys, and
object implementing those interfaces, as values.privateBrowsing
- If true the web view will be initialized in private / incognito mode.public WebView getWebView()
public WebViewProvider.ViewDelegate getViewDelegate()
getViewDelegate
in interface WebViewProvider
public WebViewProvider.ScrollDelegate getScrollDelegate()
getScrollDelegate
in interface WebViewProvider
public static WebViewClassic fromWebView(WebView webView)
public boolean shouldDelayChildPressedState()
shouldDelayChildPressedState
in interface WebViewProvider.ViewDelegate
public boolean performAccessibilityAction(int action, Bundle arguments)
performAccessibilityAction
in interface WebViewProvider.ViewDelegate
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
onInitializeAccessibilityNodeInfo
in interface WebViewProvider.ViewDelegate
public void onInitializeAccessibilityEvent(AccessibilityEvent event)
onInitializeAccessibilityEvent
in interface WebViewProvider.ViewDelegate
public void setOverScrollMode(int mode)
setOverScrollMode
in interface WebViewProvider.ViewDelegate
public void setScrollBarStyle(int style)
setScrollBarStyle
in interface WebViewProvider.ViewDelegate
public void setHorizontalScrollbarOverlay(boolean overlay)
setHorizontalScrollbarOverlay
in interface WebViewProvider
public void setVerticalScrollbarOverlay(boolean overlay)
setVerticalScrollbarOverlay
in interface WebViewProvider
public boolean overlayHorizontalScrollbar()
overlayHorizontalScrollbar
in interface WebViewProvider
public boolean overlayVerticalScrollbar()
overlayVerticalScrollbar
in interface WebViewProvider
protected int getTitleHeight()
@Deprecated public int getVisibleTitleHeight()
WebView#getVisibleTitleHeight()
getVisibleTitleHeight
in interface WebViewProvider
public SslCertificate getCertificate()
WebView#getCertificate()
getCertificate
in interface WebViewProvider
public void setCertificate(SslCertificate certificate)
WebView#setCertificate(SslCertificate)
setCertificate
in interface WebViewProvider
public void savePassword(String host, String username, String password)
savePassword
in interface WebViewProvider
public void setHttpAuthUsernamePassword(String host, String realm, String username, String password)
setHttpAuthUsernamePassword
in interface WebViewProvider
public String[] getHttpAuthUsernamePassword(String host, String realm)
getHttpAuthUsernamePassword
in interface WebViewProvider
public void destroy()
destroy
in interface WebViewProvider
@Deprecated public static void enablePlatformNotifications()
@Deprecated public static void disablePlatformNotifications()
public void setJsFlags(String flags)
flags
- JS engine flags in a String
This is an implementation detail.public void setNetworkAvailable(boolean networkUp)
WebView#setNetworkAvailable(boolean)
setNetworkAvailable
in interface WebViewProvider
public void setNetworkType(String type, String subtype)
public WebBackForwardList saveState(Bundle outState)
saveState
in interface WebViewProvider
@Deprecated public boolean savePicture(Bundle b, File dest)
WebView#savePicture(Bundle, File)
savePicture
in interface WebViewProvider
@Deprecated public boolean restorePicture(Bundle b, File src)
WebView#restorePicture(Bundle, File)
;restorePicture
in interface WebViewProvider
public void saveViewState(OutputStream stream, ValueCallback<Boolean> callback)
stream
- The OutputStream
to save tocallback
- The ValueCallback
to call with the resultpublic void loadViewState(InputStream stream)
saveViewState(java.io.OutputStream, ValueCallback)
for more information.stream
- The InputStream
to load frompublic void clearViewState()
loadViewState(InputStream)
.
This WebView will then switch to showing the content from webkitpublic WebBackForwardList restoreState(Bundle inState)
restoreState
in interface WebViewProvider
public void loadUrl(String url, Map<String,String> additionalHttpHeaders)
WebView#loadUrl(String, Map)
loadUrl
in interface WebViewProvider
public void loadUrl(String url)
loadUrl
in interface WebViewProvider
public void postUrl(String url, byte[] postData)
WebView#postUrl(String, byte[])
postUrl
in interface WebViewProvider
public void loadData(String data, String mimeType, String encoding)
loadData
in interface WebViewProvider
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl)
loadDataWithBaseURL
in interface WebViewProvider
public void saveWebArchive(String filename)
WebView#saveWebArchive(String)
saveWebArchive
in interface WebViewProvider
public void saveWebArchive(String basename, boolean autoname, ValueCallback<String> callback)
WebView#saveWebArchive(String, boolean, ValueCallback)
saveWebArchive
in interface WebViewProvider
public void stopLoading()
stopLoading
in interface WebViewProvider
public void reload()
WebView.reload()
reload
in interface WebViewProvider
public boolean canGoBack()
canGoBack
in interface WebViewProvider
public void goBack()
WebView.goBack()
goBack
in interface WebViewProvider
public boolean canGoForward()
canGoForward
in interface WebViewProvider
public void goForward()
goForward
in interface WebViewProvider
public boolean canGoBackOrForward(int steps)
canGoBackOrForward
in interface WebViewProvider
public void goBackOrForward(int steps)
goBackOrForward
in interface WebViewProvider
public boolean isPrivateBrowsingEnabled()
WebView#isPrivateBrowsingEnabled()
isPrivateBrowsingEnabled
in interface WebViewProvider
public boolean pageUp(boolean top)
pageUp
in interface WebViewProvider
public boolean pageDown(boolean bottom)
pageDown
in interface WebViewProvider
public void clearView()
clearView
in interface WebViewProvider
public Picture capturePicture()
capturePicture
in interface WebViewProvider
public float getScale()
getScale
in interface WebViewProvider
public void setInitialScale(int scaleInPercent)
setInitialScale
in interface WebViewProvider
public void invokeZoomPicker()
invokeZoomPicker
in interface WebViewProvider
public HitTestResult getHitTestResult()
WebView#getHitTestResult()
getHitTestResult
in interface WebViewProvider
public void requestFocusNodeHref(Message hrefMsg)
requestFocusNodeHref
in interface WebViewProvider
public void requestImageRef(Message msg)
requestImageRef
in interface WebViewProvider
public int computeHorizontalScrollRange()
WebViewProvider.ScrollDelegate
computeHorizontalScrollRange
in interface WebViewProvider.ScrollDelegate
public int computeHorizontalScrollOffset()
WebViewProvider.ScrollDelegate
computeHorizontalScrollOffset
in interface WebViewProvider.ScrollDelegate
public int computeVerticalScrollRange()
WebViewProvider.ScrollDelegate
computeVerticalScrollRange
in interface WebViewProvider.ScrollDelegate
public int computeVerticalScrollOffset()
WebViewProvider.ScrollDelegate
computeVerticalScrollOffset
in interface WebViewProvider.ScrollDelegate
public int computeVerticalScrollExtent()
WebViewProvider.ScrollDelegate
computeVerticalScrollExtent
in interface WebViewProvider.ScrollDelegate
public void onDrawVerticalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b)
onDrawVerticalScrollBar
in interface WebViewProvider.ViewDelegate
public void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY)
onOverScrolled
in interface WebViewProvider.ViewDelegate
public String getUrl()
WebView.getUrl()
getUrl
in interface WebViewProvider
public String getOriginalUrl()
WebView#getOriginalUrl()
getOriginalUrl
in interface WebViewProvider
public String getTitle()
getTitle
in interface WebViewProvider
public Bitmap getFavicon()
getFavicon
in interface WebViewProvider
public String getTouchIconUrl()
WebView#getTouchIconUrl()
getTouchIconUrl
in interface WebViewProvider
public int getProgress()
getProgress
in interface WebViewProvider
public int getContentHeight()
getContentHeight
in interface WebViewProvider
public int getContentWidth()
WebView#getContentWidth()
getContentWidth
in interface WebViewProvider
public int getPageBackgroundColor()
public void pauseTimers()
pauseTimers
in interface WebViewProvider
public void resumeTimers()
resumeTimers
in interface WebViewProvider
public void onPause()
WebView#onPause()
onPause
in interface WebViewProvider
public void onWindowVisibilityChanged(int visibility)
onWindowVisibilityChanged
in interface WebViewProvider.ViewDelegate
public void onResume()
WebView#onResume()
onResume
in interface WebViewProvider
public boolean isPaused()
WebView#isPaused()
isPaused
in interface WebViewProvider
public void freeMemory()
WebView#freeMemory()
freeMemory
in interface WebViewProvider
public void clearCache(boolean includeDiskFiles)
WebView#clearCache(boolean)
clearCache
in interface WebViewProvider
public void clearFormData()
clearFormData
in interface WebViewProvider
public void clearHistory()
clearHistory
in interface WebViewProvider
public void clearSslPreferences()
clearSslPreferences
in interface WebViewProvider
public android.webkit.WebBackForwardListClassic copyBackForwardList()
copyBackForwardList
in interface WebViewProvider
public void setFindListener(android.webkit.WebView.FindListener listener)
WebView#setFindListener(WebView.FindListener)
.setFindListener
in interface WebViewProvider
public void findNext(boolean forward)
WebView#findNext(boolean)
findNext
in interface WebViewProvider
public int findAll(String find)
WebView#findAll(String)
findAll
in interface WebViewProvider
public void findAllAsync(String find)
findAllAsync
in interface WebViewProvider
public boolean showFindDialog(String text, boolean showIme)
showFindDialog
in interface WebViewProvider
text
- If non-null, will be the initial text to search for.
Otherwise, the last String searched for in this WebView will
be used to start.showIme
- If true, show the IME, assuming the user will begin typing.
If false and text is non-null, perform a find all.public static String findAddress(String addr)
addr
- The string to search for addresses.public static String findAddress(String addr, boolean caseInsensitive)
addr
- The string to search for addresses.caseInsensitive
- addr Set to true to make search ignore case.public void clearMatches()
WebView#clearMatches()
clearMatches
in interface WebViewProvider
public void documentHasImages(Message response)
documentHasImages
in interface WebViewProvider
public void stopScroll()
public void computeScroll()
WebViewProvider.ScrollDelegate
computeScroll
in interface WebViewProvider.ScrollDelegate
public void setWebViewClient(WebViewClient client)
setWebViewClient
in interface WebViewProvider
public WebViewClient getWebViewClient()
public void setDownloadListener(DownloadListener listener)
setDownloadListener
in interface WebViewProvider
public void setWebChromeClient(WebChromeClient client)
setWebChromeClient
in interface WebViewProvider
public WebChromeClient getWebChromeClient()
public void setWebBackForwardListClient(WebBackForwardListClient client)
client
- An implementation of WebBackForwardListClient.public WebBackForwardListClient getWebBackForwardListClient()
@Deprecated public void setPictureListener(PictureListener listener)
WebView#setPictureListener(PictureListener)
setPictureListener
in interface WebViewProvider
public void externalRepresentation(Message callback)
public void documentAsText(Message callback)
public void addJavascriptInterface(Object object, String name)
addJavascriptInterface
in interface WebViewProvider
public void removeJavascriptInterface(String interfaceName)
WebView#removeJavascriptInterface(String)
removeJavascriptInterface
in interface WebViewProvider
public WebSettingsClassic getSettings()
WebView.getSettings()
Note this returns WebSettingsClassic, a sub-class of WebSettings, which can be used
to access extension APIs.getSettings
in interface WebViewProvider
@Deprecated public static PluginList getPluginList()
WebView#getPluginList()
@Deprecated public void refreshPlugins(boolean reloadOpenPages)
WebView#refreshPlugins(boolean)
protected void finalize() throws Throwable
Object
Note that objects that override finalize
are significantly more expensive than
objects that don't. Finalizers may be run a long time after the object is no longer
reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup.
Note also that finalizers are run on a single VM-wide finalizer thread,
so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary
for a class that has a native peer and needs to call a native method to destroy that peer.
Even then, it's better to provide an explicit close
method (and implement
Closeable
), and insist that callers manually dispose of instances. This
works well for something like files, but less well for something like a BigInteger
where typical calling code would have to deal with lots of temporaries. Unfortunately,
code that creates lots of temporaries is the worst kind of code from the point of view of
the single finalizer thread.
If you must use finalizers, consider at least providing your own
ReferenceQueue
and having your own thread process that queue.
Unlike constructors, finalizers are not automatically chained. You are responsible for
calling super.finalize()
yourself.
Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.
public void onDraw(Canvas canvas)
onDraw
in interface WebViewProvider.ViewDelegate
public void setLayoutParams(ViewGroup.LayoutParams params)
setLayoutParams
in interface WebViewProvider.ViewDelegate
public boolean performLongClick()
performLongClick
in interface WebViewProvider.ViewDelegate
public boolean selectText()
public void onConfigurationChanged(Configuration newConfig)
onConfigurationChanged
in interface WebViewProvider.ViewDelegate
public InputConnection onCreateInputConnection(EditorInfo outAttrs)
onCreateInputConnection
in interface WebViewProvider.ViewDelegate
public void dumpDisplayTree()
public void dumpDomTree(boolean toFile)
public void dumpRenderTree(boolean toFile)
public void setUseMockDeviceOrientation()
public void setUseMockGeolocation()
public void setMockGeolocationPosition(double latitude, double longitude, double accuracy)
public void setMockGeolocationError(int code, String message)
public void setMockGeolocationPermission(boolean allow)
public void setMockDeviceOrientation(boolean canProvideAlpha, double alpha, boolean canProvideBeta, double beta, boolean canProvideGamma, double gamma)
public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
onKeyMultiple
in interface WebViewProvider.ViewDelegate
public boolean onKeyPreIme(int keyCode, KeyEvent event)
public boolean onKeyDown(int keyCode, KeyEvent event)
onKeyDown
in interface WebViewProvider.ViewDelegate
public boolean onKeyUp(int keyCode, KeyEvent event)
onKeyUp
in interface WebViewProvider.ViewDelegate
public void selectAll()
public boolean copySelection()
public void cutSelection()
public void pasteFromClipboard()
public void onAttachedToWindow()
onAttachedToWindow
in interface WebViewProvider.ViewDelegate
public void onDetachedFromWindow()
onDetachedFromWindow
in interface WebViewProvider.ViewDelegate
public void onVisibilityChanged(View changedView, int visibility)
onVisibilityChanged
in interface WebViewProvider.ViewDelegate
public void onWindowFocusChanged(boolean hasWindowFocus)
onWindowFocusChanged
in interface WebViewProvider.ViewDelegate
public void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect)
onFocusChanged
in interface WebViewProvider.ViewDelegate
public boolean setFrame(int left, int top, int right, int bottom)
setFrame
in interface WebViewProvider.ViewDelegate
public void onSizeChanged(int w, int h, int ow, int oh)
onSizeChanged
in interface WebViewProvider.ViewDelegate
public void onScrollChanged(int l, int t, int oldl, int oldt)
onScrollChanged
in interface WebViewProvider.ViewDelegate
public boolean dispatchKeyEvent(KeyEvent event)
dispatchKeyEvent
in interface WebViewProvider.ViewDelegate
public boolean onHoverEvent(MotionEvent event)
onHoverEvent
in interface WebViewProvider.ViewDelegate
public boolean onTouchEvent(MotionEvent ev)
onTouchEvent
in interface WebViewProvider.ViewDelegate
public boolean onGenericMotionEvent(MotionEvent event)
onGenericMotionEvent
in interface WebViewProvider.ViewDelegate
public void setMapTrackballToArrowKeys(boolean setMap)
setMapTrackballToArrowKeys
in interface WebViewProvider
public boolean onTrackballEvent(MotionEvent ev)
onTrackballEvent
in interface WebViewProvider.ViewDelegate
public void flingScroll(int vx, int vy)
flingScroll
in interface WebViewProvider
@Deprecated public View getZoomControls()
getZoomControls
in interface WebViewProvider
public boolean canZoomIn()
WebView#canZoomIn()
canZoomIn
in interface WebViewProvider
public boolean canZoomOut()
WebView#canZoomOut()
canZoomOut
in interface WebViewProvider
public boolean zoomIn()
WebView.zoomIn()
zoomIn
in interface WebViewProvider
public boolean zoomOut()
zoomOut
in interface WebViewProvider
public boolean requestFocus(int direction, Rect previouslyFocusedRect)
requestFocus
in interface WebViewProvider.ViewDelegate
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
onMeasure
in interface WebViewProvider.ViewDelegate
public boolean requestChildRectangleOnScreen(View child, Rect rect, boolean immediate)
requestChildRectangleOnScreen
in interface WebViewProvider.ViewDelegate
public WebViewCore getWebViewCore()
protected void pageSwapCallback(boolean notifyAnimationStarted)
public void setBackgroundColor(int color)
setBackgroundColor
in interface WebViewProvider.ViewDelegate
public void setHTML5VideoViewProxy(android.webkit.HTML5VideoViewProxy proxy)
public void setTouchInterval(int interval)
protected void contentInvalidateAll()
public void discardAllTextures()
public void setLayerType(int layerType, Paint paint)
setLayerType
in interface WebViewProvider.ViewDelegate
public void tileProfilingStart()
public float tileProfilingStop()
public void tileProfilingClear()
public int tileProfilingNumFrames()
public int tileProfilingNumTilesInFrame(int frame)
public int tileProfilingGetInt(int frame, int tile, String key)
public float tileProfilingGetFloat(int frame, int tile, String key)
public static void setShouldMonitorWebCoreThread()
public void dumpViewHierarchyWithProperties(BufferedWriter out, int level)
dumpViewHierarchyWithProperties
in interface WebViewProvider
public View findHierarchyView(String className, int hashCode)
findHierarchyView
in interface WebViewProvider