Commit graph

299 commits

Author SHA1 Message Date
Christian Sadilek
6a5dcadba5 [components] Revert "Issue https://github.com/mozilla-mobile/android-components/issues/8873: Migrate feature-tab-collections to use browser-state."
This reverts commit 30d3ebb4130d05846a2b3e7fd488eef128be262c.
2020-12-15 17:20:12 +00:00
Sebastian Kaspari
800fb0d46f [components] Issue https://github.com/mozilla-mobile/android-components/issues/8873: Migrate feature-tab-collections to use browser-state. 2020-12-15 15:37:00 +00:00
Sebastian Kaspari
3a4b55d8f0 [components] TrimMemoryMiddleware: Do not suspend tabs on TRIM_MEMORY_MODERATE. 2020-12-14 17:39:04 +00:00
Sebastian Kaspari
b458463058 [components] TrimMemoryMiddleware: Do not suspend all tabs.
In addition to the selected tab, we are now keeping 3 more tabs (based on LRU). This prevents switching between
tabs to feel slow if the "unselected" tab gets suspended immediately.
2020-12-14 17:39:04 +00:00
Christian Sadilek
39d71d1ded [components] Closes https://github.com/mozilla-mobile/android-components/issues/7247: Deprecate Session[Manager] observable methods 2020-12-10 11:00:37 +00:00
Sebastian Kaspari
2191eda94e [components] Closes https://github.com/mozilla-mobile/android-components/issues/4571: Introduce API to purge (back/forward) history of tabs.
* For `PurgeHistoryUseCase` I decided to not introduce a "tab ID" parameter and instead have
  it purge the history of all tabs. It seems like this is what we need and individual tab
  history removal is not needed for now.
* Some tabs may not have an `EngineSession` assigned. Creating one just to call purgeHistory()
  seems excessive. Instead I am dropping an attached `EngineSessionState` which will cause
  those tabs to just reload the URL with not back/forward history when they get restored.
2020-12-08 19:43:08 +00:00
Christian Sadilek
de36351126 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9157: Move desktopMode state from Session to Store 2020-12-08 17:14:59 +00:00
Sebastian Kaspari
d2600f3328 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9151: Refactor feature-pwa to not depend on browser-session anymore.
Again, multiple things in this PR:

* Migrated WebAppIntentProcessor and TrustedWebActivityIntentProcessor to use TabsUseCases instead of
  SessionManager directly.
* Migrated one LoadUrlUseCase to take a session ID instead of a `Session` instance as parameter
* Extended TabsUseCases to optionally accept a CustomTabConfig and/or WebAppManifest

I think with that we may even be able to remove WebAppManifest from `Session`. I'll look into this next.
2020-12-08 15:47:51 +00:00
Sebastian Kaspari
79ca201320 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9127: Refactor SearchUseCases to no longer depend on SessionManager.
Multiple things are happening in this patch:
* `TabsUseCases` now returns the ID of new tabs instead of `Session` instances.
* `SearchUseCases` now delegates to a `TabsUseCases` instance to create tabs instead of using `SessionManager`
* Search terms have been removed from `Session` and are now only accessible on `ContentState`
* `CaptureActionsMiddleware` is a new helper to inspect actions dispatched on a `Store` in unit tests.
2020-12-07 09:47:45 +00:00
Emilio Cobos Álvarez
41d375b7d9 [components] ktlint: Add missing newlines.
Running ./gradlew ktlint locally reports a lot of stuff like:

/home/emilio/src/moz/android-components/components/support/migration/src/test/java/mozilla/components/support/migration/MigrationIntentProcessorTest.kt:1:1: File must end with a newline (\n)

This fixes it with:

    for f in $(cat files | cut -d : -f 1); do echo "" >> $f; done

