Commit Graph

3307 Commits

Author SHA1 Message Date
Selim Gurun
26de90aa2e Rename PostMessageToMainFrame to PostWebMessage
Bug: 20557074

There is no need to keep the name PostMessageToMainFrame since
we may choose to not implement the special condition to posting
to a named subframe. And if we want, we can do this by overloading
the function.

Change-Id: I9896ad479e1c30cda500352cfdb1b7d336383568
2015-05-15 11:02:45 -07:00
Mikhail Naganov
6162eafe7a Tiny fix after updating the error reporting API
Temporarily make WebResourceError.getDescription() non-abstract
so the current version of WebView doesn't crash on it.

Bug: 20064008, 21063767
Change-Id: I15a1abb5df76263006d14eb589fe0076d5aac582
2015-05-14 13:30:13 -07:00
Wale Ogunwale
159c3d8a8b Revert "Update IME focus when the active view is losing the focus."
This reverts commit 97c3813042.

This causes issue with the right IME window getting focus.

Bug: 21144633
Change-Id: I4c75b6e7dd87c10f008444d2059164b52a8f4335
2015-05-14 12:25:24 -07:00
Mikhail Naganov
8d4f07f8d3 Update the new error reporting API in android.webkit
- minor changes in WebResourceError;
 - prepare to remove WebResourceResponseBase;
 - add immutable mode to WebResourceResponse.

Bug: 21063767

Change-Id: Iaf5f92e3850732c7a888453468e108809b3b782a
2015-05-13 18:40:20 -07:00
Selim Gurun
af9d60af0d Merge "Address API feedback for PostMessage" into mnc-dev 2015-05-13 22:37:02 +00:00
Yohei Yukawa
5ad7fe4930 Merge "Update IME focus when the active view is losing the focus." into mnc-dev 2015-05-13 22:10:37 +00:00
Selim Gurun
0a814b61e3 Address API feedback for PostMessage
Bug: 21043955

Add anchor tags, and hide the constructor for WebMessagePort.

Change-Id: Ibd2e15581c06be9015a3cd7c7741edf6657d4552
2015-05-13 14:14:14 -07:00
Hui Shu
d377c0f6ca Address API council feedback for setOffscreenPreRaster.
BUG: 21043955
Change-Id: I6481f5f84c9e00c16caeb2d9e175aa869600c715
2015-05-13 12:01:42 -07:00
Tobias Sargeant
ebc456691e Merge "Improve documentation and rename insertVisualStateCallback to postVisualStateCallback." into mnc-dev 2015-05-13 11:33:18 +00:00
Tobias Sargeant
b365604977 Improve documentation and rename insertVisualStateCallback to postVisualStateCallback.
Bug: 21043955
Change-Id: I077cad68fb519581387d1b474f27d43222f68e3b
2015-05-13 11:23:57 +01:00
Selim Gurun
0b408586c6 Add a temporary wrapper for ViewStructure until Webview APK is updated
It turned out that after the API change from ViewAssistStructure to
ViewStructure, the suggested mechanism did not work, and webview
started throwing abstractmethoderror exceptions. Temporarily
solve the problem by wrapping ViewStructure inside a
ViewAssistStructure. Once Webview APK is updated, drop it.

Change-Id: I09dfe7dac9c2bc7c037d842844c61dd879629470
2015-05-12 18:06:59 -07:00
Yohei Yukawa
97c3813042 Update IME focus when the active view is losing the focus.
Despite the fact that IMM#focusOut() are called from many focus
mangement logics, the reality is that IMM#focusOut() has done
nothing more than 6 years.  This would not a big problem as long
as IMM#focusIn() is called immediately after IMM#focusOut().

However, situations where only IMM#focusOut() is called,
following fields continue keeping object references.
- IMM#mServedView
- IMM#mNextServedView
- IMM#mServedInputConnection
- IMM#mServedInputConnectionWrapper

Even worse, if the IME is showing software keyboard, it will not
be dismissed.

With this CL, IMM#focusOut() starts cleaning up the active IME
session when the associated view loses focus.

