Changed != -1) {
      expiration = Math.min(expiration, now - lastDefaultChanged);
    }

    results = results.filter(
      result => now - Math.floor(result.lastUsed / 1000) < expiration
    );
    results.sort((a, b) => b.lastUsed - a.lastUsed);

    if (results.length > lazy.UrlbarPrefs.get("recentsearches.maxResults")) {
      results.length = lazy.UrlbarPrefs.get("recentsearches.maxResults");
    }

    for (let result of results) {
      let res = new lazy.UrlbarResult({
        type: UrlbarUtils.RESULT_TYPE.SEARCH,
        source: UrlbarUtils.RESULT_SOURCE.HISTORY,
        payload: {
          engine: engine.name,
          suggestion: result.value,
          title: result.value,
          isBlockable: true,
          blockL10n: { id: "urlbar-result-menu-remove-from-history" },
          helpUrl:
            Services.urlFormatter.formatURLPref("app.support.baseURL") +
            "awesome-bar-result-menu",
        },
      });
      addCallback(this, res);
    }
  }

  observe(subject, topic, data) {
    switch (data) {
      case lazy.SearchUtils.MODIFIED_TYPE.DEFAULT:
        lazy.UrlbarPrefs.set(LASTDEFAULTCHANGED_PREF, Date.now().toString());
        break;
    }
  }
}
PK