Commit Graph

2195 Commits

Author SHA1 Message Date
Mugurell
d67a681ba6 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Add a new mediaSessionActive property to LastMediaAccessState
This new property helps with separating the current responsibilities of
lastMediaAccess such that after this:
- lastMediaAccess is only updated when media starts playing allowing clients to
order media tabs and find the first / last tab with in progress media.
- lastHadMediaSessionActive indicates whether a MediaSession should be active
for this tab and serves as a backup for lastMediaUrl for the situations where a
website might allow media to continue playing even when the users accesses
another page (with another URL) in that same HTML document.
2021-07-21 19:10:46 +00:00
Mugurell
58cf65e681 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Persist and restore tab LastMediaAccessState 2021-07-21 19:10:46 +00:00
Mugurell
097eeb01e2 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Try to update mediaState only for TabSessionState
Renamed "BrowserState.updateTabState" to a more appropriate
"BrowserState.updateTabOrCustomTabState" signaling that it can be used to
update any tab or custom tab.

Created two new "BrowserState.updateTabState" and
"BrowserState.updateCustomTabState" extension methods to allow updating the
state of either tabs or custom tabs depending on the properties needing update.

By this we are forcing the clients to choose what type of SessionState they
want updated and in so limiting the situations in which the old API would try
to update any SessionState and could throw a ClassCastException if in the
"update" lambda parameter callers would try to update a property not existing
in one SessionState implementation but available in other.
2021-07-21 19:10:46 +00:00
Mugurell
0c7b4d7866 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Migrate TabSessionState's lastMediaAccess to LastMediaAccessState
LastMediaAccessState contains both
- lastMediaAccess - timestamp for the last time media started playing
(which is reset to 0 when GV deactivates the MediaSession)
- lastMediaUrl - tab url when media started playing

By combining this two properties we'll know that a tab has in progress media
even when:
- the user navigates to another page in the same document
but media continues to play, MediaSession exists, lastMediaAccess is not reset,
- media starts playing in another tab
but the previous media tab has the same url as lastMediaUrl.

After media starting to play in a tab only if
- user navigated to another website and
- MediaSession is deactivated (happens when navigating to another website or
when media starts playing in another tab)
will we consider that this tab doesn't anymore have in progress media.
2021-07-21 19:10:46 +00:00
Stefan Arentz
a719bbf6ce [components] For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master branch to main (https://github.com/mozilla-mobile/android-components/pull/10647)
* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHub Workflows)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Pull Request Template)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (README)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (l10n.toml)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHubPlugin.kt)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Documentation & Comments)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (TaskCluster)
2021-07-21 09:59:30 -04:00
Sebastian Kaspari
f29656ddc0 [components] Revert string removal by 06c42dd893188a7da69ac2eba10f4fc1d44fab3d
Some of those strings seem to be used by Fenix only.
2021-07-20 20:27:13 +02:00
Sebastian Kaspari
f14b267388 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update dependencies to support Jetpack Compose and add first prototype components.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upgrade to Gradle 7.
* Update Android Gradle Plugin to 7.0.0 Beta 2.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Generate BuildConfig with VERSION_CODE and VERSION_NAME fields in library modules (for Glean).
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add first component using Jetpack Compose: compose-browser-toolbar.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Introduce Jetpack Compose bindings for lib-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upstream Jetpack Compose toolbar prototype from Reference Browser.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add TargetTab helper for observing specific tabs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add compose-engine component for adding Jetpack Compose bindings to a concept-engine implementation.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add new sample app (samples-compose-browser) for prototyping browser UI using Jetpack Compose.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update to Beta 3 of the Android Gradle plugin.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Allow usage of http when substituting maven repositories in CI.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Rename TabTarget helper to just Target.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Make BrowserToolbar follow target tab too.
* Add awesomebar prototype using Jetpack Compose.
* Update to Gradle 7.0.2.
2021-07-20 16:22:26 +00:00
codrut.topliceanu
1e510d2772 [components] For https://github.com/mozilla-mobile/android-components/issues/10624 - Adds recoverable param to RemoveAllTabsAction
...to be used by UndoMiddleware.kt to prevent closed tabs from being recoverable
2021-07-19 14:49:23 +00:00
Sebastian Kaspari
9fb6953940 [components] Upgrade Android Gradle Plugin to 4.2.2 and Gradle to 6.7.1. 2021-07-19 09:32:44 +00:00
Sebastian Kaspari
28a76101be [components] Update Kotlin to 1.5.10 (and Coroutines to 1.5.0 and Room to 2.3.0). 2021-07-19 09:32:44 +00:00
Mugurell
cd404dfd7b [components] For https://github.com/mozilla-mobile/android-components/issues/10555 - BrowserToolbarBehaviorTest cleanup
This commented method seems to be a leftover from the previous refactoring.
"behavior.forceExpand(..)" now calls "expandWithAnimation" for which we already
have a test at line 450.
2021-07-16 12:37:29 +00:00
Mugurell
acf8635f10 [components] For https://github.com/mozilla-mobile/android-components/issues/10555 - Use INPUT_HANDLING_UNKNOWN as the default of InputResultDetail
We need to wait until having a response from GeckoView on how it handled the
touch only after which we'll know whether to animate the toolbar or not.

