Commit Graph

76 Commits

Author SHA1 Message Date
Sebastian Kaspari
870fbf8c35 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1198: SessionManager.remove(): Do not select custom tab session. 2018-10-30 17:03:07 -04:00
Sebastian Kaspari
53b3d1a71f [components] Update repository information in README files. 2018-10-25 15:37:46 +02:00
Vadim Semenov
0af6566645 [components] Wrap if-statements in curly brackets 2018-10-24 11:52:48 +02:00
Sebastian Kaspari
9e17b84339 [components] Simplify build configuration. 2018-10-24 10:21:12 +02:00
Christian Sadilek
fa57495a6b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1113: Session/EngineSession link is not thread-safe 2018-10-23 13:13:22 +02:00
Grisha Kruglov
2d43416527 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1115: Preserve session's parent in DefaultSessionStorage 2018-10-22 17:15:37 -04:00
Grisha Kruglov
1a9b2ae0a0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1114: Firm up session storage and restoration around new storage format
Current storage format doesn't preserve session order, and snapshot processing
is a bit vague around the various edge cases.

This patch changes the storage format to use an ordered list (vs a set), and firms
up creation, processing and restoration of snapshots. Guiding principles are:
- be explicit,
- be lenient about what we accept, and strict about what we produce.

Storage format version isn't bumped out of simplicity: there are no production
consumers of this (that we know of) that we'll need to migrate, and so let's
do the simple thing this time.
2018-10-22 17:15:37 -04:00
Grisha Kruglov
8143ce85d9 [components] Closes https://github.com/mozilla-mobile/android-components/issues/904: Refactor SessionStorage around idea of snapshots
This patch introduces an idea of a SessionsSnapshot, which is a representation of
SessionManager's state that's suitable for persistance. SessionStorage's APIs read/write
APIs are changed to operate over the snapshot.

A public `restore` method was added to SessionManager, along with onSessionsRestored observer method,
which allow restoring a SessionsSnapshot.
2018-10-22 17:15:37 -04:00
Johan Lorenzo
0ca864a1bf [components] Stop Bintray. Update {group,artifact}Ids. Remove massage task 2018-10-22 14:35:51 +02:00
Sebastian Kaspari
ba7cc8770d [components] Closes https://github.com/mozilla-mobile/android-components/issues/1092: SessionManager: Update parent id of children after removing parent. 2018-10-19 17:50:10 -04:00
Sebastian Kaspari
c4a65f8db6 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1066: SessionManager: Add child sessions after parent. 2018-10-19 17:50:10 -04:00
Sebastian Kaspari
dd56177d8a [components] Closes https://github.com/mozilla-mobile/android-components/issues/1065: SessionManager: Add option to select parent on child removal. 2018-10-19 17:50:10 -04:00
Julian_Chu
2f5224bab0 [components] Close https://github.com/mozilla-mobile/android-components/issues/1064: add Parent id to Session
When creating new session from an existing session, we need to the
relationship between two sessions. For example, to click a href link in
web-page to open new tab.

This commit add parent id to Session. If a session is added without
parent, it will be append to tail of sessions. Otherwise it will sit
next to parent.
2018-10-19 11:44:48 +08:00
Renan Barros
db8ac6893e [components] closes issue https://github.com/mozilla-mobile/android-components/issues/1017 2018-10-17 11:10:47 +08:00
Arturo Mejia
6a3cdff388 [components] Closes https://github.com/mozilla-mobile/android-components/issues/988: Create feature-download (Non UI) 2018-10-15 13:36:27 -04:00
Christian Sadilek
f98507c95f [components] Closes https://github.com/mozilla-mobile/android-components/issues/962: Add reusable functionality for observing selected session 2018-10-12 14:39:40 +02: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
Grisha Kruglov
f27edf7eda [components] Add 'defaultSession' to SessionManager
Problem this is trying to solve:

SessionManager doesn't own its "empty" state (no selected session, no sessions at all).
Components which rely on the SessionManager may make assumptions about what happens
when SessionManager becomes "empty", and current approach is for some component to "take charge",
and be responsible for adding a "default" session when there are none left.

