Bug 563738 (part2) - Add current Mozilla "snippets" (links and special events) in the about:home page. r=gavin,Pike a=blocking

This commit is contained in:
Marco Bonardo
2010-09-11 09:45:08 +02:00
parent 36396cb973
commit 50cb5ca13d
5 changed files with 104 additions and 5 deletions

View File

@@ -585,6 +585,7 @@ nsBrowserContentHandler.prototype = {
if (override != OVERRIDE_NONE) {
// Setup the default search engine to about:home page.
AboutHomeUtils.loadDefaultSearchEngine();
AboutHomeUtils.loadSnippetsURL();
switch (override) {
case OVERRIDE_NEW_PROFILE:
@@ -903,7 +904,17 @@ let AboutHomeUtils = {
, searchUrl: submission.uri.spec
}
this._storage.setItem("search-engine", JSON.stringify(engine));
}
},
loadSnippetsURL: function AHU_loadSnippetsURL()
{
const STARTPAGE_VERSION = 1;
const SNIPPETS_URL = "http://snippets.mozilla.com/" + STARTPAGE_VERSION + "/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/";
let updateURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"].
getService(Components.interfaces.nsIURLFormatter).
formatURL(SNIPPETS_URL);
this._storage.setItem("snippets-update-url", updateURL);
},
};
var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];