The edgecase scenario of having pull to refresh enabled even before having a
response from GeckoView will still work because "canOverscrollTop()" only
checks for the touch to not be handled by the browser to pan the page.
2021-07-16 12:37:29 +00:00
Sebastian Kaspari
4863bc3b15 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Use Java 11. 2021-07-15 14:57:23 +00:00
Mozilla L10n Automation Bot
b0d9d7ea29 [components] Import l10n. 2021-07-14 00:17:00 +00:00
codrut.topliceanu
6d605efc6e [components] For https://github.com/mozilla-mobile/android-components/issues/10588 - ERROR_SECURITY_SSL no longer shows Advanced button 2021-07-13 12:20:32 +00:00
mcarare
055e0f160f [components] For https://github.com/mozilla-mobile/android-components/issues/10571: Add optional icon tint for Toolbar Button. 2021-07-12 07:44:59 +00:00
Ionut Cristian Bedregeanu
60aa8bcb57 [components] Send the mutable list of menu items as parameter 2021-07-09 07:42:38 +00:00
Ionut Cristian Bedregeanu
266499b6f2 [components] For https://github.com/mozilla-mobile/android-components/issues/10559 - Adds showAddonsInMenu in WebExtensionBrowserMenuBuilder
Adds `showAddonsInMenu` in WebExtensionBrowserMenuBuilder to allow the option of removing `Add-ons`
item even if another extensions are displayed
Add unit tests to test if 'Add-ons' item visibility is updated properly
2021-07-09 07:42:38 +00:00
Mugurell
4e14471fa6 [components] For https://github.com/mozilla-mobile/android-components/issues/10470 - Persist and restore lastMediaAccess of TabSessionState 2021-07-08 17:08:25 +00:00
Mugurell
11b0ca6e98 [components] For https://github.com/mozilla-mobile/android-components/issues/10470 - Add a new lastMediaAccess property for TabSessionState
This new property will be a timestamp of the last time media started playing in
the current page or be 0 if media hadn't started playing or another page loaded
in this tab so media was stopped.

To observe the media changes and update this property LastMediaAccessMiddleware
will have to be set on BrowserStore.
2021-07-08 17:08:25 +00:00
Mozilla L10n Automation Bot
451641af27 [components] Import l10n. 2021-07-08 00:21:14 +00:00
Jonathan Almeida
ac53ae76e1 [components] Close https://github.com/mozilla-mobile/android-components/issues/10382: Handle exceptions thrown in RemoteTabsStorage 2021-07-07 03:33:22 +00:00
Christian Sadilek
2c9aef155c [components] Catch and log history metadata write exceptions 2021-07-05 19:44:27 +00:00
codrut.topliceanu
ac072ce9b3 [components] For https://github.com/mozilla-mobile/android-components/issues/10537 - Applies tint to imageView instead of drawable
`Drawable.setTint` did not correctly apply the tint received from Fenix. Switching to `imageView.setTintResource` fixes the issue.
2021-07-01 13:53:54 +00:00
Mozilla L10n Automation Bot
d1e1633948 [components] Import l10n. 2021-06-29 00:20:20 +00:00
Mozilla L10n Automation Bot
d3cd8fd9bb [components] Import l10n. 2021-06-26 00:20:19 +00:00
Sebastian Kaspari
78e0f282e8 [components] TrackingProtectionIconView: Use correct icon for OFF_FOR_A_SITE state. 2021-06-22 14:39:59 +00:00
Arturo Mejia
497d1d2c35 [components] Improvements to site permissions 2021-06-21 12:12:35 +00:00
Mozilla L10n Automation Bot
a77588fae1 [components] Import l10n. 2021-06-20 00:17:33 +00:00
Grisha Kruglov
ccb0a5014b [components] Extension functions for converting URLs to search terms 2021-06-17 19:36:48 +00:00
Mozilla L10n Automation Bot
2f28b87315 [components] Import l10n. 2021-06-17 00:20:36 +00:00
Christian Sadilek
ad14e1fdd2 [components] Add findNormalTab and selectedNormalTab extensions 2021-06-16 14:14:46 +00:00
mcarare
636adaf2a9 [components] For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin
(cherry picked from commit d99621583ceb11e7d91ebe284e40aec145793e48)
2021-06-15 08:32:26 +00:00
Arturo Mejia
66a515891e [components] Closes https://github.com/mozilla-mobile/android-components/issues/10245: Migrate tracking protection exceptions to new GV storage 2021-06-14 19:48:54 +00:00
Christian Sadilek
4dfb6d92c1 [components] Revert "For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin"
This reverts commit d99621583ceb11e7d91ebe284e40aec145793e48.
2021-06-14 18:09:24 +00:00
Jan-Erik Rediger
163330b349 [components] Upgrade to Glean v39.0.3
This also adjusts sync-telemetry to use the non-deprecated form of
events now.
2021-06-14 15:48:35 +00:00
mcarare
17c2336fde [components] For https://github.com/mozilla-mobile/android-components/issues/10404: Remove deprecated kotlin-android-extensions plugin 2021-06-14 10:05:57 +00:00
Mozilla L10n Automation Bot
a8fdec01fe [components] Import l10n. 2021-06-14 00:15:29 +00:00
Mozilla L10n Automation Bot
e50f0e5f9f [components] Import l10n. 2021-06-13 00:19:56 +00:00
Mozilla L10n Automation Bot
1234e2eecd [components] Import l10n. 2021-06-12 00:19:05 +00:00
Sebastian Kaspari
b16e52cecb [components] CreateEngineSessionMiddleware: Lookup custom tabs too. 2021-06-10 16:34:36 +02:00
Christian Sadilek
1923446e74 [components] Revert "Issue https://github.com/mozilla-mobile/android-components/issues/10335: Use Java 11."
This reverts commit ad61d7c2f709a0566ea8574450ad34dd185ee22b.
2021-06-10 14:32:47 +00:00
Sebastian Kaspari
a98efdc968 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Use Java 11. 2021-06-10 12:57:18 +00:00
Mozilla L10n Automation Bot
eabf669e4c [components] Import l10n. 2021-06-10 00:19:42 +00:00
Arturo Mejia
6ee48a1640 [components] Closes https://github.com/mozilla-mobile/android-components/issues/9391 Add support for geckoView site permissions storage. 2021-06-09 18:36:18 +00:00
Elise Richards
6bb8d67741 [components] For https://github.com/mozilla-mobile/android-components/issues/10419: Add Places calls for recently added and updated bookmarks (https://github.com/mozilla-mobile/android-components/pull/10425)
* Add Places calls for recently added bookmarks.

