Bug 1634386 - The Password Import Autocomplete suggestion is displayed on Linux r=MattN

Share ChromeMigrationUtils.supportsLoginsForPlatform for ChromeProfileMigrator.getResources and ChromeMigrationUtils.getImportableLogins.

Differential Revision: https://phabricator.services.mozilla.com/D87639
This commit is contained in:
Ed Lee 2020-08-20 17:48:50 +00:00
Родитель 0ec64c5610
Коммит b666b9283a
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -37,6 +37,10 @@ var ChromeMigrationUtils = {
// }
_extensionLocaleStrings: {},
get supportsLoginsForPlatform() {
return ["macosx", "win"].includes(AppConstants.platform);
},
/**
* Get all extensions installed in a specific profile.
* @param {String} profileId - A Chrome user profile ID. For example, "Profile 1".
@ -369,6 +373,11 @@ var ChromeMigrationUtils = {
*/
_importableLoginsCache: null,
async getImportableLogins(formOrigin) {
// Only provide importable if we actually support importing.
if (!this.supportsLoginsForPlatform) {
return undefined;
}
// Lazily fill the cache with all importable login browsers.
if (!this._importableLoginsCache) {
this._importableLoginsCache = new Map();

Просмотреть файл

@ -120,7 +120,7 @@ ChromeProfileMigrator.prototype.getResources = async function Chrome_getResource
GetHistoryResource(profileFolder),
GetCookiesResource(profileFolder),
];
if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
if (ChromeMigrationUtils.supportsLoginsForPlatform) {
possibleResourcePromises.push(
this._GetPasswordsResource(profileFolder)
);