Commit Graph

2238 Commits

Author SHA1 Message Date
Noah Bond
ae756f53a9 [components] For https://github.com/mozilla-mobile/android-components/issues/10560: Fixed bug causing external links to open tabs irrespective of the session's private status (https://github.com/mozilla-mobile/android-components/pull/10857)
* For https://github.com/mozilla-mobile/android-components/issues/10560: Fixed bug causing external links to open tabs irrespective of the session's private status

* Updated findTabByUrl function names and comments for better clarity

* Fixed import detekt issue

* Refactored selectors test for better clarity

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-31 18:53:52 +00:00
Mugurell
b8c40d5126 [components] For https://github.com/mozilla-mobile/android-components/issues/10880 - New Pocket endpoint.
No authentication needed. No other locales supported.
2021-08-31 15:21:46 +00:00
Sebastian Kaspari
78badfe619 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10834: Add BrowserIcons.Loader() composable function to load website icons in Jetpack Compose code. 2021-08-31 12:44:28 +00:00
Mozilla L10n Automation Bot
0c48094300 [components] Import l10n. 2021-08-31 00:19:40 +00:00
Mozilla L10n Automation Bot
06bf2369d8 [components] Import l10n. 2021-08-29 00:19:31 +00:00
Grisha Kruglov
e3ac5dc4d2 [components] Make sure to use writeScope when writing to history metadata
Not using a write scope means we could have concurrent writes, leading
to sqlite throwing "database locked" exceptions.

All other writers here use the writeScope.
2021-08-25 19:31:42 +00:00
Mozilla L10n Automation Bot
85f78e899b [components] Import l10n. 2021-08-25 00:17:33 +00:00
Mozilla L10n Automation Bot
0c51979722 [components] Import l10n. 2021-08-22 00:20:53 +00:00
Mugurell
e277dd03f0 [components] For https://github.com/mozilla-mobile/android-components/issues/10803 - Force expanding the toolbar if requested by GeckoView 2021-08-16 07:46:15 +00:00
Mozilla L10n Automation Bot
5f47d86a46 [components] Import l10n. 2021-08-13 00:23:45 +00:00
Gabriel Luong
c81ed1976a [components] Issue https://github.com/mozilla-mobile/android-components/issues/10798 - Refactor getRepresentativeSnippet and getRepresentativeCharacter from browser-icons to support-ktx 2021-08-12 16:36:53 +00:00
Jonathan Almeida
e7d3f34077 [components] Close https://github.com/mozilla-mobile/android-components/issues/10769: Add DebugAction.UpdateCreatedAtAction with reducer
We wanted to introduce this action for testing purposes in client apps
that want to "turn back time" for a certain tab.

The difficulty is in ensuring clients do not misuse these actions, and
we thought of a few strategies:

- Option 1: Make a separate grouping called `DebugAction` and document
that these are special actions.

- Option 2: Using a middleware, we only allow changes to the store
depending on some dynmamic logic in the client app. This is a bit
complicated and requries the user to restart the app to add this
special middleware.

- Option 3: Add an annotation that requires the client to opt into using
the action.

In this patch, I decided to go with a combination of options 1 and 3
which gave us the right about of warning and flexibility.

With option 2, we were still required to add new actions to the store
and the middleware would not have prevented misuse in those cases.
2021-08-12 03:56:04 +00:00
Jonathan Almeida
478711a6bf [components] Close https://github.com/mozilla-mobile/android-components/issues/10677: Update Mockito to 3.11.2
Co-authored-by: Mugurell <Mugurell@users.noreply.github.com>
2021-08-12 02:25:56 +00:00
Mozilla L10n Automation Bot
b74636142b [components] Import l10n. 2021-08-10 00:19:37 +00:00
Sebastian Kaspari
4c548dc501 [components] Remove AwesomeBar.shouldClearSuggestions 2021-08-06 11:13:56 +00:00
Grisha Kruglov
47a5196e6a [components] Make sure to preserve private state when recreating a RecoverableTab
regression from https://github.com/mozilla-mobile/android-components/pull/10711/files
2021-08-05 15:53:27 -07:00
Grisha Kruglov
2cb270feed [components] Introduced 'restored' content state for tracking tab restoration 2021-08-05 11:47:54 -07:00
Grisha Kruglov
14a116801f [components] Support for tracking external sources
Mainly, does two things:
- refactors SessionState.Source into a richer form (splitting sources
  into Internal and External, where External ones track information
  about originating package)
- adds persistence of External sources into tab session state; we don't
  want to persist Internal sources as that was explicitly removed before
  for causing various issues (e.g. UI behaving incorrectly after
  restoring tabs with various internal sources set)