This CL also removes IMM#mCurRootView because it is indeed
necessary for above change.  The problem when only introducing
above change can be understood as follows.

1. IMM#mCurRootView is correctly set from ViewRootImpl.
2. IMM#focusIn() is called. InputConnection is established.
3. IMM#focusOut() is called, which triggers
   IMM#finishInputLocked() because of above change, which
   internally clears IMM#mCurRootView.
4. IMM#focusIn() is called but IMM#mCurRootView is still null.
   Because of this the focus-in event is ignored and the
   software keyboard does not show up anymore.

In this CL, we simply check view.hasWindowFocus() instead.
As far as I've tested, this change looks to be working well.

Bug: 20820914
Change-Id: Ib4bd70ce0305a6bde6a929bcc6ad20a2b8402a97
2015-05-12 01:43:27 -07:00
Dianne Hackborn
ed9af066b2 Merge "Fix issue #20655182: API Review: ViewAssistStructure" into mnc-dev 2015-05-08 20:42:12 +00:00
Siva Velusamy
94a6d15ede Use new hierarchy viewer protocol in all View subclasses
A previous CL introduced a new way of encoding view properties for
use by heirarchy viewer. This CL updates all views using the old
@ExportedProperty annotation to use this new method. The older
mechanism will be removed in a subsequent CL.

Change-Id: I6cc23b90cd9da1c6ce89b4caffe54874db203452
2015-05-07 18:44:21 -07:00
Dianne Hackborn
49b043f37d Fix issue #20655182: API Review: ViewAssistStructure
Fix the various view assist related APIs.

Also remove the blockAssist view attribute, and instead use
the window's FLAG_SECURE to drive blocking of the entire
hierarchy (which is semantically correct, and will protect
existing apps that have already indicated they need it).

Change-Id: I6beebc86b202809cba0a356cae9607d8d0fb5e78
2015-05-07 16:30:52 -07:00
Gustav Sennton
f2953dadbb Merge "Add system API method for loading webview library from another package." 2015-04-24 09:27:19 +00:00
Joe Fernandez
78cb6f5458 am 1009c8de: am 92ae292e: Merge "docs: Add text to JavaDocs regarding browser file access vulnerability" into lmp-mr1-ub-docs
* commit '1009c8de23920c4a368edf7f1e2ecde63e40ec82':
  docs: Add text to JavaDocs regarding browser file access vulnerability
2015-04-23 17:57:02 +00:00
Joe Fernandez
22b5ba8c01 docs: Add text to JavaDocs regarding browser file access vulnerability
b/17420682

Change-Id: Ic03b51778280570be65ae933fd906b140acdf023
2015-04-22 17:29:12 -07:00
Gustav Sennton
85edb6c6bf Add system API method for loading webview library from another package.
Add method for loading the shared webview library so that several
packages can make use of it. Also add error codes making it possible
to inspect the reason for failing to load the library.

Change-Id: Ic0833d5d122bae488d380e4e10dd81126bd2358e
2015-04-20 18:04:03 +01:00
Gustav Sennton
a8366e78b5 Fix loading of null webview if there is no webview package.
In the change in go/ag/672863 we throw an AndroidRuntimeException
instead of a PackageManager.NameNotFoundException when no webview
package exists. This should break devices not using webview since
the NameNotFoundException is used to detect webview not being present
(so that the null webview can be loaded instead). In this patch we
create a new type of exception and look for that one instead when we
want to determine whether the device should or should not have webview
installed.

Change-Id: Ia75dec718d7a5b2c3517671c54be3950badb8bba
2015-04-20 14:56:23 +01:00
Gustav Sennton
c82a99d5f7 Merge "Load WebView from one out of a list of packages." 2015-04-16 10:14:04 +00:00
Selim Gurun
30982c778d Enable onProvideVirtualAssistStructure API
Bug: b/19771298

onProvideVirtualAssistStructure API was hardwired to call the super
method prevent any crashes when assist gesture is used. Enable it.

