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
parent f69f9b2f99
commit 6b1b824b72
8 changed files with 6 additions and 27 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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