Commit Graph

3324 Commits

Author SHA1 Message Date
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
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
fad2e49c42 Merge "Add WebView permission MIDI sysex" into mnc-dev 2015-07-07 10:15:17 +00:00
Tao Bai
8965377b69 Add WebView permission MIDI sysex
Change-Id: I0d27e8ca48ee35b02dddc5d85ecfebfdaa3ec8cb
2015-06-23 11:05:59 -07:00
Selim Gurun
a679ac59a1 Clarify handling client certificates
Bug: 21910771

Clarify handling client certificates when using a webview. This is a
documentation change only.

Change-Id: Ida78bd89aa8867c99b4b9e4433e342767e9bac0d
2015-06-22 10:04:01 -07:00
Gustav Sennton
d973018221 Revert "Load WebView from one out of a list of packages."
This was not a clean revert!

This reverts commit 2ed6fee15c.
We essentially only revert the functionality for going through a list of
WebView package names and picking the first compatible one.
Except for that functionality we also fetched the name of the shared
library from a flag in WebView and made some minor refactoring in the
initial commit, these changes have been left alone in this revert.

Bug: 21893371
Change-Id: Idb2539dc33cc5f9e2894ecd665c23573c6cba9f3
2015-06-19 11:38:56 +01:00
Simon Baldwin
519919b0d4 Make apk entry separator compliant with jar url format
Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I4106dd82aeb5d7d66c9988be6e8c8726c78ae08c
2015-06-11 17:09:49 +01:00
Paul Miller
c8694a082a Deprecate WebView scrollbar overlay API
Deprecate setHorizontalScrollbarOverlay, setVerticalScrollbarOverlay,
overlayHorizontalScrollbar, and overlayVerticalScrollbar. They've been
no-ops for years, ever since WebViewChromium.

BUG:21642246
Change-Id: Ia1062c53fdbaa7a0d282ba79da733a6f3b9ac84f
2015-06-09 11:48:01 -07:00
Selim Gurun
50b26a5c27 Remove ViewAssistStructure and use the frameworks data structure
As part of the API rename from ViewAssistStructure to ViewStructure,
we added a temporary workaround to prevent build breakage. Remove
the temporary workaround since the current unbundled webview package
implements the updated  onProvideVirtualStructure API.

Change-Id: I13a5b8dee3e856eb585de53a0750bd52c7a909a7
2015-06-01 23:41:12 +00:00
James Cook
5cfaae4aae assist: Fix reported colors/styles for TextView/Switch
Changes to the data provided to AssistStructure:
* Text foreground color is correct even if the view has not yet been
painted.
* Text background color is now always 1 (TEXT_COLOR_UNDEFINED) for a
TextView, as it has no separate concept of background color.
* Switch now reports the text size/color/style of the label text
(usually user visible) rather than the on/off text on the button
itself (usually hidden in Material, and not usually revelant when
visible).

Bug: 21080375
Change-Id: I7e15f68d89510a76cab76031c2c8ca6ca3f32435
2015-05-28 15:52:44 -07:00
Selim Gurun
98fe09cba0 Clean remaining API related issues.
Bug:21063767
Change-Id: Ifb6936699367b4cc1641b74c890856c0b51978d2
2015-05-21 17:56:58 -07:00
Dianne Hackborn
2d9c6015b3 Merge "Fix issue #20679383: Add text style to assist.ViewNode..." into mnc-dev 2015-05-19 18:26:28 +00:00
Dianne Hackborn
02beb41c97 Fix issue #20679383: Add text style to assist.ViewNode...
...from text nodes in WebView

Add a new explicit API for setting the text style information associated
with a view structure.

Also, how about some documentation!

Change-Id: Ia948b2d66382b973d0d00a67172a281ad55ce592
2015-05-19 11:18:16 -07:00
Yohei Yukawa
c2cc6fff1b Merge "Keep IMM#mCurRootView synchronized with the actual window focus." into mnc-dev 2015-05-19 16:52:26 +00:00
Simon Baldwin
128b3c86c6 Merge "Handle load from APK correctly for shared relro" into mnc-dev 2015-05-18 14:57:22 +00:00
Simon Baldwin
b98082dcfb Handle load from APK correctly for shared relro
Update WebViewFactory's shared relro handling so that it operates
correctly where libraries are loaded directly from APK files.

Bug: http://b/20810492
Bug: http://b/8076853
Change-Id: I7887c7c0f235388d6a40c366693563b4876de992
2015-05-18 15:56:27 +01:00
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
Yohei Yukawa
5f05965f54 Keep IMM#mCurRootView synchronized with the actual window focus.
Currently IMM#mCurRootView is always cleared every time when
IMM#finishInputLocked() is called.  We have been doing this since
Iad09cf5dbb7f6f156fd39ed243431432e00f8945 so as not to hold the
strong reference to a DecorView so long time (Bug 6413553).

Strictly speaking, the attached window may continue holding
input focus even after IMM#finishInputLocked() is called.
In this state IMM#focusIn() might have unexpectedly rejected
focus-in event but presumably this might not be obvious, or might
not occur at all because in some situations IMM#finishInputLocked()
has never been called even when the attached view loses input
focus.

In order to fix Issue 20820914, however, we need to call
IMM#finishInputLocked() exactly when the attached view loses
input focus.  To make it easier to diagnose any unexpected
regressions, this CL only changes the handling of
IMM#mCurRootView, while the next CL Id6afc8fc64512225578c62557b96
plumbs IMM#focusOut() to IMM#finishInputLocked().

Manually tested following scenarios.
- Repro steps in Bug 6413553.  Made sure that IMM#mCurRootView
  is cleared after switching back from the current application to
  the previous application with back key.
- Test application that calls WebView#showFindDialog(). Made sure
  that LatinIME works fine when switching text fields.  This is
  non-trivial because android.webkit.FindActionModeCallback is
  changed in this CL.
- Repro steps in Bug 21144633.  Made sure that we can enter
  recipient's name in the messaging app.

Bug: 20820914
Change-Id: I219394178e4172bc47864297f1418e677dba25e5
2015-05-15 10:22:23 -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