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-15 21:08:14 +00:00
Родитель f69f9b2f99
Коммит 6b1b824b72
8 изменённых файлов: 6 добавлений и 27 удалений

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

@ -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 => {

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

@ -1514,16 +1514,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;