Commit Graph

108 Commits

Author SHA1 Message Date
Sebastian Kaspari
4e791bff9a [components] Issue https://github.com/mozilla-mobile/android-components/issues/1845: Expose list of media in Session. 2019-03-21 15:08:00 +01:00
Sebastian Kaspari
fd72da8d56 [components] Issue https://github.com/mozilla-mobile/android-components/issues/2346: Fix Kotlin compiler warnings in browser-session. 2019-03-18 11:27:09 +01:00
Sebastian Kaspari
c1ae01d76b [components] Closes https://github.com/mozilla-mobile/android-components/issues/2332: Add WebAppManifestParser for creating WebAppManifest from JSON. 2019-03-13 19:42:33 +01:00
Sebastian Kaspari
e23b6bf9c8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/2216: feature-session-bundling: Save state outside of database. 2019-03-13 19:42:21 +01:00
Sebastian Kaspari
77b95d432a [components] Issue https://github.com/mozilla-mobile/android-components/issues/2216: Move code for saving and loading snapshots to AtomicFile extension methods. 2019-03-13 19:42:21 +01:00
Arturo Mejia
509556dee9 [components] Moving captureThumbnail from EngineSession to EngineView. 2019-03-13 10:33:47 -04:00
Sebastian Kaspari
ff62b676ef [components] Closes https://github.com/mozilla-mobile/android-components/issues/2290: Expose WebAppManifest in Session. 2019-03-12 12:41:10 +01:00
RomanWuattier
691b85df42 [components] Observe session based on the session ID
Create the function `observeIdOrSelected` to start observing changes based on
the given `sessionId`. If the session does not exist, then observe the
selected session.

Closes: https://github.com/mozilla-mobile/android-components/issues/1940
2019-02-25 18:34:00 -05:00
Sebastian Kaspari
312bfa8d76 [components] Issue https://github.com/mozilla-mobile/android-components/issues/2062: SessionManager: Allow calling restore() with empty snapshot. 2019-02-14 10:31:18 -05:00
Sebastian Kaspari
83a1bb7112 [components] SnapshotSerializer: Save and restore session title. 2019-02-13 23:50:59 +01:00
Christian Sadilek
f2836ab496 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1908: AutoSave doesn't work if no sessions left 2019-02-12 13:48:22 -05:00
Sebastian Kaspari
a55e705604 [components] AutoSave: Save state after removing all sessions.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2019-01-31 13:33:39 -05:00
Jonathan Almeida
ae236346ec [components] Closes https://github.com/mozilla-mobile/android-components/issues/1885: Add workaround for Custom Tabs Jetifier bug 2019-01-29 12:32:17 -05:00
Jonathan Almeida
371ef7d6a2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1401: Add default share menu for CustomTabs 2019-01-22 11:05:11 -05:00
Jonathan Almeida
aa9c4b389b [components] Closes https://github.com/mozilla-mobile/android-components/issues/1724: Use pixel density to get accurate icon size 2019-01-21 10:27:38 -05:00
Jonathan Almeida
8b44f50eb0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1400: Add close button to custom tabs
Also makes the toolbar unclickable so it can't be switching into
edit mode, and removes all other actions.

Moved the custom tab back button bitmap checking to the feature from the
CustomTabConfig since we needed to know the DisplayMetrics for the
current screen to properly compare it to the max dp value.
2019-01-21 10:27:38 -05:00
Christian Sadilek
43905d4c7e [components] Closes https://github.com/mozilla-mobile/android-components/issues/1518: Select session of same type when session is removed 2019-01-11 18:16:07 +01:00
Sebastian Kaspari
8ef7647504 [components] AutoSave: Do not block on background save.
Android doesn't kill the process immediately after all foreground activities are gone. So we still have
time to save the state from our background thread.

This also avoids ANRs and issues we saw related to blocking the UI thread, e.g.:
https://github.com/mozilla-mobile/reference-browser/issues/405
2019-01-11 14:14:33 +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
Sebastian Kaspari
6a87f4d360 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1541: feature-session-bundling: New component that saves sessions in grouped bundles. 2019-01-03 12:12:49 +01:00
Colin Lee
5f1b789127 [components] Fixes https://github.com/mozilla-mobile/android-components/issues/1624: Session: Crash because trackersBlocked is empty 2018-12-28 18:03:50 -05:00
Jonathan Almeida
42fcea2b83 [components] Closes https://github.com/mozilla-mobile/android-components/issues/1600: Add exit fullscreen use case 2018-12-21 19:03:49 -05:00
Grisha Kruglov
ed472d66ae [components] Clean up gradle build files for some of the components
- Remove a few unnecessary dependencies
- Add some comments around usage of 'api'
- Mark some of the dependencies as 'api' if they're necessary for use of the module
2018-12-21 13:11:27 -08: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
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
Arturo Mejia
23d17a6fed [components] Closes https://github.com/mozilla-mobile/android-components/issues/1434: Add support for choice html elements for GeckoEngine 2018-11-28 10:50:35 -05:00
Sebastian Kaspari
96d4fe8f36 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1428: SessionStorageTest: Fix flaky test. 2018-11-26 14:37:55 +01:00
Sebastian Kaspari
4d8197cf69 [components] Issue https://github.com/mozilla-mobile/android-components/issues/743: SessionStorage: Customizable UI-independent session storage. 2018-11-20 12:35:28 +01:00
ali-abdullah
89f3263d12 [components] included buildSrc in ktlint and detekt checks 2018-11-16 12:40:04 +01:00
Sebastian Kaspari
ae4a0d6251 [components] Issue https://github.com/mozilla-mobile/android-components/issues/1303: Move CustomTabService to new feature component: feature-customtabs. 2018-11-13 08:58:58 +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
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