Changelog addition for bookmarks places api additions.

* Test for fetching list of recently added bookmarks

* Reword kdoc and changelog
2021-06-09 17:13:30 +00:00
Christian Sadilek
f8a8f07f81 [components] Make sure crash state is updated before unlinking engine state
This makes sure observers see the crashed state of a tab update
before the engine session is set to null. This is important so
observers can react to crashes and won't immediately request a
new engine session.
2021-06-09 14:45:57 +00:00
Sebastian Kaspari
e02a012bcb [components] Revert "Upgrade to Glean v39.0.0"
This reverts commit 5af3322f80c7a67b5b99c4d57d739dac74cf93c9.
2021-06-08 17:54:42 +02:00
Sebastian Kaspari
b7d77a521d [components] Complete migration from browser-session to browser-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10197: Move EngineObserver and EngineMiddleware to browser-state and refactor SessionManager dependency away.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate TabsUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate SessionUseCases to use BrowserStore exclusively.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532, https://github.com/mozilla-mobile/android-components/issues/10209: Migrate components to use new UseCase APIs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Migrate UndoMiddleware to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: Migrate CustomTabsUseCases to use BrowserStore.
* Issue https://github.com/mozilla-mobile/android-components/issues/10211: Migrate sample-browser to not depend on browser-session.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/3532: feature-tabs: Remove browser-session dependency.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix UndoMiddlewareTest
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Refactor SessionUseCasesTest to not use SessionManager.
* Issue https://github.com/mozilla-mobile/android-components/issues/10209: Fix SessionFeatureTest.
* Refactor support-migration tests to not use SessionManager.
* Fix tests in feature-contextmenu.
* Refactor feature-recentlyclosed tests to not use SessionManager
* Refactor browser-session-storage tests to not use SessionManager
* Refactor feature-intent tests to not use SessionManager
* Refactor feature-tabs tests to not use SessionManager pt. 1
* Refactor feature-customtabs tests to not depend on browser-session.
* Make sure initial load url flags are correct
* Refactor feature-tabs tests to not use SessionManager pt. 2
* Refactor browser-state tests to not depend on browser-session.
* SearchUseCasesTest: Use addTab use case instead of addPrivateTab.
* Samples Browser: Remove unused drawable.
* Fix feature-pwa tests
* Remove browser-session.
* Make sure engine session is linked for window requests
* Make sure engine session is linked when provided with tab
* Make sure engine session is linked when provided with tab pt. 2
* Prevent engine session from being created multiple times
* Prevent engine session from being created multiple times pt. 2
* Prevent engine session from being created multiple times pt. 3
* Part 4: REFACTOR ALL THE THINGS
* Update tests.
* Add additional test for multiple CreateEngineSessionAction dispatching.
* Refactor, some docs and tests
* Fix CustomTabs tests...
2021-06-08 14:44:09 +00:00
Jan-Erik Rediger
18f3609666 [components] Upgrade to Glean v39.0.0
This also adjusts sync-telemetry to use the non-deprecated form of
events now.
2021-06-08 09:31:46 +00:00