Commit Graph

3371 Commits

Author SHA1 Message Date
Hui Shu
ecdce961ea Support for webview drag and drop
WebView needs to override onDragEvent to accept drops from other apps.

BUG: 27039417
Change-Id: Ie81c5ac325091cf78440785e04afcc01ddcbaab3
2016-02-20 01:51:14 +00:00
Selim Gurun
e542c490e1 Merge "Better document the ignore behavior for client cert api" into nyc-dev 2016-02-16 22:17:42 +00:00
Selim Gurun
977d943494 Better document the ignore behavior for client cert api
Bug: 26361557

When the embedded app requests a ignore of a client cert request,
webview does not cache the response of the app. However, underlying
layers could. Clarify the document.

Change-Id: I43e6a4c91727f71c88ca69e1334f64de9f66905a
2016-02-16 12:30:08 -08:00
Gustav Sennton
14c033c76b Move current WebView provider from Settings.Secure to Settings.Global
The current WebView provider is not user-specific and should therefore
be stored as a Global rather than a Secure setting.

Also do some code cleaning including a fix in WebViewProviderInfo to
always fetch up-to-date information about whether a webview
implementation package is enabled.

Bug: 27142972
Change-Id: I4d4b8fca775e97980fb5c34313be6d82472e7d33
2016-02-11 18:19:39 +00:00
Selim Gurun
c20ba757cb Merge "Provide a way to supply different algorithms for token binding key" 2016-01-22 22:52:51 +00:00
Selim Gurun
57a8d2ae31 Provide a way to supply different algorithms for token binding key
Bug: 22665752

The user of the API can provide different algorithms for key generation.
The API should also provide information about which algorithm is
used for generating the key.

Change-Id: I1d671ba351ca495b031b159132f33291a4f33aac
2016-01-22 14:50:42 -08:00
Tim Volodine
6f2f360610 Merge "Add Service Worker settings and callback support in WebView." 2016-01-22 19:09:24 +00:00
Gustav Sennton
444280d228 Merge "Fetch WebView package even if it is uninstalled for the current user." 2016-01-22 19:00:37 +00:00
Tim Volodine
28c8356441 Add Service Worker settings and callback support in WebView.
Service Workers are not tied to WebView instances so currently
there is no mechanism to capture callbacks originating from
within Service Workers.

This patch adds the necessary classes to capture callbacks
and allows to set settings specifically for Service Workers.

The main idea is that to control service workers the embedding
app would obtain an instance of ServiceWorkerController using
ServiceWorkerController.getInstance() first. After that it would
be able to set a custom ServiceWorkerClient and change
ServiceWorkerWebSettings via the controller object.

BUG: 22709088
Change-Id: I0eb17be46b767851676b77a94757771611fa3a1b
2016-01-22 18:55:39 +00:00
Gustav Sennton
b1e45cd0b5 Fetch WebView package even if it is uninstalled for the current user.
Since the WebView loading mechanism is global - it doesn't differ
between different users, a user for which the current WebView provider
is uninstalled won't be able to fetch any information about the current
provider without passing a certain flag (MATCH_UNINSTALLED_PACKAGES) to
the package manager.

Bug: 26677081
Change-Id: Id1b86164bb22fc7285d292da1b1115fb25e4d226
2016-01-22 11:59:40 +00:00
Selim Gurun
a5171370f2 Add the system apis for token binding
Bug: 22665752

Token binding protocol is the next generation channel-ID protocol,
currently it is a draft in IETF
 https://tools.ietf.org/html/draft-ietf-tokbind-protocol-03

Add the api as a system api (will be public once the draft finalizes)

Change-Id: If971cc7e6d14f15c778b9b027df9fc48dac0160c
2016-01-20 14:26:46 -08:00
Selim Gurun
504b81b02c Revert "Revert "Add the TokenBindingManager""
This reverts commit d1ec6356b3.

