mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 1126186: Allow users to turn off all tiles that aren't history tiles and update newtab cogmenu wording. r=adw
This commit is contained in:
parent
5e63826da7
commit
a4871bd274
@ -491,7 +491,7 @@ input[type=button] {
|
||||
.newtab-customize-panel-item,
|
||||
.newtab-search-panel-engine,
|
||||
#newtab-search-manage {
|
||||
padding: 4px 24px;
|
||||
padding: 10px 10px 10px 25px;
|
||||
}
|
||||
|
||||
.newtab-customize-panel-item:not(:last-child),
|
||||
@ -513,6 +513,10 @@ input[type=button] {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.newtab-customize-panel-item:not([selected]) {
|
||||
color: #919191;
|
||||
}
|
||||
|
||||
.newtab-customize-panel-item[selected],
|
||||
.newtab-search-panel-engine[selected] {
|
||||
background: url("chrome://global/skin/menu/shared-menu-check.png") center left 4px no-repeat transparent;
|
||||
|
@ -37,13 +37,13 @@
|
||||
<xul:panel id="newtab-customize-panel" orient="vertical" type="arrow"
|
||||
noautohide="true" hidden="true">
|
||||
<xul:hbox id="newtab-customize-enhanced" class="newtab-customize-panel-item">
|
||||
<xul:label>&newtab.customize.enhanced;</xul:label>
|
||||
<xul:label>&newtab.customize.suggested;</xul:label>
|
||||
</xul:hbox>
|
||||
<xul:hbox id="newtab-customize-classic" class="newtab-customize-panel-item">
|
||||
<xul:label>&newtab.customize.classic;</xul:label>
|
||||
<xul:label>&newtab.customize.topsites;</xul:label>
|
||||
</xul:hbox>
|
||||
<xul:hbox id="newtab-customize-blank" class="newtab-customize-panel-item">
|
||||
<xul:label>&newtab.customize.blank;</xul:label>
|
||||
<xul:label>&newtab.customize.blank2;</xul:label>
|
||||
</xul:hbox>
|
||||
</xul:panel>
|
||||
|
||||
|
@ -40,21 +40,21 @@ function runTests() {
|
||||
yield addNewTabPageTab();
|
||||
yield customizeNewTabPage("classic");
|
||||
let {type, enhanced, title} = getData(0);
|
||||
is(type, "organic", "directory link is organic");
|
||||
isnot(enhanced, "", "directory link has enhanced image");
|
||||
is(title, "title");
|
||||
isnot(type, "enhanced", "history link is not enhanced");
|
||||
is(enhanced, "", "history link has no enhanced image");
|
||||
is(title, "site#-1");
|
||||
|
||||
is(getData(1), null, "history link pushed out by directory link");
|
||||
is(getData(1), null, "there is only one link and it's a history link");
|
||||
|
||||
// Test with enhanced = true
|
||||
yield addNewTabPageTab();
|
||||
yield customizeNewTabPage("enhanced");
|
||||
({type, enhanced, title} = getData(0));
|
||||
is(type, "organic", "directory link is still organic");
|
||||
isnot(enhanced, "", "directory link still has enhanced image");
|
||||
is(type, "organic", "directory link is organic");
|
||||
isnot(enhanced, "", "directory link has enhanced image");
|
||||
is(title, "title");
|
||||
|
||||
is(getData(1), null, "history link still pushed out by directory link");
|
||||
is(getData(1), null, "history link pushed out by directory link");
|
||||
|
||||
// Test with a pinned link
|
||||
setPinnedLinks("-1");
|
||||
|
@ -5,9 +5,9 @@
|
||||
<!-- These strings are used in the about:newtab page -->
|
||||
<!ENTITY newtab.pageTitle "New Tab">
|
||||
<!ENTITY newtab.customize.title "Customize your New Tab page">
|
||||
<!ENTITY newtab.customize.enhanced "Enhanced">
|
||||
<!ENTITY newtab.customize.classic "Classic">
|
||||
<!ENTITY newtab.customize.blank "Blank">
|
||||
<!ENTITY newtab.customize.suggested "Show suggested and your top sites">
|
||||
<!ENTITY newtab.customize.topsites "Show your top sites">
|
||||
<!ENTITY newtab.customize.blank2 "Show blank page">
|
||||
<!ENTITY newtab.customize.what "What is this page?">
|
||||
<!ENTITY newtab.intro.header "What is this page?">
|
||||
<!ENTITY newtab.undo.removedLabel "Thumbnail removed.">
|
||||
|
@ -935,7 +935,12 @@ let Links = {
|
||||
_getMergedProviderLinks: function Links__getMergedProviderLinks() {
|
||||
// Build a list containing a copy of each provider's sortedLinks list.
|
||||
let linkLists = [];
|
||||
for (let links of this._providers.values()) {
|
||||
for (let provider of this._providers.keys()) {
|
||||
if (!AllPages.enhanced && provider != PlacesProvider) {
|
||||
// Only show history tiles if we're not in 'enhanced' mode.
|
||||
continue;
|
||||
}
|
||||
let links = this._providers.get(provider);
|
||||
if (links && links.sortedLinks) {
|
||||
linkLists.push(links.sortedLinks.slice());
|
||||
}
|
||||
|
@ -7,8 +7,12 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/NewTabUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, true);
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user