Commit Graph

108 Commits

Author SHA1 Message Date
Simon Chae
5ed63f3cb8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2210: Allow setting custom webview instance 2019-02-27 16:58:29 -05:00
Sebastian Kaspari
c5c482eb26 [components] Update Robolectric to 4.2. 2019-02-20 19:20:42 -05:00
Arturo Mejia
c9b6d63781 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1814: Adding support for onJsConfirm dialogs in SystemEngine 2019-02-15 13:16:48 +01:00
Arturo Mejia
a3bf4c2287 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1815: Adding support for JavaScript prompts on SystemEngineView. 2019-02-06 13:33:24 -05:00
Christian Sadilek
1f554cafe5 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1944: Remove unneeded default arg of initWebView 2019-02-04 18:29:13 -05:00
Sebastian Kaspari
6f8df584a2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1915: Memory leak caused by long-lived WebView instance
Co-authored-by: Sebastian Kaspari <s.kaspari@googlemail.com>
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>

- The WebView instance is long-lived, as it's referenced in
SystemEngineSession, and we want to be able to keep engine
sessions around for the lifespan of the application.

- The WebView instance is created by the engine and using its
context (the application context).

- The EngineView, rendering engine sessions and WebViews,
is created using an activity context.

- The problem was that when the activity and EngineView were
destroyed, the WebView was not being detached and still
referenced the parent which referenced the activity context,
which would then not get gc'ed.

- We now detach the WebView when the EngineView is destroyed
and only destroy the WebView when the session is closed.

- This will allow re-using of engine sessions and their
WebViews in different activities and allow for proper
destruction.
2019-02-04 18:29:13 -05:00
Christian Sadilek
c369af6e2a [components] Issue https://github.com/mozilla-mobile/android-components/issues/1865: Fixes to upgrade to Kotlin 1.3.20 2019-01-28 18:41:13 +01:00
Arturo Mejia
b12ceb3930 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1816: Disable not implemented js prompts in SystemEngine. 2019-01-24 12:17:39 +01:00
Christian Sadilek
3d2ba10d9e [components] Closes https://github.com/mozilla-mobile/android-components/issues/1714: Support enabling tracking protection for session type 2019-01-16 13:26:32 -05:00
Arturo Mejia
d65452df54 [components] Refactoring PromptsFeature 2019-01-16 10:32:29 -05:00
Sebastian Kaspari
1a971da296 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1681 - Add ClipboardSuggestionProvider for providing URL suggestions from clipboard. 2019-01-15 18:52:17 +01:00
Mitchell Hentges
8fd19cdf3a [components] Moves description to be part of project.ext 2019-01-11 10:08:32 +01:00
Mitchell Hentges
3ee4d96a84 [components] Reads componentsVersion from .buildconfig.yml 2019-01-11 10:08:32 +01:00
Christian Sadilek
7b657c5e35 [components] Issue 1195: Remove webview if EngineView instance is reused 2019-01-09 16:44:01 -05:00
Arturo Mejia
ce63764f54 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1504: Add support for alert popup in WebView. 2019-01-08 13:39:42 -05:00
Christian Sadilek
9608430ed5 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1195: Move WebView reference to SystemEngineSession 2019-01-08 10:22:37 +01:00
Jonathan Almeida
32271e9935 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1629: System - Notify observers when desktop mode changes 2018-12-31 11:16:07 -05:00
Arturo Mejia
8cc1e37488 [components] Closes https://github.com/mozilla-mobile/android-components/issues/496: Adding support for html input types file for SystemEngine. 2018-12-24 12:45:30 -05:00
Sebastian Kaspari
af3cbeafb0 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1396: CustomTabsService: Implement mayLaunchUrl() 2018-12-20 13:42:53 +01:00
Sebastian Kaspari
7647c16b8f [components] Refactor EngineSessionHolder to keep a reference to an EngineSession or EngineSessionState.
The main change here is that EngineSessionHolder can now hold an EngineState and this state
is used when we need to create an EngineSession (which will clear the state). This has the
following advantages:

