Skip to content

Commit

Permalink
Merge autoland to central, a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 4bGs7E65Lmn
  • Loading branch information
KWierso committed Sep 11, 2017
2 parents 51eae08 + 22c06f3 commit 0616bb7
Show file tree
Hide file tree
Showing 116 changed files with 3,202 additions and 937 deletions.
9 changes: 9 additions & 0 deletions browser/components/preferences/in-content/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ var gPrivacyPane = {
appendSearchKeywords("showPasswords", [
signonBundle.getString("loginsDescriptionAll2"),
]);
appendSearchKeywords("cookieExceptions", [
bundlePrefs.getString("cookiepermissionstext"),
]);
appendSearchKeywords("showCookiesButton", [
bundlePrefs.getString("cookiesAll"),
bundlePrefs.getString("removeAllCookies.label"),
bundlePrefs.getString("removeAllShownCookies.label"),
bundlePrefs.getString("removeSelectedCookies.label"),
]);
appendSearchKeywords("trackingProtectionExceptions", [
bundlePrefs.getString("trackingprotectionpermissionstitle"),
bundlePrefs.getString("trackingprotectionpermissionstext2"),
Expand Down
73 changes: 52 additions & 21 deletions browser/components/preferences/in-content/privacy.xul
Original file line number Diff line number Diff line change
Expand Up @@ -315,25 +315,39 @@
onsyncfrompreference="return gPrivacyPane.readAcceptCookies();"
onsynctopreference="return gPrivacyPane.writeAcceptCookies();"
flex="1" />
<button id="cookieExceptions"
class="accessory-button"
label="&cookieExceptions.label;" accesskey="&cookieExceptions.accesskey;"
preference="pref.privacy.disable_button.cookie_exceptions"/>
<!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
<hbox>
<button id="cookieExceptions"
class="accessory-button"
label="&cookieExceptions.label;" accesskey="&cookieExceptions.accesskey;"
preference="pref.privacy.disable_button.cookie_exceptions"
searchkeywords="&address2.label;
&block.label;
&session.label;
&allow.label;
&removepermission2.label;
&removeallpermissions2.label;
&button.cancel.label;
&button.ok.label;"/>
</hbox>
</hbox>
<hbox id="acceptThirdPartyRow"
class="indent"
align="center">
<label id="acceptThirdPartyLabel" control="acceptThirdPartyMenu"
accesskey="&acceptThirdParty2.pre.accesskey;">&acceptThirdParty2.pre.label;</label>
<menulist id="acceptThirdPartyMenu" preference="network.cookie.cookieBehavior"
onsyncfrompreference="return gPrivacyPane.readAcceptThirdPartyCookies();"
onsynctopreference="return gPrivacyPane.writeAcceptThirdPartyCookies();">
<menupopup>
<menuitem label="&acceptThirdParty.always.label;" value="always"/>
<menuitem label="&acceptThirdParty.visited.label;" value="visited"/>
<menuitem label="&acceptThirdParty.never.label;" value="never"/>
</menupopup>
</menulist>
<!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
<hbox>
<menulist id="acceptThirdPartyMenu" preference="network.cookie.cookieBehavior"
onsyncfrompreference="return gPrivacyPane.readAcceptThirdPartyCookies();"
onsynctopreference="return gPrivacyPane.writeAcceptThirdPartyCookies();">
<menupopup>
<menuitem label="&acceptThirdParty.always.label;" value="always"/>
<menuitem label="&acceptThirdParty.visited.label;" value="visited"/>
<menuitem label="&acceptThirdParty.never.label;" value="never"/>
</menupopup>
</menulist>
</hbox>
</hbox>
<hbox id="keepRow"
class="indent"
Expand All @@ -352,10 +366,14 @@
</menulist>
</hbox>
<spacer flex="1"/>
<button id="showCookiesButton"
class="accessory-button"
label="&showCookies.label;" accesskey="&showCookies.accesskey;"
preference="pref.privacy.disable_button.view_cookies"/>
<!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
<hbox>
<button id="showCookiesButton"
class="accessory-button"
label="&showCookies.label;"
accesskey="&showCookies.accesskey;"
preference="pref.privacy.disable_button.view_cookies"/>
</hbox>
</hbox>
<hbox id="clearDataBox"
align="center">
Expand All @@ -364,10 +382,23 @@
label="&clearOnClose.label;"
accesskey="&clearOnClose.accesskey;"
flex="1" />
<button id="clearDataSettings"
class="accessory-button"
label="&clearOnCloseSettings.label;"
accesskey="&clearOnCloseSettings.accesskey;"/>
<!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
<hbox>
<button id="clearDataSettings"
class="accessory-button"
label="&clearOnCloseSettings.label;"
accesskey="&clearOnCloseSettings.accesskey;"
searchkeywords="&clearDataSettings2.label;
&historySection.label;
&itemHistoryAndDownloads.label;
&itemCookies.label;
&itemActiveLogins.label;
&itemCache.label;
&itemFormSearchHistory.label;
&dataSection.label;
&itemSitePreferences.label;
&itemOfflineApps.label;"/>
</hbox>
</hbox>
</vbox>
</vbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ add_task(async function test() {
info("Wait for a title change notification.");
await promiseTitleChanged;
await BrowserTestUtils.waitForCondition(async function() {
return (await PlacesUtils.history.fetch(TEST_URL)).title == TITLE_1;
}, "The title matches the orignal title after first visit");
let entry = await PlacesUtils.history.fetch(TEST_URL);
return entry && entry.title == TITLE_1;
}, "The title matches the original title after first visit");

promiseTitleChanged = PlacesTestUtils.waitForNotification(
"onTitleChanged", (uri, title) => uri.spec == TEST_URL, "history");
await PlacesTestUtils.addVisits({ uri: TEST_URL, title: TITLE_2 });
info("Wait for a title change notification.");
await promiseTitleChanged;
await BrowserTestUtils.waitForCondition(async function() {
return (await PlacesUtils.history.fetch(TEST_URL)).title == TITLE_2;
}, "The title matches the orignal title after updating visit");
let entry = await PlacesUtils.history.fetch(TEST_URL);
return entry && entry.title == TITLE_2;
}, "The title matches the original title after updating visit");

let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
registerCleanupFunction(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ add_task(async function test() {
await BrowserTestUtils.openNewForegroundTab(win.gBrowser, TEST_URL);
await promiseTitleChanged;
await BrowserTestUtils.waitForCondition(async function() {
return (await PlacesUtils.history.fetch(TEST_URL)).title == "No Cookie";
let entry = await PlacesUtils.history.fetch(TEST_URL);
return entry && entry.title == "No Cookie";
}, "The page should be loaded without any cookie for the first time");

promiseTitleChanged = PlacesTestUtils.waitForNotification(
"onTitleChanged", (uri, title) => uri.spec == TEST_URL, "history");
await BrowserTestUtils.openNewForegroundTab(win.gBrowser, TEST_URL);
await promiseTitleChanged;
await BrowserTestUtils.waitForCondition(async function() {
return (await PlacesUtils.history.fetch(TEST_URL)).title == "Cookie";
let entry = await PlacesUtils.history.fetch(TEST_URL);
return entry && entry.title == "Cookie";
}, "The page should be loaded with a cookie for the second time");

await cleanup();
Expand All @@ -49,7 +51,8 @@ add_task(async function test() {
await BrowserTestUtils.openNewForegroundTab(win.gBrowser, TEST_URL);
await promiseTitleChanged;
await BrowserTestUtils.waitForCondition(async function() {
return (await PlacesUtils.history.fetch(TEST_URL)).title == "No Cookie";
let entry = await PlacesUtils.history.fetch(TEST_URL);
return entry && entry.title == "No Cookie";
}, "The page should be loaded without any cookie again");

// Reopen the page in a private browser window, it should not notify a title
Expand Down
38 changes: 26 additions & 12 deletions browser/extensions/onboarding/content/onboarding-tour-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
* 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/. */

/* globals Mozilla */
/* globals Mozilla */

(function() {
"use strict";

document.addEventListener("Agent:CanSetDefaultBrowserInBackground", () => {
let onCanSetDefaultBrowserInBackground = () => {
Mozilla.UITour.getConfiguration("appinfo", config => {
let canSetInBackGround = config.canSetDefaultBrowserInBackground;
let btn = document.getElementById("onboarding-tour-default-browser-button");
btn.setAttribute("data-cansetbg", canSetInBackGround);
btn.textContent = canSetInBackGround ? btn.getAttribute("data-bg") : btn.getAttribute("data-panel");
});
});
};

document.getElementById("onboarding-overlay")
.addEventListener("click", evt => {
let onClick = evt => {
switch (evt.target.id) {
case "onboarding-tour-addons-button":
Mozilla.UITour.showHighlight("addons");
Expand Down Expand Up @@ -63,13 +63,27 @@ document.getElementById("onboarding-overlay")
Mozilla.UITour.hideHighlight();
break;
}
// Dismiss any highlights if a user tries to change to other tours.
if (evt.target.classList.contains("onboarding-tour-item")) {
Mozilla.UITour.hideHighlight();
let classList = evt.target.classList;
// On keyboard navigation the target would be .onboarding-tour-item.
// On mouse clicking the target would be .onboarding-tour-item-container.
if (classList.contains("onboarding-tour-item") || classList.contains("onboarding-tour-item-container")) {
Mozilla.UITour.hideHighlight(); // Clean up UITour if a user tries to change to other tours.
}
});
};

document.getElementById("onboarding-overlay-button").addEventListener("Agent:Destroy", () => {
Mozilla.UITour.hideHighlight();
Mozilla.UITour.hideMenu("urlbar");
let overlay = document.getElementById("onboarding-overlay");
overlay.addEventListener("click", onClick);
overlay.addEventListener("keypress", e => {
let { target, key } = e;
let classList = target.classList;
if ((key == " " || key == "Enter") &&
// On keyboard navigation the target would be .onboarding-tour-item.
// On mouse clicking the target would be .onboarding-tour-item-container.
(classList.contains("onboarding-tour-item") || classList.contains("onboarding-tour-item-container"))) {
Mozilla.UITour.hideHighlight(); // Clean up UITour if a user tries to change to other tours.
}
});
document.getElementById("onboarding-overlay-button").addEventListener("Agent:Destroy", () => Mozilla.UITour.hideHighlight());
document.addEventListener("Agent:CanSetDefaultBrowserInBackground", onCanSetDefaultBrowserInBackground);

})();
18 changes: 9 additions & 9 deletions browser/extensions/onboarding/content/onboarding.css
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
}

#onboarding-tour-singlesearch.onboarding-active,
#onboarding-tour-singlesearch:hover {
.onboarding-tour-item-container:hover #onboarding-tour-singlesearch {
background-image: url("img/icons_singlesearch-colored.svg");
}

Expand All @@ -395,7 +395,7 @@
}

#onboarding-tour-private-browsing.onboarding-active,
#onboarding-tour-private-browsing:hover {
.onboarding-tour-item-container:hover #onboarding-tour-private-browsing {
background-image: url("img/icons_private-colored.svg");
}

Expand All @@ -405,7 +405,7 @@
}

#onboarding-tour-addons.onboarding-active,
#onboarding-tour-addons:hover {
.onboarding-tour-item-container:hover #onboarding-tour-addons {
background-image: url("img/icons_addons-colored.svg");
}

Expand All @@ -415,7 +415,7 @@
}

#onboarding-tour-customize.onboarding-active,
#onboarding-tour-customize:hover {
.onboarding-tour-item-container:hover #onboarding-tour-customize {
background-image: url("img/icons_customize-colored.svg");
}

Expand All @@ -425,7 +425,7 @@
}