This doesn't bode well for composing components. We can get into a kind of "action at a distance"
situation, when various components make certain assumptions (say, SessionManager must always have
a selected session), but none of them actually take charge and populate the manager when appropriate.
Since components aren't necessarily aware of each other, and ideally are arbitrarily composable,
this graph of implicit dependencies becomes problematic.

This patch:
A naive solution to this is to get the SessionManager to owner its "empty" state.
This patch allows "default" behaviour to be specified at creation time, supplying a lambda
which produces a default session. Not supplying this lambda is equivalent to allowing SessionManager
to be empty.

Fixes https://github.com/mozilla-mobile/android-components/issues/764.
2018-10-03 09:53:56 +02:00
Wajahat Karim
ed0729232c [components] Closes https://github.com/mozilla-mobile/android-components/issues/922: Update READMEs to point to maven.mozilla.org and use new artifact names. 2018-10-03 09:20:43 +02:00
Sebastian Kaspari
9e715e0058 [components] Issue https://github.com/mozilla-mobile/android-components/issues/939: SessionManager: Do not select custom tab sessions from add(). 2018-10-02 10:40:10 -04:00
Arturo Mejia
a4c1e8c218 [components] Closes https://github.com/mozilla-mobile/android-components/issues/825: Session.url is not updated until page has nearly finished
loading
2018-09-26 10:21:51 +02:00
Arturo Mejia
5bc1ca7173 [components] Closes https://github.com/mozilla-mobile/android-components/issues/495: Provide thumbnail of websites
* Adding captureThumbnail to EngineSession

* Updating TabViewHolder to add thumbnail

* Adding thumbnail to Session

* Adding a new product flavor for systemEngine
2018-09-20 12:51:00 -04:00
Christian Sadilek
6c4bb75508 [components] Closes https://github.com/mozilla-mobile/android-components/issues/768: Replace all calls to Java 8's Map.forEach 2018-09-12 18:52:51 -04:00
Jonathan Almeida
da6f4a83e2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/644: Clear Data (WebView only)
This only includes the implementation for the SystemWebView that's based
off of what we currently do in Focus/Fire TV. Since this is needed for
those apps now, we can work with this implementation until GeckoView
provides us with a nicer API to do the equivalent for it. (Bug 1489669)

We also don't notify any observers since there isn't any
confirmation/information available that we can propagate to cients.
2018-09-11 16:30:30 -04:00
Jonathan Almeida
69563c770e [components] Closes https://github.com/mozilla-mobile/android-components/issues/643: FullScreen mode support 2018-09-11 14:37:57 -04:00
Christian Sadilek
0b1c254fb8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/678: Document browser-session component 2018-09-11 11:21:36 -04:00
Christian Sadilek
6473d424f9 [components] Fix KDocs for SessionStorage 2018-09-10 23:50:06 -04:00
Arturo Mejia
8ced4b7828 [components] Closes https://github.com/mozilla-mobile/android-components/issues/701: Exposing browser-session Desktop mode
* Adding desktopMode property to Session

* Adding onDesktopModeChanged in Session

* Renaming RequestDesktopSite to RequestDesktopSiteUseCase to follow
  the convention

* Implementing onDesktopModeChange in EngineObserver

Renaming:

On EngineSession.Observer
    from onDesktopModeEnabled to onDesktopModeChange
    from setDesktopMode to toggleDesktopMode

On Session
    from onDesktopModeEnabledChanged to onDesktopModeChanged