* When restoring we can just attach the EngineState and do not need to create the
  EngineSession immediately. With that we do not load all the EngineSessions and everything
  at once. Initially only the selected EngineSession will be created and loaded. That will
  make the restore faster and use less resources when restoring a lot of sessions.

* (Not in this commit, for a follow-up) It allows us to close EngineSession instances and
  just keep the EngineState around until we need the EngineSession again. That's something
  we could do in low memory situations or when there are just too many sessions/tabs open
  to be performant (e.g. only keep the last recently used EngineSession instances around).
2018-12-19 11:30:07 +01:00
Grisha Kruglov
eff111ae9d [components] Closes https://github.com/mozilla-mobile/android-components/issues/1552: Set HistoryTrackingDelegate instance directly on engine's defaultSettings
This patch simplifies how the history tracking delegate is set, and removes unnecessary
complexity around the history tracking feature.

It's important to set the delegate before the first engine session instance is created.
There are multiple points in time when that might happen:
- if we have a SessionSnapshot, we'll restore early on and create bunch of engine sessions
- we'll may create a 'default' engine session via one of the multiple use cases which use
SessionManager
- we may create an engine session at any other point in time, as soon as we have an engine
instance, by manually invoking 'createSession' method.

In short, applications aren't constrained in how they create sessions, and various components
may create sessions at different points in time, depending on their lifecycles, how things
are configured to behave, etc.

If we want to guarantee that our engine sessions always have a history tracking delegate instance
set, simply setting it on the 'defaultSettings' object guarantees that in the most straightforward way.

This also makes problems around lazy initialization of HistoryTrackingFeature irrelevant, since that
feature is now gone.

This patch removes the feature-storage, since the only thing it contained was a delegate implementation.
2018-12-14 11:31:55 -05:00
Lina Cambridge
c4a70391a2 [components] Wire up the history tracking delegate for GeckoView Nightly. 2018-11-30 11:17:36 +01:00
Christian Sadilek
d544a4c854 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1430: Crash caused by saveState on non-UI thread 2018-11-29 09:53:59 +01:00
Christian Sadilek
5f9ebdbebe [components] Closes https://github.com/mozilla-mobile/android-components/issues/1067: Add support for opening/closing windows 2018-11-28 12:20:21 -05:00
Christian Sadilek
9bec09229f [components] Closes https://github.com/mozilla-mobile/android-components/issues/1452: Expose setting to control multiple window support 2018-11-28 12:20:21 -05:00
Alessio Placitelli
8e0568cd3c [components] Closes https://github.com/mozilla-mobile/android-components/issues/1176: Use Robolectric 4.0.2. 2018-11-27 17:16:55 +01:00
Jonathan Almeida
f782083016 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1311: notify observers of navigation change sooner 2018-11-26 16:15:22 +01:00
Arturo Mejia
2ba2c5b4eb [components] Closes https://github.com/mozilla-mobile/android-components/issues/1339: Add scroll behavior support for full screen pages on SystemEngineView. 2018-11-20 10:35:40 -05:00
ali-abdullah
89f3263d12 [components] included buildSrc in ktlint and detekt checks 2018-11-16 12:40:04 +01:00
Sebastian Kaspari
4fcc11ef9b [components] Issue https://github.com/mozilla-mobile/android-components/issues/404: Build with and target SDK 28 (+ update support libraries)
* Build with and target SDK 28.
* Use Robolectric 4.0-alpha-3.
* Update support libraries to 28.0.0.
* .travis.yml: Update platform version.
2018-11-15 18:12:42 +01:00
Christian Sadilek
da071e5cc0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1252: Webfont blocking is controlled by both policy and setting 2018-11-12 14:41:21 +01:00
Christian Sadilek
e34c22f81b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1305: Upgrade to Kotlin 1.3.0 and Coroutines 1.0.1 2018-11-09 09:26:47 +01:00
Christian Sadilek
e7bc2e35b3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1157: Add API for permission requests 2018-11-08 20:01:26 +01:00
Grisha Kruglov
782980355f [components] Stop using deprecated versions of async, launch, etc
This switching to using explicit CoroutineScopes and Dispatchers,
trying to inherit context when appropriate.
2018-11-07 13:04:17 -08:00
Grisha Kruglov
1d92f12ebc [components] Switch HistoryStorage to use Deferred results and suspend functions
Underlying HistoryStorage implementations might be blocking on IO (Rust Places, room),
or migth be non-blocking (in-memory). A Deferred return type for get* methods makes
it convenient to wrap both regular and `async` operations. Use of 'suspend' functions
serves the same role for write* methods.

