Backed out changeset 9798359363a0 (bug 1177152)

This commit is contained in:
Tim Taubert 2015-07-17 14:06:50 +02:00
parent 51075cc2af
commit 2d36ec5b8f
11 changed files with 15 additions and 243 deletions

View File

@ -1919,7 +1919,6 @@ pref("browser.apps.URL", "https://marketplace.firefox.com/discovery/");
#ifdef NIGHTLY_BUILD
pref("browser.polaris.enabled", false);
pref("privacy.trackingprotection.ui.enabled", false);
pref("privacy.trackingprotection.introURL", "https://support.mozilla.org/kb/tracking-protection-firefox");
#endif
#ifdef NIGHTLY_BUILD

View File

@ -8,7 +8,6 @@
body {
display: flex;
flex-direction: column;
box-sizing: border-box;
min-height: 100vh;
padding: 0 48px;
@ -16,17 +15,9 @@ body {
justify-content: center;
}
body.tour {
margin: 0;
padding: 0;
align-items: stretch;
}
body.normal .showPrivate,
body.private .showNormal,
body.tour #pageContainer,
body:not(.tour) .showTour {
display: none !important;
body.private .showNormal {
display: none;
}
#pageContainer {
@ -68,73 +59,3 @@ button {
margin-top: 1.2em;
-moz-margin-start: 0;
}
/* TRACKING PROTECTION TOUR */
#tourTop,
#tourBottom,
#tourFooter {
text-align: center;
padding: 0 31px;
}
#tourTop,
#tourBottom {
flex: 1;
}
#tourTop {
display: flex;
flex-direction: column;
justify-content: flex-end;
background-color: rgb(108,192,65);
color: white;
font-style: italic;
}
#tourTitle {
margin: 16px 0 0;
background: url("chrome://browser/skin/mask-and-shield.svg") top no-repeat;
background-size: 179px 88px;
padding-top: 114px;
font-size: 38px;
}
#tourSubtitle {
margin: 12px 0 32px;
font-size: 24px;
}
#tourDescription,
#tourFooter {
margin: 16px auto;
max-width: 550px;
}
#startTour {
display: inline-block;
width: 255px;
border-radius: 2px;
background-color: var(--in-content-primary-button-background);
color: var(--in-content-selected-text);
padding: 2px 5px;
line-height: 36px;
text-decoration: none;
}
#startTour:hover {
background-color: var(--in-content-primary-button-background-hover);
}
#tourFooter {
margin: 16px auto;
}
#tourFooter,
#tourLearnMore {
font-size: 12px;
}
#tourFooterText {
opacity: 0.6;
}

View File

