From 6b1b824b72cb899cc0fbe2d72d81c4b39534fbc1 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 15 Nov 2022 21:08:14 +0000 Subject: [PATCH] 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 --- browser/app/profile/firefox.js | 2 -- .../components/migration/360seMigrationUtils.sys.mjs | 2 -- .../components/migration/ChromeProfileMigrator.sys.mjs | 2 -- .../components/migration/EdgeProfileMigrator.sys.mjs | 2 -- browser/components/migration/MSMigrationUtils.sys.mjs | 2 -- browser/components/migration/MigrationUtils.sys.mjs | 6 ++++++ .../components/migration/SafariProfileMigrator.sys.mjs | 7 ------- browser/components/places/PlacesUIUtils.sys.mjs | 10 ---------- 8 files changed, 6 insertions(+), 27 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 9adb7500ff00..8905494cadc2 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -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"); diff --git a/browser/components/migration/360seMigrationUtils.sys.mjs b/browser/components/migration/360seMigrationUtils.sys.mjs index 969210b792b8..7c1ecbdb0f96 100644 --- a/browser/components/migration/360seMigrationUtils.sys.mjs +++ b/browser/components/migration/360seMigrationUtils.sys.mjs @@ -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), diff --git a/browser/components/migration/ChromeProfileMigrator.sys.mjs b/browser/components/migration/ChromeProfileMigrator.sys.mjs index ebf51e9bfeb5..7b75f13e05de 100644 --- a/browser/components/migration/ChromeProfileMigrator.sys.mjs +++ b/browser/components/migration/ChromeProfileMigrator.sys.mjs @@ -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 diff --git a/browser/components/migration/EdgeProfileMigrator.sys.mjs b/browser/components/migration/EdgeProfileMigrator.sys.mjs index 59549625b91e..0644dcf73921 100644 --- a/browser/components/migration/EdgeProfileMigrator.sys.mjs +++ b/browser/components/migration/EdgeProfileMigrator.sys.mjs @@ -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(); } }, diff --git a/browser/components/migration/MSMigrationUtils.sys.mjs b/browser/components/migration/MSMigrationUtils.sys.mjs index 815660566039..27014f911709 100644 --- a/browser/components/migration/MSMigrationUtils.sys.mjs +++ b/browser/components/migration/MSMigrationUtils.sys.mjs @@ -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, diff --git a/browser/components/migration/MigrationUtils.sys.mjs b/browser/components/migration/MigrationUtils.sys.mjs index 2e1c6288a711..cc03a4d5990c 100644 --- a/browser/components/migration/MigrationUtils.sys.mjs +++ b/browser/components/migration/MigrationUtils.sys.mjs @@ -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) ); diff --git a/browser/components/migration/SafariProfileMigrator.sys.mjs b/browser/components/migration/SafariProfileMigrator.sys.mjs index 73840ea2db18..1e5ff0ddb89d 100644 --- a/browser/components/migration/SafariProfileMigrator.sys.mjs +++ b/browser/components/migration/SafariProfileMigrator.sys.mjs @@ -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 => { diff --git a/browser/components/places/PlacesUIUtils.sys.mjs b/browser/components/places/PlacesUIUtils.sys.mjs index a15f361cbcce..ee26ccbf11b8 100644 --- a/browser/components/places/PlacesUIUtils.sys.mjs +++ b/browser/components/places/PlacesUIUtils.sys.mjs @@ -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;