This change makes it obvious at the engine call-site that the underlying implementation
might suspend, at which point we can wrap calls in `runBlocking` or use another coroutine builder.
2018-11-05 17:27:42 -08:00
Arturo Mejia
0cc70eea7d [components] Closes https://github.com/mozilla-mobile/android-components/issues/1205: Adding support for using SystemEngineView and
GeckoEngineView in a CoordinatorLayout
2018-11-05 14:06:51 +01:00
Grisha Kruglov
2d8134bcc9 [components] Add an in-memory implementation of concept-storage 2018-10-26 15:42:19 -07:00
Grisha Kruglov
3898dbaba9 [components] Allow setting of historyTrackingDelegate on an Engine instance 2018-10-26 15:42:19 -07:00
Sebastian Kaspari
53b3d1a71f [components] Update repository information in README files. 2018-10-25 15:37:46 +02:00
Sebastian Kaspari
1081ba153f [components] Closes https://github.com/mozilla-mobile/android-components/issues/1128: browser-engine-system: Automatically grant playing protected media (EME APIs).
This is a workaround for Firefox for Fire TV to play DRM content automatically.

Eventually we want to implement this API in a way that the app (or another component) can
handle those requests. See: https://github.com/mozilla-mobile/android-components/issues/1157
2018-10-25 14:08:03 +02:00
Christian Sadilek
1b4d44c35e [components] Closes https://github.com/mozilla-mobile/android-components/issues/1106: Enhance RequestInterceptor to load alternative URL 2018-10-25 10:11:23 +02:00
Vadim Semenov
553da63663 [components] Fix typo in documentation 2018-10-24 11:52:48 +02:00
Vadim Semenov
0af6566645 [components] Wrap if-statements in curly brackets 2018-10-24 11:52:48 +02:00
Sebastian Kaspari
95defb3a55 [components] Fix new detekt findings (ObjectPropertyNaming). 2018-10-24 10:21:48 +02:00
Sebastian Kaspari
9e17b84339 [components] Simplify build configuration. 2018-10-24 10:21:12 +02:00
Johan Lorenzo
0ca864a1bf [components] Stop Bintray. Update {group,artifact}Ids. Remove massage task 2018-10-22 14:35:51 +02:00
Grisha Kruglov
3302d3917a [components] Engine history delegate API
The goal is to provide our engines with ability to query for browser history
and to record visits and page metadata updates (e.g. title changes).

GeckoView's APIs are still being implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=1494713,
so this works from the implementation notes. WebView's APIs are well known.

History delegate is optional. Absence of it in settings when configuring an engine as akin to
disabling history tracking.

This patch explicitly doesn't provide an implementation of a delegate.
2018-10-17 13:50:13 -07:00
Renan Barros
db8ac6893e [components] closes issue https://github.com/mozilla-mobile/android-components/issues/1017 2018-10-17 11:10:47 +08:00
Marco
6e4f04af78 [components] Closes https://github.com/mozilla-mobile/android-components/issues/47: Remove test prefix from method names 2018-10-10 15:59:39 -04:00
Jonathan Almeida
7c078e2350 [components] Chore: Change "mosac" references to "mozac" 2018-10-10 18:19:06 +02:00