Change-Id: I75e4d9226808a30532f5c593123e59b78cd1e761
2016-01-15 21:10:52 +00:00
Selim Gurun
d1ec6356b3 Revert "Add the TokenBindingManager"
This reverts commit 57eb3264c9.

Change-Id: Ie74b64a181eb08dbfa1aeca99322be377e9f1d9c
2016-01-15 20:34:02 +00:00
Selim Gurun
57eb3264c9 Add the TokenBindingManager
Bug: 22665752

Add the webview APIs to manage token binding protocol keys.

Change-Id: Ie2eae543869b1ae91cdb4e70217c28b9a8a465cf
2016-01-15 10:19:38 -08:00
Gustav Sennton
1075d812f6 Merge "Fix WebView loading logic to allow changing provider if current disabled" 2016-01-11 18:43:05 +00:00
Jeff Sharkey
c5967e9862 More progress on triaging PackageManager callers.
Catch a bunch of simple cases where the PackageManager flags are
obvious.  Add the ability to use the MATCH_SYSTEM_ONLY flag on
PackageInfo and ApplicationInfo queries.

Re-examine recent tasks after a user is unlocked, since some of the
activities may now be available and runnable.

Bug: 26471205, 26253870
Change-Id: I989d9f8409070e5cae13202b47e2c7de85bf4a5b
2016-01-08 16:10:33 -07:00
Gustav Sennton
472a566956 Merge "Add missing traces for WebView loading steps." 2016-01-08 13:47:14 +00:00
Gustav Sennton
fc424478a9 Add missing traces for WebView loading steps.
Ever since the refactoring of WebViewFactory - to support using one out
of a list of WebViewProviders - we cover less of the loading code with
traces, this CL fixes this.

Bug: 26409579

Change-Id: I9d74321806037ea34a5ace8fc75b07ca771ab7d9
2016-01-08 13:25:59 +00:00
Paul Miller
167a623c45 Merge "Document WebView Metrics opt out API" 2016-01-07 21:36:06 +00:00
Hui Shu
89eb9b4540 Deprecate setGeolocationDatabasePath because it is no-op since KitKat
Also updated the documentation of setGeolocationEnabled.

BUG: crbug.com/507505
Change-Id: I5f4bb38189338f58dcd4c1ba0310493aeac5cbd2
2016-01-07 11:47:30 -08:00
Paul Miller
a469218d07 Document WebView Metrics opt out API
BUG:22665268
Change-Id: Ib2f7b2a340e27d7d3faf5bfbf6c2216d3c1549e4
2016-01-07 11:32:15 -08:00
Gustav Sennton
27f13de12b Fix WebView loading logic to allow changing provider if current disabled
Add an XML tag declaring whether a package can be used without
explicitly being chosen by the user (it is available-by-default).

Change the WebView loading logic to either
1. load a user-chosen and enabled package or
2. load an enabled and available-by-default package or
3. any package that is valid

Bug: 26400585
Change-Id: I8de253c1687e3cc7961184c2d770d4e385d6187a
2016-01-06 14:43:14 +00:00
Gustav Sennton
5c2454cde1 Allow several valid signatures per WebView provider.
If one of the signatures match the package signature the package is
considered valid. This makes it possible to match signatures in user
builds for both signed and unsigned builds.

Bug: 26220882

Change-Id: Ie2e7567bf518d4859d68b5fdf5b9833fcdaa7670
2015-12-17 17:10:01 +00:00
Gustav Sennton
6258dcd7ea Add functionality for changing WebView provider.
Make it possible to change WebView provider (through a Developer
setting) and kill all apps using the old provider.
This includes checking the signatures of the WebView providers to make
sure they are valid.

Now that we can change WebView provider through a setting it is possible
to change provider while some provider is being updated. Because of this
we now keep track of which provider should be in use in
WebViewUpdateService to make sure we use the correct provider at all
times.

We now also read WebView package meta data (name, package name, and
signature) from a separate xml file.

Main bug: crbug.com/546185

Bug: 25338573

