Commit Graph

123 Commits

Author SHA1 Message Date
Grisha Kruglov
66d17ffe07 [components] Update and expand Engine(Session) tests 2019-04-30 13:38:33 -07:00
Grisha Kruglov
b898bb7ef3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2862: Make VisitType a requirement for HistoryTrackingDelegate's onVisited method
This shifts responsibility of constructing a VisitType for any given visit on the
caller of HistoryTrackingDelegate implementation, which is normally the engine.

This is generally what we want: engine is normally best suited to determine a visit type
for a URI that's currently being opened.
2019-04-30 13:38:33 -07:00
Grisha Kruglov
1afe4410dd [components] Closes https://github.com/mozilla-mobile/android-components/issues/2606: Blacklist URI schemas in the HistoryDelegate 2019-04-30 13:38:33 -07:00
Sebastian Kaspari
f4e9c9cf08 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2428: Update strings after L10N review. 2019-04-22 16:05:32 -04:00
Sebastian Kaspari
feffcaa2b1 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2771: Only clear Session.searchTerms after request initiated by the user. 2019-04-22 11:28:43 -04:00
Axel Hecht
1932da6b13 [components] Import strings from android-l10n
State: mozilla-l10n/android-l10n@3d40a22318
2019-04-16 19:10:28 +02:00
Sebastian Kaspari
a46127d2cc [components] Update ktlint to 0.31.0. 2019-04-15 12:30:52 -04:00
Axel Hecht
b2feda5856 [components] Import strings from android-l10n
Status: mozilla-l10n/android-l10n@55d144eb8e
2019-04-15 10:39:54 +02:00
Axel Hecht
bc83b84756 [components] Import l10n from android-l10n
State: mozilla-l10n/android-l10n@932938a1ca
2019-04-05 10:44:34 +02:00
Axel Hecht
5ba3493451 [components] Import l10n from android-l10n
State: mozilla-l10n/android-l10n@7724298c8c
2019-04-04 10:56:14 +02:00
Sebastian Kaspari
a1aa6eb4b3 [components] Issue https://github.com/mozilla-mobile/android-components/issues/2571: Add option to recover from crashed sessions. 2019-04-01 20:12:25 +02:00
Stas Parshin
77447f27a2 [components] Issue https://github.com/mozilla-mobile/android-components/issues/2346: Fix Kotlin compiler warnings in browser-engine-system. 2019-03-25 13:14:55 +01:00
Axel Hecht
5c24536313 [components] Import localizations from mozilla-l10n/android-l10n 2019-03-22 16:06:44 +01:00
Arturo Mejia
65c64cc989 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1382: Add implementation for capture thumbnail of websites
on GeckoEngineView.
2019-03-13 10:33:47 -04:00
Arturo Mejia
509556dee9 [components] Moving captureThumbnail from EngineSession to EngineView. 2019-03-13 10:33:47 -04:00
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