Making ./gradlew ktlint pass.
2020-12-03 17:24:44 +00:00
Sebastian Kaspari
7b8f79a1b3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9096: Move recording devices from Session to ContentState and turn RecordingDevicesNotificationFeature into middleware. 2020-12-03 16:45:02 +00:00
Sebastian Kaspari
c4918b164c [components] TrimMemoryMiddleware: Log whenever we suspend tabs to trim memory. 2020-11-30 14:50:59 +00:00
Mugurell
577225d8ef [components] For https://github.com/mozilla-mobile/android-components/issues/9042 - Dismiss pull to refresh if beforeunload prompt is cancelled 2020-11-23 22:05:25 +00:00
Arturo Mejia
f04a6913d5 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8943 refactor SwipeRefreshFeature to not use EngineSession.Observer 2020-11-12 19:36:50 +00:00
Christian Sadilek
05d43cecff [components] Issue https://github.com/mozilla-mobile/android-components/issues/7247: Deprecate SelectionAwareSessionObserver 2020-11-06 20:16:38 +00:00
ekager
02a1023025 [components] For https://github.com/mozilla-mobile/android-components/issues/8831 - Adds ability to remove (and restore) a list of tabs 2020-11-02 22:46:29 +00:00
codrut.topliceanu
c84123dfb8 [components] For https://github.com/mozilla-mobile/android-components/issues/8554 - Migrate permissionFeature to KotlinFlow 2020-10-28 19:47:01 +00:00
Christian Sadilek
6f338f2999 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8697: Move Session.loadRequestMetadata to browser state 2020-10-15 13:41:06 +00:00
Roger Yang
4391b4e2c8 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8207: Add Delegate and Browser Session State for MediaSession API 2020-10-07 10:14:40 +00:00
Arturo Mejia
593c25629e [components] Closes https://github.com/mozilla-mobile/android-components/issues/8312:Adds support for ContentDelegate#onExternalResponse 2020-10-05 17:32:38 +00:00
Christian Sadilek
66d9e8b508 [components] Issue https://github.com/mozilla-mobile/android-components/issues/8535, https://github.com/mozilla-mobile/android-components/issues/7304: Prevent dispatching individual actions to restore tabs
Co-authored-by: Jonathan Almeida <jalmeida@mozilla.com>
2020-10-02 16:38:18 +00:00
Sebastian Kaspari
b5ba7558a2 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8529: Dispatch a generic InitAction from BrowserStore
Co-authored-by: Christian Sadilek  <christian.sadilek@gmail.com>
2020-09-30 17:31:15 +00:00
Arturo Mejia
c5df5ad6d2 [components] Improve download flow 2020-09-25 20:22:57 +00:00
ekager
f20da349fd [components] Closes https://github.com/mozilla-mobile/android-components/issues/8493 - Add private param to RecoverableTab 2020-09-25 09:41:57 +00:00
Sebastian Kaspari
067e9782de [components] Issue https://github.com/mozilla-mobile/android-components/issues/3265: Add support for "undo" functionality.
This is not the fancy version yet since we still need to restore into SessionManager. Once it is gone and
we rely on BrowserStore only, then we can make this better.

However moving this functionality into AC now helps us:
- It will be easier to migrate to a better undo functionality since this code is already in AC.
- Other code can interact with the "undo" actions. For example "recently closed tabs" now will
  only contain a tab if the removal was not undone.
2020-09-22 17:59:34 +00:00
Sebastian Kaspari
08cdf3c6f0 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8406: Create separate usecases for removing all normal/private tabs. 2020-09-18 18:15:18 +02:00
Sebastian Kaspari
2bd27c677a [components] Issue https://github.com/mozilla-mobile/android-components/issues/8417: SessionStorage: Remove invalid selected tab id before saving state to disk. 2020-09-16 15:56:32 +02:00
Sebastian Kaspari
ab57ccf41c [components] Closes https://github.com/mozilla-mobile/android-components/issues/7886: SessionStorage: Write state as stream to disk instead of building model in memory first. 2020-09-11 13:16:32 +02:00
Sebastian Kaspari
e65a3926b6 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7886: SessionStorage: Catch "OutOfMemoryError" when writing to disk and log error. 2020-09-11 11:39:18 +02:00
ekager
d453dd86e6 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8253 - Adds RecentlyClosedTabStorage 2020-09-09 09:04:48 -07:00
Sebastian Kaspari
c66d74ce23 [components] Issue https://github.com/mozilla-mobile/android-components/issues/8255: Lazily restore engine sessions after content process kill or crash.
* Instead of keeping the EngineSessionState inside EngineSession, we now always attach it to EngineState and also do not
  clear it anymore.
* If the content process gets killed we now just suspend affected EngineSession instances. They will automatically and
  lazily get restored from the last EngineSessionState once needed.
* On a content process crash we now mark the EngineState as crashed and suspend the EngineSession. We will not restore
  the EngineSession until explicitly restored by the application.
2020-09-07 13:30:04 +02:00
Jonathan Almeida
a4d8824526 [components] Close https://github.com/mozilla-mobile/android-components/issues/7476: Persists lastAccess to SnapshotSerializer 2020-08-28 23:43:48 -04:00
MozLando
aaa61a39f5 [components] Merge https://github.com/mozilla-mobile/android-components/pull/8121
8121: Issue https://github.com/mozilla-mobile/android-components/issues/7867: Move EngineSession from SessionManager to BrowserState. r=csadilek a=pocmo