Change-Id: I660fd1a40a5388f6569a06a7f0d029e8ff65945a
2015-12-11 14:29:44 +00:00
Neil Fuller
71fbb81b14 Fix @code escapes
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
2015-12-02 14:24:11 +00:00
Yohei Yukawa
777ef95ebf Use Context.getSystemService(Class<T>) for InputMethodManager.
This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving
InputMethodManager.  Note those are bundled code.  Hence we don't need
to make sure Build.VERSION.SDK_INT >= 23.

Change-Id: Icc64942ad8f11e44bf84f8d4fe476b2fdd1257f3
2015-11-26 00:02:05 -08:00
Tao Bai
dd337646a9 Using addAssetPathAsSharedLibrary to load asset.
This will alllow framework to overrdie the resource id even the
package resource is app.

Change-Id: I176166e7c51ceb5e84101deb3f467a826f484251
2015-11-06 14:43:12 -08:00
Gustav Sennton
8966460103 Merge "Load WebView from one out of a list of packages, reland." 2015-11-03 17:50:07 +00:00
Mikhail Naganov
9daceaf609 Small update to WebResourceRequest.isRedirect
Specify that 'isRedirect' is only true for server-side redirects.

Bug: 22346196
Change-Id: I9a8c31476c796265f554327dfff46778c5f84399
2015-11-02 15:38:29 -08:00
Mikhail Naganov
b851929c32 Add new version of WebViewClient.shouldOverrideUrlLoading callback
The new version provides more information about the origin of
the load, which helps making more secure decision on how to proceed
with it.

Bug: 22346196
Change-Id: I27f591bf5e846bde14335a2c929758a2b48d0763
2015-10-28 16:05:41 -07:00
Gustav Sennton
6ce92c9362 Load WebView from one out of a list of packages, reland.
Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow Chrome to provide the WebView implementation.

Change-Id: I71813825cd977a72ff4535a39a97a12565ec8a09
2015-10-27 18:47:21 +00:00
Hui Shu
227a8c1df2 Add the APIs for customizing WebView action mode menu actions
We will allow apps to disable Share, Web Search, and text
processing related menu actions.

The default actions like cut, copy, paste cannot be disabled.

BUG: 22772178
Change-Id: I8429454f71f74a99298f412862cd32d8fba93784
2015-10-22 15:35:59 -07:00
Hui Shu
fb78ae50b5 Merge "Format the Javadoc using <p>" 2015-10-08 22:23:03 +00:00
Hui Shu
86ea9c1479 Format the Javadoc using <p>
Change-Id: I3c1ecf2f381e227cd413d6f3760a105ec521f807
2015-10-08 10:23:08 -07:00
Hui Shu
f119c5208f Allow WebView to startActivity and receive results
This CL makes webview override View#onActivityResult and gives webview
itnernals the access to View#startActivityForResult.

BUG: 24416313
Change-Id: Ia49db1348a1f5ee0c648a8b16551d9becc7caddd
2015-10-08 10:20:15 -07:00
Mikhail Naganov
b29e0f6960 WebView: add a note to the doc of WebView.loadDataWithBaseURL
Add a note that the base URL can be sent to servers in
the 'Referer' HTTP header.

Bug: crbug.com/506592
Change-Id: Idf77e898645fe130ad569bd266b61257c4f0e3b3
2015-09-16 13:05:53 -07:00
Torne (Richard Coles)
c0ae136be9 am 447da857: am e869b398: am 20272bec: am c207c943: am c5283927: Close ZipFiles correctly in WebViewFactory.
* commit '447da857463a80c83ae60857ddfaf61497db1ee1':
  Close ZipFiles correctly in WebViewFactory.
2015-08-10 16:27:05 +00:00
Torne (Richard Coles)
447da85746 am e869b398: am 20272bec: am c207c943: am c5283927: Close ZipFiles correctly in WebViewFactory.
* commit 'e869b3981506537dabbd1011df94f1e69ce84495':
  Close ZipFiles correctly in WebViewFactory.
