Bug 878690 - Use FormHistory.jsm for the Safari profile migrator. r=mak

This commit is contained in:
Mark Hammond 2013-06-04 09:51:36 +10:00
parent a6ddb8018f
commit 5a6f7551ba

View File

@ -19,6 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
function Bookmarks(aBookmarksFile) {
this._file = aBookmarksFile;
@ -540,11 +542,11 @@ SearchStrings.prototype = {
if (aDict.has("RecentSearchStrings")) {
let recentSearchStrings = aDict.get("RecentSearchStrings");
if (recentSearchStrings && recentSearchStrings.length > 0) {
let formHistory = Cc["@mozilla.org/satchel/form-history;1"].
getService(Ci.nsIFormHistory2);
for (let searchString of recentSearchStrings) {
formHistory.addEntry("searchbar-history", searchString);
}
let changes = [{op: "add",
fieldname: "searchbar-history",
value: searchString}
for (searchString of recentSearchStrings)];
FormHistory.update(changes);
}
}
}.bind(this), aCallback));