The .portrait property is used in MediaSessionFullscreenFeature::setOrientationForTabState and already handles the null case, so just
Differential Revision: https://phabricator.services.mozilla.com/D209447
This patch updates Android Components to use the new `hasVisibleChange `
information from the translations engine to better manage translations visible state.
Differential Revision: https://phabricator.services.mozilla.com/D209577
- remove the firefox-android exclusions from .prettierignore
- add a few specific exclusions to .prettierignore for files with existing errors
- add a few specific entries to Generated.txt and ThirdPartyPaths.txt
- add `initial_experiments.json` to the list of generated files: these are updated from Nimbus
- run `mach lint --fix --linter=eslint -- mobile/android` to generate all the formatting changes
Differential Revision: https://phabricator.services.mozilla.com/D206915
This commit introduces plumbing for sending "close tab" commands to
other devices that are signed in to the same Mozilla account, and for
receiving "close tab" commands from other devices.
Differential Revision: https://phabricator.services.mozilla.com/D208051
Right now, it is only possible to access the “offer to translate” setting off of page settings. Unlike most of the other page settings, this setting is also a global setting.
This patch adds an option to view this setting independently of page settings and helps keep it in sync, when page settings change this setting as well.
We need this because it will soon be possible to access the global settings layer of settings directly via the main menu settings.
This patch:
* Adds `SetGlobalOfferTranslateSettingAction` - Sets the `offerTranslation` value on the global `TranslationsBrowserState`. Intended for global usage.
* Adds `UpdateGlobalOfferTranslateSettingAction` - A global way to update the offer to translate value outside of a page.
* Adds `TranslationOperation.FETCH_OFFER_SETTING` - The same as `SetGlobalOfferTranslateSettingAction`, but for a tab. Intended for tab usage.
* Adds a call to set `offerTranslation` on `Init`
Differential Revision: https://phabricator.services.mozilla.com/D208233
We used to get a session token for Fenix using a special oauth scope,
however that scope leads to there being two session tokens assosiated
with Fenix, one assosiated with the web content and another with the
scope. This patch makes it so that there is only one session token
shared between the content and browser.
Differential Revision: https://phabricator.services.mozilla.com/D205381
This patch adds functionality for fetching global language settings for
translations.
This patch adds:
* The Operation `FETCH_AUTOMATIC_LANGUAGE_SETTINGS` for fetching the global language
settings from the translation engine.
* `SetLanguageSettingsAction` to set the `languageSettings` on `TranslationsBrowserState`.
*Initialization occurs in `initializeBrowserStore'
* Updates page settings to call `FETCH_AUTOMATIC_LANGUAGE_SETTINGS` after a page level
language update. (These settings coordinate both globally and on a page level.)
* A subtle bug was introduced when page settings were moved from `val` to
`var` for updating page settings.
* Everything works as expected with the reducer updating etc., however
changes on page settings are not observed in compose.
This patch adds a helper for converting BCP 47 codes to translations
supported languages.
Adds:
* `toLanguageMap` - maps a map of BCP 47 code (key) to Language (value)
* `findLanguage` - finds a language using the `toLanguageMap`
* `mapLanguageSettings` - makes a new display ready map for converting
the language settings from Map<String, LanguageSetting>?) to Map<Language?, LanguageSetting>
This patch adds a flow for determining the download size that would
occur for a given translation. Expected use case is for low-data modes.
* New `FetchTranslationDownloadSizeAction`
* New `SetTranslationDownloadSizeAction`
* New `CouldNotDetermineDownloadSizeError`
* New `TranslationDownloadSize` object and `translationDownloadSize` on the
session `TranslationsState`
This patch supports the workflow for checking if the device architecture supports translations.
This patch adds:
* New `TranslationsBrowserState` to hold global translations engine state
* New `SetEngineSupportedAction` to set the isEngineSupported value on `TranslationsBrowserState`
* New `EngineExceptionAction` to set errors on `TranslationsBrowserState`
The goal of this bug is to have a way to update page settings.
It adds:
* A new action, `UpdatePageSettingAction`
* This action has four options:
* `UPDATE_ALWAYS_OFFER_POPUP`
* `UPDATE_ALWAYS_TRANSLATE_LANGUAGE`
* `UPDATE_NEVER_TRANSLATE_LANGUAGE`
* `UPDATE_NEVER_TRANSLATE_SITE`
* Each operation eagerly sets the new setting on the browser store, then
sends the request to the engine. If setting on the engine fails, then
they will re-request the page settings in order to remain in-sync.
This patch refactors a few things for fetching supported languages:
* `TranslateExpectedAction` is decoupled from fetching languages
* Now use `OperationRequestedAction` w/ `FETCH_SUPPORTED_LANGUAGES`
* Refactors the Fenix fragment to send `OperationRequestedAction` as a
placeholder for data initialization
* `TranslateSetLanguagesAction` is now `SetSupportedLanguagesAction`
This patch adds two new Actions:
* `OperationRequestedAction` - for requesting to fetch data
* `SetSettingsAction` - for setting that data on the browser store
`TranslationsMiddleware` reacts to these Actions by fetching and setting
the appropriate data.
The patch to update data will be bug 1877203.
This patch adds the additional state information of `supportedLanguages` and `translationError` to `TranslationsState`. The `supportedLanguages` are the languages the translation engine supports for translating for use in UI dropdowns. `translationError` is any error that occurred relating to translating.
`supportedLanguages` is currently set via an action that indicates the intention to translate on the new `EngineMiddleware` addition of `TranslationsMiddleware`. This patch also adds a new `TranslationOperation` of `FETCH_TO_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.
`translationError` is added to the `TranslationsState` to store errors as they arise. `TranslateExceptionAction` is also refactored from using the generic `Throwable` to the new `TranslationError` to accommodate `supportedLanguages` and better general error handling.O_AND_FROM_LANGUAGES` to indicate the process of getting `supportedLanguages`.