2015-08-10 16:21:56 +00:00
Torne (Richard Coles)
c52839277b Close ZipFiles correctly in WebViewFactory.
We weren't closing the ZipFiles created in WebViewFactory to check
inside APKs - use try-with-resources to get them closed automatically.

Bug: 23072621
Change-Id: I11c6b77e960a7d240d19d22240cac177b6ba27b2
2015-08-10 16:40:50 +01:00
Selim Gurun
922cb58b65 Update onPause documentation
onPause() method documentation wrongly claims it stops JS. This could
have been true for very early implementations of Webview which does
not use V8 (pre-honeycomb) however it is not the case anymore
since V8 does not provide a way to stop JS safely for a particular Webview.

Change-Id: I6363dc2ef47c463da6baa417832da750225f5cf2
2015-07-31 14:02:57 -07:00
Tim Volodine
765fed146c am cd183953: am 15a4320e: am 2f6d6742: am 91b31b53: Merge "Revert "Invoke geolocation permissions callback with denied state by default."" into mnc-dev
* commit 'cd1839538f83b371716579b895bfadb1fda43dc9':
  Revert "Invoke geolocation permissions callback with denied state by default."
2015-07-27 18:19:02 +00:00
Tim Volodine
4961105a7d Revert "Invoke geolocation permissions callback with denied state by default."
This reverts commit 954d1333c4.

The revert is due to apps calling super.onGeolocationPermissionsShowPrompt see b/22685046

Bug: 22685046
Change-Id: I2a9f42b432a010828a0cafaee064480bb0f91cbe
(cherry picked from commit 0bb7d2e467)
2015-07-27 16:20:29 +00:00
Tim Volodine
08a38b68e9 Merge "Revert "Invoke geolocation permissions callback with denied state by default."" 2015-07-23 17:27:27 +00:00
Tim Volodine
0bb7d2e467 Revert "Invoke geolocation permissions callback with denied state by default."
This reverts commit 954d1333c4.

The revert is due to apps calling super.onGeolocationPermissionsShowPrompt see b/22685046

Change-Id: I2a9f42b432a010828a0cafaee064480bb0f91cbe
2015-07-23 17:16:16 +00:00
Mikhail Naganov
c39fb7e7a2 am 64a57dc1: am 4204ed96: am fa85a888: am abb8dc97: Merge "Enhance documentation of WebSettings.WebSettings method" into mnc-dev
* commit '64a57dc1b3caffc0fedbb670f0e93b3a6ef58176':
  Enhance documentation of WebSettings.WebSettings method
2015-07-09 17:59:37 +00:00
Mikhail Naganov
550f621aaf Enhance documentation of WebSettings.WebSettings method
Add a note about WebView reloading the page if the UA string is change
during loading. See crbug.com/315891.

Bug: 22325430

Change-Id: I04f5ab703fd2dcedf0709e4aa1d17b1204df355b
2015-07-07 13:39:48 -07:00
Richard Coles
4683bea8b6 am 2ec1f9d5: am 604e0cc7: am 2bb68288: am fad2e49c: Merge "Add WebView permission MIDI sysex" into mnc-dev
* commit '2ec1f9d594f0c5f95db08cbf04830b854e6c701c':
  Add WebView permission MIDI sysex
2015-07-07 17:34:17 +00:00
Richard Coles
fad2e49c42 Merge "Add WebView permission MIDI sysex" into mnc-dev 2015-07-07 10:15:17 +00:00
Narayan Kamath
c279a835d5 am 37c68894: am a78c0e0b: Merge "Fixed Javadoc typos"
* commit '37c688948d4464d636cd64c537b98697cb4b795d':
  Fixed Javadoc typos
2015-06-25 10:02:08 +00:00
Philipp Hasper
802aa0f8a2 Fixed Javadoc typos
Simple single character typos

Change-Id: I17660dbb3b7ee6597637e8d76770f434ebf202ea
2015-06-25 08:09:43 +00:00