Bug 1673047 - Remove browser.migrate.showBookmarksToolbarAfterMigration pref and set the default behavior to the 'true' branch. r=mconley.

Differential Revision: https://phabricator.services.mozilla.com/D161375
This commit is contained in:
brian 2022-11-22 15:30:56 +00:00
Родитель 83e864597a
Коммит be3a6d1b65
9 изменённых файлов: 6 добавлений и 49 удалений

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

@ -2137,8 +2137,6 @@ pref("browser.migrate.safari.enabled", true);
pref("browser.migrate.opera.enabled", false);
pref("browser.migrate.vivaldi.enabled", false);
pref("browser.migrate.showBookmarksToolbarAfterMigration", true);
pref("extensions.pocket.api", "api.getpocket.com");
pref("extensions.pocket.enabled", true);
pref("extensions.pocket.oAuthConsumerKey", "40249-e88c401e1b1f2242d9e441c4");

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

@ -9,7 +9,6 @@ import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Sqlite: "resource://gre/modules/Sqlite.sys.mjs",
});
@ -103,7 +102,6 @@ Bookmarks.prototype = {
if (toolbarBMs.length) {
let parentGuid = lazy.PlacesUtils.bookmarks.toolbarGuid;
await MigrationUtils.insertManyBookmarksWrapper(toolbarBMs, parentGuid);
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();
}
})().then(
() => aCallback(true),

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

@ -23,7 +23,6 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Qihoo360seMigrationUtils: "resource:///modules/360seMigrationUtils.sys.mjs",
});
@ -264,7 +263,6 @@ async function GetBookmarksResource(aProfileFolder, aBrowserKey) {
bookmarks,
parentGuid
);
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();
}
// Importing Other Bookmarks items

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

@ -16,7 +16,6 @@ import { MSMigrationUtils } from "resource:///modules/MSMigrationUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ESEDBReader: "resource:///modules/ESEDBReader.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});
@ -386,7 +385,6 @@ EdgeBookmarksMigrator.prototype = {
if (toolbarBMs.length) {
let parentGuid = lazy.PlacesUtils.bookmarks.toolbarGuid;
await MigrationUtils.insertManyBookmarksWrapper(toolbarBMs, parentGuid);
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();
}
},

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

@ -9,7 +9,6 @@ import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
});
@ -449,7 +448,6 @@ Bookmarks.prototype = {
// Import to the bookmarks toolbar.
let folderGuid = lazy.PlacesUtils.bookmarks.toolbarGuid;
await this._migrateFolder(entry, folderGuid);
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();
} else if (entry.isReadable()) {
let {
bookmarks: childBookmarks,

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

@ -15,6 +15,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
ResponsivenessMonitor: "resource://gre/modules/ResponsivenessMonitor.sys.mjs",
Sqlite: "resource://gre/modules/Sqlite.sys.mjs",
@ -1091,6 +1092,11 @@ export var MigrationUtils = Object.seal({
bmData.push({ parentGuid, guid, lastModified, type });
}
}
if (parent == lazy.PlacesUtils.bookmarks.toolbarGuid) {
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibility(
true /* aForceVisible */
);
}
},
ex => Cu.reportError(ex)
);

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

@ -13,7 +13,6 @@ import {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PropertyListUtils: "resource://gre/modules/PropertyListUtils.sys.mjs",
});
@ -48,12 +47,6 @@ Bookmarks.prototype = {
? this.READING_LIST_COLLECTION
: this.ROOT_COLLECTION;
await this._migrateCollection(children, collection);
if (
this._histogramBookmarkRoots &
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_TOOLBAR
) {
lazy.PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();
}
})().then(
() => aCallback(true),
e => {

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

@ -1,9 +1,5 @@
"use strict";
const { CustomizableUI } = ChromeUtils.import(
"resource:///modules/CustomizableUI.jsm"
);
add_task(async function() {
let migrator = await MigrationUtils.getMigrator("ie");
// Sanity check for the source.
@ -23,21 +19,6 @@ add_task(async function() {
}
};
PlacesUtils.observers.addListener(["bookmark-added"], listener);
let observerNotified = false;
Services.obs.addObserver((aSubject, aTopic, aData) => {
let [toolbar, visibility] = JSON.parse(aData);
Assert.equal(
toolbar,
CustomizableUI.AREA_BOOKMARKS,
"Notification should be received for bookmarks toolbar"
);
Assert.equal(
visibility,
"true",
"Notification should say to reveal the bookmarks toolbar"
);
observerNotified = true;
}, "browser-set-toolbar-visibility");
await promiseMigration(migrator, MigrationUtils.resourceTypes.BOOKMARKS);
PlacesUtils.observers.removeListener(["bookmark-added"], listener);
@ -46,7 +27,4 @@ add_task(async function() {
itemCount,
"Ensure telemetry matches actual number of imported items."
);
// Check the bookmarks have been imported to all the expected parents.
Assert.ok(observerNotified, "The observer should be notified upon migration");
});

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

@ -1578,16 +1578,6 @@ export var PlacesUIUtils = {
}
},
maybeToggleBookmarkToolbarVisibilityAfterMigration() {
if (
Services.prefs.getBoolPref(
"browser.migrate.showBookmarksToolbarAfterMigration"
)
) {
this.maybeToggleBookmarkToolbarVisibility(true);
}
},
async managedPlacesContextShowing(event) {
let menupopup = event.target;
let document = menupopup.ownerDocument;