Fenix PR: https://github.com/mozilla-mobile/fenix/pull/13933
R-B PR: https://github.com/mozilla-mobile/reference-browser/pull/1292



Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
2020-08-26 15:55:09 +00:00
Sebastian Kaspari
212c7d73c1 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7867: Move EngineSession from SessionManager to BrowserState.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>

Issue https://github.com/mozilla-mobile/android-components/pull/8121: Replace MigrationStore with MigrationContext and prevent usage outside of a Middleware.

* Before executing the reducer chain we now verify that we are on the store thread and throw if we are on a different thread.
* MigrationContext now provides a store property that returns the underlying Store instance. This can be used to pass it to
  other components and threads that are not part of the Middleware.
* Fixed existing Middleware implementations to use the MiddlewareContext or pass the actual Store instance around.
2020-08-26 10:50:47 -04:00
Jamie Nicol
82f933c588 [components] For https://github.com/mozilla-mobile/android-components/issues/7413 - Listen for onPaintStatusReset and don't thumbnail until subsequent contentful paint 2020-08-21 15:46:27 +01:00
Kate Glazko
02bd5bb0fe [components] For https://github.com/mozilla-mobile/android-components/issues/7673: Move DownloadProgress and Status to DownloadState 2020-07-28 16:50:02 -04:00
Christian Sadilek
c43ad0e9a5 [components] Closes https://github.com/mozilla-mobile/android-components/issues/7741: Move Session.Source to browser state 2020-07-16 16:01:33 -04:00
Sebastian Kaspari
f77ce1f5f1 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7737: Remove fullScreenMode and layoutInDisplayCutoutMode from Session. 2020-07-16 16:15:35 +02:00
Sebastian Kaspari
c4c35fdaea [components] Issue https://github.com/mozilla-mobile/android-components/issues/7737: Remove hitResult from Session. 2020-07-16 16:15:33 +02:00
Sebastian Kaspari
4587591eff [components] Issue https://github.com/mozilla-mobile/android-components/issues/7737: Remove findResults from Session. 2020-07-16 15:36:29 +02:00
Jeff Boek
b1ddac9b1d [components] For https://github.com/mozilla-mobile/fenix/issues/2681 - Adds bypassCache parameter to reload. 2020-07-14 10:53:24 -07:00
Kainalu Hagiwara
ad50481c81 [components] Closes https://github.com/mozilla-mobile/android-components/issues/7664: Add EngineSession.goToHistoryIndex to jump to a specific index in a sessions history. 2020-07-09 18:24:20 -07:00
MozLando
56fda11603 [components] Merge https://github.com/mozilla-mobile/android-components/pull/7607
7607: Closes https://github.com/mozilla-mobile/android-components/issues/7606 Consume contentPermissionRequest only when loading new site r=csadilek a=Amejia481



Co-authored-by: Arturo Mejia <arturomejiamarmol@gmail.com>
2020-07-06 13:34:31 +00:00
Arturo Mejia
92125d5f1f [components] Closes https://github.com/mozilla-mobile/android-components/issues/7606 Consume contentPermissionRequest only when loading new site 2020-07-03 16:55:10 -04:00
Sebastian Kaspari
cb1edbe63b [components] Issue https://github.com/mozilla-mobile/android-components/issues/7571: SessionManager: Deprecate getEngineSession(). 2020-07-03 17:51:31 +02:00
Sebastian Kaspari
8ebf70a0f4 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7571: EngineSessionUseCases: Remove GetUseCase. 2020-07-03 17:51:31 +02:00
Sebastian Kaspari
e210e98268 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7571: Refactor unit tests to read EngineSession from BrowserStore. 2020-07-03 17:51:31 +02:00
Sebastian Kaspari
0e8519d9e6 [components] Issue https://github.com/mozilla-mobile/android-components/issues/7480: Migrate SessionFeature to use BrowserStore. 2020-07-02 17:36:36 +02:00
Arturo Mejia
3d6538d133 [components] Closes issue https://github.com/mozilla-mobile/android-components/issues/7398: Avoid passing negative values to the download
contentLength
2020-06-15 16:57:16 -04:00
Tiger Oakes
d11f6f2e9f [components] Add sameOriginAs Uri helper 2020-06-11 09:16:32 -07:00