Change-Id: I333f9f024ffb34af6a2cfa7e4b66ae233d73eb41
2015-04-14 14:20:45 -07:00
Gustav Sennton
2ed6fee15c Load WebView from one out of a list of packages.
Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow a future version of Chrome to provide the WebView
implementation.

Change-Id: I42e900f0e63152188ebfcff9e39e0d9a99bc6c90
2015-04-14 12:14:51 +01:00
Gustav Sennton
1b4edc9068 Merge "Revert "Load WebView from one out of a list of packages."" 2015-04-14 10:59:35 +00:00
Gustav Sennton
9915eb56fe Revert "Load WebView from one out of a list of packages."
This reverts commit fe320b2fe9.
We need to check in a new Webview APK first.

Change-Id: Ica6adef7a1e68c06b4c6a6a3c851f40f56b006ef
2015-04-14 10:48:05 +00:00
Gustav Sennton
75f4b76638 Merge "Load WebView from one out of a list of packages." 2015-04-14 09:46:10 +00:00
Gustav Sennton
fe320b2fe9 Load WebView from one out of a list of packages.
Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow a future version of Chrome to provide the WebView
implementation.

Change-Id: Id63a31396c8c0afbfd250f43a256ccd5981f7a56
2015-04-08 17:45:22 +01:00
Selim Gurun
7e01c4ceb6 Fix Google app crash
Bug: 20110378

Until chromium imlementation lands, use the base implementation.

Change-Id: Icd8e83503770471219718fb38a131938b1bbf0c2
2015-04-07 18:40:14 -07:00
Selim Gurun
1b650cb6f9 Add the Assist support to Webview
Bug: 19771298

Implement the Webview API to provide assist data. Webview assist
data is provided asynchronously.

Change-Id: I2fbf3e5ce7779ba6664dfbc6a702880fe71d5126
2015-04-06 20:13:37 -07:00
Selim Gurun
fc90c05649 Remove unnecessary code
Bug: 19313118

As part of the "better error reporting for Webview" work, a new public
API was defined for MNC release to report blocked loads. However,
we decided to use WebChromeClient.onConsoleMessage for this case.
Removing the API.