2021-08-05 11:47:54 -07:00
Mozilla L10n Automation Bot
4b57111308 [components] Import l10n. 2021-08-05 14:32:48 +00:00
Mozilla L10n Automation Bot
8e637deda7 [components] Import l10n. 2021-08-04 00:25:18 +00:00
mcarare
f0d1898475 [components] For https://github.com/mozilla-mobile/android-components/issues/10737: Also pass isPrivate property to download request. 2021-08-03 16:05:38 +00:00
Arturo Mejia
26e8e790db [components] Workaround for querying geckoView tracking protection exceptions for bugzilla 1723280. 2021-08-02 13:46:39 +00:00
Steven Knipe
dfd65e842d [components] Updated failing test to make sense (require different images and correct description) 2021-08-02 12:24:51 +00:00
Steven Knipe
ea9cb18430 [components] Add longClickListener documentation, fix style problems
move TwoStateButton background to match argument order
2021-08-02 12:24:51 +00:00
Steven Knipe
d87ac452f6 [components] Add tinting to TwoStateButton
(requires its own setTintResource function)
2021-08-02 12:24:51 +00:00
Steven Knipe
6efbccee57 [components] Add disableInSecondaryState to TwoStateButton 2021-08-02 12:24:51 +00:00
Steven Knipe
6bb6265dc7 [components] Change enable/disable to primary/secondary, update documentation 2021-08-02 12:24:51 +00:00
Steven Knipe
d3a10b29bc [components] TwoStateButton: add support for longclick listener,
Also fix reversal of enabled/disabled logic
2021-08-02 12:24:51 +00:00
Steven Knipe
2339f9b1d8 [components] Add longClickListener to Toolbar's ActionButton and BrowserToolbar's Button 2021-08-02 12:24:51 +00:00
codrut.topliceanu
3bd5ddb4a0 [components] For https://github.com/mozilla-mobile/android-components/issues/10603 - Adds createdAt to TabSessionState 2021-08-02 10:07:38 +00:00
Sebastian Kaspari
ebf54eb308 [components] TrackingProtectionIconView: Always call updateIcon() to initialize. 2021-07-30 09:32:28 +00:00
Sebastian Kaspari
ce323400dd [components] Run ktlintFormat to fix new ktlint errors. 2021-07-28 12:03:23 +00:00
Michael Comella
06e80c6e10 [components] For https://github.com/mozilla-mobile/android-components/issues/10604: remove remaining unused imports automatically.
This commit was automatically generated with:
```sh
./gradlew ktlint --args="-F"
```
2021-07-27 19:39:04 +00:00
Michael Comella
9f3e6f1a1b [components] For https://github.com/mozilla-mobile/android-components/issues/10604: reuse new TestCoroutineDispatcher in additional tests.
These follow a few more simple patterns I was able to find:
- the testDispatcher is not used anywhere else: remove it
- the testDispatcher is used to set a main dispatcher: this is redundant
to the test rule so remove it both the dispatcher & the main dispatcher
- the testDispatcher is actually used elsewhere: for simplicity, change
the reference to point at the MainCoroutineRule.
2021-07-27 19:39:04 +00:00
Michael Comella
b3c2050afa [components] For https://github.com/mozilla-mobile/android-components/issues/10604: deprecate createTestCoroutinesDispatcher.
This is redundant to the built-in TestCoroutineDispatcher() method.
TestCoroutineDispatcher is also preferred because it has enhanced
testing functionality including defining a context-specific
`runBlockingTest` function, the ability to control `delay` timings, etc.
2021-07-27 19:39:04 +00:00
Arturo Mejia
e4d539f111 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10448 show toolbar permissions indicator when permissions change from their default. 2021-07-27 17:25:23 +00:00
Roger Yang
028c8b491d [components] Closes https://github.com/mozilla-mobile/android-components/issues/10617: Add common domain for icon requests 2021-07-26 17:31:36 +00:00
mcarare
23e050a3c3 [components] For https://github.com/mozilla-mobile/android-components/issues/10670: Add optional parameter to filter recent bookmarks based on added date. 2021-07-23 16:06:47 +00:00
Arturo Mejia
20c74779f3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10127 expose new GV api for detecting SmartBlock exceptions. 2021-07-22 20:54:06 +00:00
Sammy Khamis
4d75239856 [components] updated lib version and reverted lastUsed to long 2021-07-21 22:48:58 +00:00
Sammy Khamis
575b8a38dc [components] small changes based on recent changes 2021-07-21 22:48:58 +00:00
Sammy Khamis
3015f1fead [components] updated a-s version, fixed some minor changes 2021-07-21 22:48:58 +00:00
Sammy Khamis
0f2fc25fbb [components] updated remote tabs based on a-s tabs update 2021-07-21 22:48:58 +00:00
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