diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 570296abcdb..3c2bb514ed3 100644 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -3,7 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ForgetAboutSite", "resource://gre/modules/ForgetAboutSite.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", @@ -224,10 +223,18 @@ PlacesController.prototype = { doCommand: function PC_doCommand(aCommand) { switch (aCommand) { case "cmd_undo": - PlacesUtils.transactionManager.undoTransaction(); + if (!PlacesUIUtils.useAsyncTransactions) { + PlacesUtils.transactionManager.undoTransaction(); + return; + } + PlacesTransactions.undo().then(null, Cu.reportError); break; case "cmd_redo": - PlacesUtils.transactionManager.redoTransaction(); + if (!PlacesUIUtils.useAsyncTransactions) { + PlacesUtils.transactionManager.redoTransaction(); + return; + } + PlacesTransactions.redo().then(null, Cu.reportError); break; case "cmd_cut": case "placesCmd_cut": diff --git a/browser/components/places/content/placesOverlay.xul b/browser/components/places/content/placesOverlay.xul index ca00ec8bef0..12aae17b7c4 100644 --- a/browser/components/places/content/placesOverlay.xul +++ b/browser/components/places/content/placesOverlay.xul @@ -24,8 +24,13 @@ var Ci = Components.interfaces; var Cr = Components.results; - Components.utils.import("resource://gre/modules/PlacesUtils.jsm"); - Components.utils.import("resource:///modules/PlacesUIUtils.jsm"); + Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + XPCOMUtils.defineLazyModuleGetter(window, + "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); + XPCOMUtils.defineLazyModuleGetter(window, + "PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm"); + XPCOMUtils.defineLazyModuleGetter(window, + "PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm"); ]]>