@ -4,18 +4,10 @@
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
let stringBundle = Services.strings.createBundle(
"chrome://browser/locale/aboutPrivateBrowsing.properties");
let useTour = false;
try {
useTour = Services.prefs.getBoolPref("privacy.trackingprotection.ui.enabled");
} catch (ex) {
// The preference is not available.
}
var stringBundle = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService)
.createBundle("chrome://browser/locale/aboutPrivateBrowsing.properties");
if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
document.title = stringBundle.GetStringFromName("title.normal");
@ -26,33 +18,28 @@ if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
}
function setFavIcon(url) {
let icon = document.createElement("link");
var icon = document.createElement("link");
icon.setAttribute("rel", "icon");
icon.setAttribute("type", "image/png");
icon.setAttribute("href", url);
let head = document.getElementsByTagName("head")[0];
var head = document.getElementsByTagName("head")[0];
head.insertBefore(icon, head.firstChild);
}
document.addEventListener("DOMContentLoaded", function () {
let formatURLPref = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter).formatURLPref;
let learnMoreURL = formatURLPref("app.support.baseURL") + "private-browsing";
if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
// Normal browsing window.
document.body.setAttribute("class", "normal");
} else if (!useTour) {
// Private browsing window, classic version.
document.getElementById("learnMore").setAttribute("href", learnMoreURL);
} else {
// Private browsing window, Tracking Protection tour version.
document.body.setAttribute("class", "tour");
let tourURL = formatURLPref("privacy.trackingprotection.introURL");
document.getElementById("startTour").setAttribute("href", tourURL);
document.getElementById("tourLearnMore").setAttribute("href", learnMoreURL);
}
// Set up the help link
let learnMoreURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter)
.formatURLPref("app.support.baseURL");
let learnMore = document.getElementById("learnMore");
if (learnMore) {
learnMore.setAttribute("href", learnMoreURL + "private-browsing");
}
let startPrivateBrowsing = document.getElementById("startPrivateBrowsing");
if (startPrivateBrowsing) {
startPrivateBrowsing.addEventListener("command", openPrivateWindow);

View File

@ -45,19 +45,5 @@
<p><a id="learnMore" target="_blank">&aboutPrivateBrowsing.learnMore;</a></p>
</div>
</div>
<div id="tourTop" class="showTour">
<p id="tourTitle">&aboutPrivateBrowsing.title;</p>
<p id="tourSubtitle">&trackingProtection.subtitle;</p>
</div>
<div id="tourBottom" class="showTour">
<p id="tourDescription">&trackingProtection.description;</p>
<p><a id="startTour">&trackingProtection.startTour;</a></p>
<p><a id="showPreferences" href="about:preferences#privacy"
target="_blank">&trackingProtection.showPreferences;</a></p>
</div>
<p id="tourFooter" class="showTour">
<span id="tourFooterText">&aboutPrivateBrowsing.shortdescription;</span>
<a id="tourLearnMore" target="_blank">&aboutPrivateBrowsing.learnMore;</a>
</p>
</body>
</html>

View File

@ -16,7 +16,6 @@ support-files =
title.sjs
[browser_privatebrowsing_DownloadLastDirWithCPS.js]
[browser_privatebrowsing_about.js]
[browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js]
[browser_privatebrowsing_aboutSessionRestore.js]
[browser_privatebrowsing_cache.js]

View File

@ -1,98 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Opens a new private window and loads "about:privatebrowsing" there.
*/
function* openAboutPrivateBrowsing() {
let win = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
let tab = win.gBrowser.selectedBrowser;
tab.loadURI("about:privatebrowsing");
yield BrowserTestUtils.browserLoaded(tab);
return { win, tab };
}
/**
* Clicks the given link and checks this opens the given URI in the same tab.
*/
function* testLinkOpensUrl({ win, tab, elementId, expectedUrl }) {
let loadedPromise = BrowserTestUtils.browserLoaded(tab);
yield ContentTask.spawn(tab, { elementId }, function* ({ elementId }) {
content.document.getElementById(elementId).click();
});
yield loadedPromise;
is(tab.currentURI.spec, expectedUrl,
`Clicking ${elementId} opened ${expectedUrl} in the same tab.`);
win.gBrowser.goBack();
}
/**
* Clicks the given link and checks this opens a new tab with the given URI.
*/
function* testLinkOpensTab({ win, tab, elementId, expectedUrl }) {
let newTabPromise = BrowserTestUtils.waitForNewTab(win.gBrowser, expectedUrl);
yield ContentTask.spawn(tab, { elementId }, function* ({ elementId }) {
content.document.getElementById(elementId).click();
});
let newTab = yield newTabPromise;
ok(true, `Clicking ${elementId} opened ${expectedUrl} in a new tab.`);
yield BrowserTestUtils.removeTab(newTab);
}
/**
* Tests the Learn More action in the classic "about:privatebrowsing" window.
*/
add_task(function* test_classicActions() {
// Use classic version and change the remote URL to prevent network access.
Services.prefs.setBoolPref("privacy.trackingprotection.ui.enabled", false);
Services.prefs.setCharPref("app.support.baseURL", "https://example.com/");
registerCleanupFunction(function () {
Services.prefs.clearUserPref("app.support.baseURL");
Services.prefs.clearUserPref("privacy.trackingprotection.ui.enabled");
});
let { win, tab } = yield openAboutPrivateBrowsing();
yield testLinkOpensTab({ win, tab,
elementId: "learnMore",
expectedUrl: "https://example.com/private-browsing",
});
yield BrowserTestUtils.closeWindow(win);
});
/**
* Tests the Tracking Protection tour actions in "about:privatebrowsing".
*/
add_task(function* test_tourActions() {
// Use tour version and change the remote URLs to prevent network access.
Services.prefs.setBoolPref("privacy.trackingprotection.ui.enabled", true);
Services.prefs.setCharPref("app.support.baseURL", "https://example.com/");
Services.prefs.setCharPref("privacy.trackingprotection.introURL",
"https://example.com/tour");
registerCleanupFunction(function () {
Services.prefs.clearUserPref("privacy.trackingprotection.introURL");
Services.prefs.clearUserPref("app.support.baseURL");
Services.prefs.clearUserPref("privacy.trackingprotection.ui.enabled");
});
let { win, tab } = yield openAboutPrivateBrowsing();
yield testLinkOpensUrl({ win, tab,
elementId: "startTour",
expectedUrl: "https://example.com/tour",
});
yield testLinkOpensTab({ win, tab,
elementId: "showPreferences",
expectedUrl: "about:preferences#privacy",
});
yield testLinkOpensTab({ win, tab,
elementId: "tourLearnMore",
expectedUrl: "https://example.com/private-browsing",
});
yield BrowserTestUtils.closeWindow(win);
});

View File

@ -10,8 +10,6 @@
<!ENTITY aboutPrivateBrowsing.description "That includes browsing history, search history, download history, web form history, cookies, and temporary internet files. However, files you download and bookmarks you make will be kept.">
<!ENTITY aboutPrivateBrowsing.shortdescription "&brandShortName; won't remember any history for this window, but will keep any files you download and bookmarks you make. (Please note that your employer or internet service provider can still track the pages you visit.)">
<!ENTITY aboutPrivateBrowsing.notPrivate "You are currently not in a private window.">
<!ENTITY aboutPrivateBrowsing.moreInfo "While this computer won't have a record of your browsing history, your employer or internet service provider can still track the pages you visit.">
@ -19,11 +17,3 @@
<!ENTITY privatebrowsingpage.openPrivateWindow.label "Open a Private Window">
<!ENTITY privatebrowsingpage.openPrivateWindow.accesskey "P">
<!ENTITY trackingProtection.subtitle "Now with Tracking Protection">
<!ENTITY trackingProtection.description "Tracking Protection will block content that tracks your browsing activity so you don't have to worry about it being shared across websites.">
<!ENTITY trackingProtection.showPreferences "Privacy Preferences">
<!ENTITY trackingProtection.startTour "See what's new">

View File

@ -58,7 +58,6 @@ browser.jar:
skin/classic/browser/magnifier@2x.png (../shared/magnifier@2x.png)
skin/classic/browser/mask.png (../shared/mask.png)
skin/classic/browser/mask@2x.png (../shared/mask@2x.png)
skin/classic/browser/mask-and-shield.svg (../shared/mask-and-shield.svg)
skin/classic/browser/menuPanel.png
skin/classic/browser/menuPanel@2x.png
skin/classic/browser/menuPanel-customize.png

View File

@ -72,7 +72,6 @@ browser.jar:
skin/classic/browser/magnifier@2x.png (../shared/magnifier@2x.png)
skin/classic/browser/mask.png (../shared/mask.png)
skin/classic/browser/mask@2x.png (../shared/mask@2x.png)
skin/classic/browser/mask-and-shield.svg (../shared/mask-and-shield.svg)
skin/classic/browser/menuPanel.png
skin/classic/browser/menuPanel@2x.png
skin/classic/browser/menuPanel-customize.png

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="179" height="88" viewBox="0 0 179 88">
<path fill="#fff" d="M8.946,35.096 C8.606,31.547 8.420,23.513 8.426,12.880 L36.504,8.301 L36.504,74.685 C33.361,74.046 24.945,71.679 19.034,64.025 C13.254,56.539 10.426,50.586 8.946,35.096 ZM70.859,17.395 C69.626,17.801 68.460,18.195 67.354,18.580 C67.370,16.177 67.375,13.601 67.367,10.865 C67.366,10.686 67.212,10.536 66.991,10.500 L36.505,5.532 L6.018,10.500 C5.798,10.536 5.643,10.687 5.642,10.866 C5.609,22.579 5.802,31.508 6.170,35.361 C7.705,51.406 10.825,57.918 16.814,65.669 C23.751,74.645 33.895,76.990 36.508,77.458 C38.819,77.044 47.234,75.103 53.958,68.218 C54.688,69.280 55.457,70.380 56.317,71.575 C56.631,71.983 56.954,72.374 57.276,72.765 C47.955,81.768 36.504,83.000 36.504,83.000 C36.504,83.000 21.987,81.447 12.339,68.990 C5.237,59.821 2.096,51.895 0.563,35.900 C0.036,30.405 -0.010,17.912 0.010,10.913 C0.019,8.021 2.164,5.580 5.089,5.105 L36.504,-0.003 L67.919,5.105 C70.844,5.580 72.990,8.021 72.998,10.913 C73.003,12.580 73.003,14.563 72.995,16.684 C72.347,16.902 71.640,17.137 70.859,17.395 Z" />
<path fill="#fff" d="M176.593,36.244 C176.057,45.236 178.201,55.977 166.140,71.463 C153.271,87.987 140.491,86.725 138.079,86.974 C123.601,88.466 121.694,75.948 113.238,75.948 C105.835,75.948 99.803,88.386 88.929,86.974 C86.526,86.661 73.738,87.987 60.868,71.463 C48.808,55.977 50.952,45.236 50.416,36.244 C49.880,27.251 48.004,17.510 48.004,17.510 C48.004,17.510 53.816,23.255 61.321,23.755 C68.826,24.254 70.228,21.187 86.063,16.761 C103.186,11.975 113.505,31.587 113.505,31.587 C113.505,31.587 125.132,12.265 140.946,16.761 C156.759,21.257 157.416,24.254 164.920,23.755 C172.425,23.255 179.005,17.510 179.005,17.510 C179.005,17.510 177.129,27.251 176.593,36.244 ZM88.064,40.011 C78.705,37.996 74.778,41.439 70.768,42.908 C67.269,44.189 64.085,44.587 64.085,44.587 C64.085,44.587 64.621,49.832 74.002,54.328 C83.383,58.824 102.627,56.504 102.627,56.504 C102.627,56.504 104.670,43.587 88.064,40.011 ZM156.241,42.908 C152.231,41.439 148.304,37.996 138.944,40.011 C122.338,43.587 124.382,56.504 124.382,56.504 C124.382,56.504 143.626,58.824 153.006,54.328 C162.388,49.832 162.923,44.587 162.923,44.587 C162.923,44.587 159.740,44.189 156.241,42.908 Z" />
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -63,7 +63,6 @@ browser.jar:
skin/classic/browser/magnifier@2x.png (../shared/magnifier@2x.png)
skin/classic/browser/mask.png (../shared/mask.png)
skin/classic/browser/mask@2x.png (../shared/mask@2x.png)
skin/classic/browser/mask-and-shield.svg (../shared/mask-and-shield.svg)
skin/classic/browser/menu-back.png
skin/classic/browser/menu-back-XP.png
skin/classic/browser/menu-forward.png