#onboarding-tour-default-browser.onboarding-active,
#onboarding-tour-default-browser:hover {
.onboarding-tour-item-container:hover #onboarding-tour-default-browser {
background-image: url("img/icons_default-colored.svg");
}

Expand All @@ -435,7 +435,7 @@
}

#onboarding-tour-sync.onboarding-active,
#onboarding-tour-sync:hover {
.onboarding-tour-item-container:hover #onboarding-tour-sync {
background-image: url("img/icons_sync-colored.svg");
}

Expand All @@ -445,7 +445,7 @@
}

#onboarding-tour-library.onboarding-active,
#onboarding-tour-library:hover {
.onboarding-tour-item-container:hover #onboarding-tour-library {
background-image: url("img/icons_library-colored.svg");
}

Expand All @@ -455,7 +455,7 @@
}

#onboarding-tour-performance.onboarding-active,
#onboarding-tour-performance:hover {
.onboarding-tour-item-container:hover #onboarding-tour-performance {
background-image: url("img/icons_performance-colored.svg");
}

Expand All @@ -465,7 +465,7 @@
}

#onboarding-tour-screenshots.onboarding-active,
#onboarding-tour-screenshots:hover {
.onboarding-tour-item-container:hover #onboarding-tour-screenshots {
background-image: url("img/icons_screenshots-colored.svg");
}

Expand Down
1 change: 1 addition & 0 deletions browser/extensions/onboarding/test/browser/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ skip-if = debug || os == "mac" # Full keyboard navigation on OSX only works if F
[browser_onboarding_skip_tour.js]
[browser_onboarding_tours.js]
[browser_onboarding_tourset.js]
[browser_onboarding_uitour.js]

0 comments on commit 0616bb7

Please sign in to comment.