Bug 975228 - Create logic to merge frecency-pages and Tiles (Tile equiv 1000 frecency) [r=adw]

Use DirectoryLinksProvider for Firefox and make PlacesProvider match in expected Links format.
Make sure there's at least 2 of each type so Telemetry doesn't know for sure which links were used.
This commit is contained in:
Olivier Yiptong 2014-03-29 09:00:10 -07:00
parent 5af27d6f35
commit b05d4792a0
4 changed files with 58 additions and 46 deletions

View File

@ -2,8 +2,11 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directorySource";
Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, true);
// start with no directory links by default
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, "data:application/json,{}");
let tmp = {};
Cu.import("resource://gre/modules/Promise.jsm", tmp);
@ -26,6 +29,7 @@ registerCleanupFunction(function () {
gWindow.gBrowser.removeTab(gWindow.gBrowser.tabs[1]);
Services.prefs.clearUserPref(PREF_NEWTAB_ENABLED);
Services.prefs.clearUserPref(PREF_NEWTAB_DIRECTORYSOURCE);
});
/**

View File

@ -22,6 +22,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
XPCOMUtils.defineLazyModuleGetter(this, "ContentClick",
"resource:///modules/ContentClick.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DirectoryLinksProvider",
"resource://gre/modules/DirectoryLinksProvider.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
@ -475,6 +478,8 @@ BrowserGlue.prototype = {
WebappManager.init();
PageThumbs.init();
NewTabUtils.init();
DirectoryLinksProvider.init();
NewTabUtils.links.addProvider(DirectoryLinksProvider);
BrowserNewTabPreloader.init();
#ifdef NIGHTLY_BUILD
if (Services.prefs.getBoolPref("dom.identity.enabled")) {

File diff suppressed because one or more lines are too long

View File

@ -577,6 +577,9 @@ let PlacesProvider = {
title: title,
frecency: frecency,
lastVisitDate: lastVisitDate,
bgColor: "transparent",
type: "history",
imageURISpec: null,
});
}
}