Change-Id: I1a599385f1ecdd10ba5a774b0b2a6b9f4bdcbd95
2015-03-30 16:41:06 -07:00
Tim Volodine
6e3d794b90 Merge "Invoke geolocation permissions callback with denied state by default." 2015-03-27 16:45:26 +00:00
Tim Volodine
954d1333c4 Invoke geolocation permissions callback with denied state by default.
For apps that use WebView but don't override
WebChromeClient.onGeolocationPermissionsShowPrompt the callback should
be invoked with allow set to false by default. This ensures that
the error handler callback in JavaScript is invoked in this case (with
the "User denied Geolocation" error). Currently no callbacks are invoked
at all by default (see http://crbug.com/470500).

Change-Id: I49664906b8cfa6910106c8da1b21b99628adacfc
2015-03-25 12:12:37 +00:00
Bo Liu
17a7989904 Remove debug logging from WebView
Moving them to chromium:
https://codereview.chromium.org/1022993002/

Change-Id: I6a9294b7041e9768397a624e5c174b22f4085e87
2015-03-19 14:19:29 -07:00
Chris Craik
43c410eaac Merge "Remove HardwareCanvas" 2015-03-18 21:36:56 +00:00
Tobias Sargeant
a8352f4031 Add visual state callbacks to the WebView.
Registering a visual state callback allows the caller to be notified
after the commit, activation and swap of the current (or future) state
of the DOM tree has occurred. At the point at which the callback is
called, the caller can be sure that any DOM updates made prior to
the registration are ready to be drawn in the next WebView#onDraw.

We also provide a convenience callback related to the visual state:

* WebViewClient.onPageCommitVisible; called at the earliest point at
  which the next draw will not render contents from the previously
  loaded page.

Bug: 6375170
Change-Id: I17e706b6e6ba4a8c28c835552687c9f7a4623024
2015-03-17 15:19:07 +00:00
Hui Shu
d7c7e566aa Merge "Add API for WebView OffscreenPreRaster setting." 2015-03-13 00:38:47 +00:00
Hui Shu
b1ee70b149 Add API for WebView OffscreenPreRaster setting.
BUG: 19592029
Change-Id: Ic903b823e5f7830e2cf2d4f3dd9a5458334648a3
2015-03-12 16:04:07 -07:00
Selim Gurun
4c8093afe3 Implement PostMessage API for Webview
Bug: 10237116

This CL implements the postmessage API for webview. It provides
a way for java applications to post messages to JS frames and
establish message channels, and then do full-duplex communication
after that.

Change-Id: Idbc2918552a4c9fd28ae1ddf19bd360e71f8a4a2
2015-03-11 10:21:59 -07:00
Chris Craik
f6829a0a61 Remove HardwareCanvas
Change-Id: I239646a7f00f09d3f76fe6b6162eed86bc0d6e77
2015-03-10 14:56:11 -07:00
Torne (Richard Coles)
8c1db3734f Merge "Fix typo in WebSettings javadoc." 2015-03-06 17:25:49 +00:00
Torne (Richard Coles)
2b666c96e2 Fix typo in WebSettings javadoc.
We accidentally repeated the same enum value twice; fixed to mention the
three values correctly.

Change-Id: Iba6a7edd8e1a5b429728056a8f56634427758c73
2015-03-06 14:20:00 +00:00
Mikhail Naganov
25e8954573 Provide better error reporting for WebView
Add new callbacks into WebViewClient that will provide notifications
about subresource loading errors and HTTP errors received from servers.

Bug: 19313118
Change-Id: Idb47f53ef7e72cb95f3e9b89d1e238d69e896b8b
2015-03-06 10:12:14 +00:00
Selim Gurun
545093df16 am 75666e90: Merge "Revert "Add potential future APIs for postmessage""
* commit '75666e9054d97a9daecd5648f71414406413c6d9':
  Revert "Add potential future APIs for postmessage"
2015-03-03 02:20:57 +00:00
Selim Gurun
49f9ad8e2a Revert "Add potential future APIs for postmessage"
This reverts commit 37bd8907cb.

Change-Id: Iaa9356b95859846ce9c3209d3d1bcfc800d2ff93
2015-03-03 01:54:25 +00:00
Ed Heyl
93cbe27804 Fix build: Revert "Add potential future APIs for postmessage"
This reverts commit 37bd8907cb.
2015-03-02 16:03:52 -08:00
Selim Gurun
61c5cf135d am 4de38166: am aef98356: am 9fc8356b: Merge "Add potential future APIs for postmessage"
* commit '4de38166c6dbc1108a64cf772abe61b6ddaa2804':
  Add potential future APIs for postmessage
2015-03-02 23:21:54 +00:00
Selim Gurun
aef983562a am 9fc8356b: Merge "Add potential future APIs for postmessage"
* commit '9fc8356baa7816a13e0c140788ccf67301cbd28d':
  Add potential future APIs for postmessage
2015-03-02 23:07:36 +00:00
Selim Gurun
37bd8907cb Add potential future APIs for postmessage
Bug: 10237116

The APIs are hidden while work is ongoing.

Change-Id: I3e2f06d6e41af276171b127f06bdd74924c2e74c
2015-03-02 14:53:01 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Narayan Kamath
3bdd327f85 Move apache specific portions of android.net.http to external/apache-http.
We continue to compile external/apache-http into ext.jar. This contains
a few changes apart fom the classes moving around :

- Makefile changes to build docs and api-stubs for now. A future change
  will revert these changes and remove these classes from stubs and
  docs.
- Hardcode event IDs in legacyerrorstrings to avoid a dependency between
  the frameworks and apache. These strings are on their way out and will
  never change anyway.
- Remove imports due to {@link} tags and use {@code} instead.
- Remove an accidental(?) dependency on apache commons code that's a
  part of apache-http.

bug: 18027885

Change-Id: I51cd038d846ec7d02c283a4541b10a6a9cf62ecf
2015-02-12 11:15:49 +00:00