2018-09-06 18:17:44 -04:00
Christian Sadilek
25d2dfc396 [components] Closes https://github.com/mozilla-mobile/android-components/issues/656: Add find in page functionality to engine/session 2018-08-30 14:06:39 -04:00
Jonathan Almeida
be422f354a [components] Issue https://github.com/mozilla-mobile/android-components/issues/647: Desktop mode support
Closes https://github.com/mozilla-mobile/android-components/issues/647
2018-08-29 11:36:07 -04:00
Jonathan Almeida
2ff709d589 [components] Issue https://github.com/mozilla-mobile/android-components/issues/476: Add long press support as observable
Fixes https://github.com/mozilla-mobile/android-components/issues/476
2018-08-27 13:44:11 -04:00
Christian Sadilek
85e4d8ab77 [components] Issue https://github.com/mozilla-mobile/android-components/issues/521: Add support for modifying engine session settings 2018-08-24 10:53:14 -04:00
Christian Sadilek
536775b259 [components] Issue https://github.com/mozilla-mobile/android-components/issues/499: Support private browsing mode 2018-08-23 18:36:28 +02:00
Christian Sadilek
80a7b5da03 [components] Issue https://github.com/mozilla-mobile/android-components/issues/508: Implement tracking protection in SystemEngine 2018-08-21 12:30:56 -04:00
Sebastian Kaspari
946410ca86 [components] Configure dependencies from buildSrc Kotlin code. 2018-08-21 11:16:21 -04:00
Jonathan Almeida
7086b9c595 [components] Issue https://github.com/mozilla-mobile/android-components/issues/605: Include base64 support + review comments 2018-08-17 17:59:00 -04:00
Jonathan Almeida
3210ec6f11 [components] Closes https://github.com/mozilla-mobile/android-components/issues/605: Add loadData to Engine 2018-08-17 17:59:00 -04:00
Jonathan Almeida
0ab0fbe341 [components] Issue https://github.com/mozilla-mobile/android-components/issues/604: Add Engine ability to stop loading
Adds the ability to stop loading a session that would have already
started.

Some considerations were made about whether
`EngineSession.Observer#onLoaingStateChanged` should be called. In our
current `SystemEngine` and `GeckoEngine` there isn't any explicit
callback for handling a stop loading event so there wouldn't be any way
to do this.
2018-08-14 22:24:35 -04:00
Sebastian Kaspari
21909c425a [components] Issue https://github.com/mozilla-mobile/android-components/issues/482: Introduce support-base component to host building blocks of components. 2018-08-01 16:18:26 +02:00
Christian Sadilek
c48c96f55e [components] Closes https://github.com/mozilla-mobile/android-components/issues/352: Expose tracking protection in session/engine 2018-07-25 13:38:25 -04:00
Sebastian Kaspari
ddd3809922 [components] Issue https://github.com/mozilla-mobile/android-components/issues/431: Receive website title from engine implementations and update Session. 2018-07-24 15:42:46 +02:00
Sebastian Kaspari
9b389febe0 [components] Issue https://github.com/mozilla-mobile/android-components/issues/431: Add website title to Session. 2018-07-24 15:42:46 +02:00
Sebastian Kaspari
831fdbfa8f [components] Issue https://github.com/mozilla-mobile/android-components/issues/424: Expose Downloads in Engine component and make them consumable from a Session. 2018-07-18 18:48:02 +02:00
Christian Sadilek
d755b34909 [components] Closes https://github.com/mozilla-mobile/android-components/issues/407: Add source info to session 2018-07-18 17:46:54 +02:00
Sebastian Kaspari
bc5ab03303 [components] Issue https://github.com/mozilla-mobile/android-components/issues/406: Pass Session object and new value to Session.Observer. 2018-07-13 16:16:02 -04:00
Sebastian Kaspari
eefad6c0ba [components] Issue https://github.com/mozilla-mobile/android-components/issues/379: Make SessionManager.selectedSession nullable and allow app to define behavior if all tabs are closed. 2018-07-10 22:18:38 -04:00
Christian Sadilek
f5163a0d42 [components] Closes https://github.com/mozilla-mobile/android-components/issues/378: SessionManager removeAll removes custom tabs 2018-07-09 12:43:03 +02:00
Sebastian Kaspari
fbf3bbb538 [components] Issue https://github.com/mozilla-mobile/android-components/issues/244: Add support-test component for generic test helper code. 2018-07-06 16:43:05 -04:00
Sebastian Kaspari
9022696224 [components] Issue https://github.com/mozilla-mobile/android-components/issues/174: SessionManager.remove(): Update internal state before notifying observers.
Without that observers listening to onSessionRemoved() would be notified while the session manager
is in an inconsistent state (session removed but selection index not updated).
2018-07-05 18:04:00 +02:00
Sebastian Kaspari
4336a3817a [components] Update ktlint to 0.24.0 and fix new issues. 2018-07-04 19:37:48 +02:00