Bug 1597698 - Move all megabar prefs under a urlbar.update1 branch. r=mak,dao

Differential Revision: https://phabricator.services.mozilla.com/D54146

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Harry Twyford 2019-11-26 17:15:31 +00:00
Родитель f52518a420
Коммит 9b61c484ab
11 изменённых файлов: 46 добавлений и 39 удалений

Просмотреть файл

@ -324,13 +324,15 @@ pref("browser.urlbar.openintab", false);
pref("browser.urlbar.usepreloadedtopurls.enabled", false);
pref("browser.urlbar.usepreloadedtopurls.expire_days", 14);
// Whether the quantum bar displays the major design update.
pref("browser.urlbar.megabar", false);
// Whether we expand the font size when the megabar is focused.
pref("browser.urlbar.megabar.expandTextOnFocus", false);
// Whether the megabar displays the permanent search icon.
pref("browser.urlbar.searchIcon", false);
pref("browser.urlbar.view.stripHttps", false);
// Whether the quantum bar displays design update 1.
pref("browser.urlbar.update1", false);
// Whether we expand the font size when when the urlbar is
// focused in design update 1.
pref("browser.urlbar.update1.expandTextOnFocus", false);
// Whether the urlbar displays a permanent search button in design update 1.
pref("browser.urlbar.update1.searchButton", false);
// Whether the urlbar should strip https from urls in the view.
pref("browser.urlbar.update1.view.stripHttps", false);
pref("browser.urlbar.openViewOnFocus", false);
pref("browser.urlbar.eventTelemetry.enabled", false);

Просмотреть файл

@ -290,7 +290,7 @@ add_task(async function test_onProviderResultsRequested() {
title: "Test remote_tab-tabs result",
url: "http://example.com/remote_tab-tabs",
displayUrl:
(UrlbarPrefs.get("view.stripHttps") ? "http://" : "") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") +
"example.com/remote_tab-tabs",
},
},
@ -303,7 +303,7 @@ add_task(async function test_onProviderResultsRequested() {
title: "Test tab-tabs result",
url: "http://example.com/tab-tabs",
displayUrl:
(UrlbarPrefs.get("view.stripHttps") ? "http://" : "") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") +
"example.com/tab-tabs",
},
},
@ -328,7 +328,7 @@ add_task(async function test_onProviderResultsRequested() {
title: "Test url-history result",
url: "http://example.com/url-history",
displayUrl:
(UrlbarPrefs.get("view.stripHttps") ? "http://" : "") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "http://" : "") +
"example.com/url-history",
},
},

Просмотреть файл

@ -82,11 +82,12 @@ class UrlbarInput {
);
this.panel = this.textbox.querySelector(".urlbarView");
this.megabar = UrlbarPrefs.get("megabar");
// "Megabar" is the internal codename for the update1 design refresh.
this.megabar = UrlbarPrefs.get("update1");
if (this.megabar) {
this.textbox.classList.add("megabar");
this.textbox.parentNode.classList.add("megabar");
this.searchIcon = UrlbarPrefs.get("searchIcon");
this.searchIcon = UrlbarPrefs.get("update1.searchButton");
if (this.searchIcon) {
this.textbox.classList.add("searchIcon");
}

Просмотреть файл

@ -103,12 +103,6 @@ const PREF_URLBAR_DEFAULTS = new Map([
// The maximum number of results in the urlbar popup.
["maxRichResults", 10],
// Whether the quantum bar displays the major design update.
["megabar", false],
// Whether the megabar displays the permanent search icon.
["searchIcon", false],
// One-off search buttons enabled status.
["oneOffSearches", false],
@ -119,6 +113,11 @@ const PREF_URLBAR_DEFAULTS = new Map([
// Whether to open the urlbar view when the input field is focused by the user.
["openViewOnFocus", false],
// When true, URLs in the user's history that look like search result pages
// are styled to look like search engine results instead of the usual history
// results.
["restyleSearches", false],
// Whether speculative connections should be enabled.
["speculativeConnect.enabled", true],
@ -148,13 +147,14 @@ const PREF_URLBAR_DEFAULTS = new Map([
// popular domains will no longer be included in the results.
["usepreloadedtopurls.expire_days", 14],
// When true, URLs in the user's history that look like search result pages
// are styled to look like search engine results instead of the usual history
// results.
["restyleSearches", false],
// Whether the quantum bar displays design update 1.
["update1", false],
// Whether the urlbar displays a permanent search button in design update 1.
["update1.searchButton", false],
// If true, we strip https:// instead of http:// from URLs in the results view.
["view.stripHttps", false],
["update1.view.stripHttps", false],
]);
const PREF_OTHER_DEFAULTS = new Map([
["keyword.enabled", true],

Просмотреть файл

@ -201,7 +201,7 @@ class UrlbarResult {
payloadInfo.displayUrl = [...payloadInfo.url];
let url = payloadInfo.displayUrl[0];
if (url && UrlbarPrefs.get("trimURLs")) {
if (UrlbarPrefs.get("view.stripHttps")) {
if (UrlbarPrefs.get("update1.view.stripHttps")) {
url = BrowserUtils.removeSingleTrailingSlashFromURL(url);
if (url.startsWith("https://")) {
url = url.substring(8);

Просмотреть файл

@ -53,7 +53,7 @@ async function checkDoesNotOpenOnFocus(win = window) {
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.megabar", true]],
set: [["browser.urlbar.update1", true]],
});
// Add some history for the empty panel.
await PlacesTestUtils.addVisits([

Просмотреть файл

@ -88,7 +88,7 @@ add_task(async function test_resultsDisplayDecoded() {
let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1);
Assert.equal(
result.displayed.url,
UrlbarPrefs.get("view.stripHttps")
UrlbarPrefs.get("update1.view.stripHttps")
? "http://example.com/\u9875"
: "example.com/\u9875",
"Should be displayed the correctly unescaped URL"

Просмотреть файл

@ -91,7 +91,7 @@ add_task(async function test_url_result() {
},
{
displayedUrl:
(UrlbarPrefs.get("view.stripHttps") ? "" : "https://") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") +
"example.com/\u6e2C\u8a66test",
highlightedTitle: [
["The ", false],
@ -100,7 +100,7 @@ add_task(async function test_url_result() {
],
highlightedUrl: [
[
(UrlbarPrefs.get("view.stripHttps") ? "" : "https://") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") +
"example.com/",
false,
],
@ -120,10 +120,14 @@ add_task(async function test_url_result_no_path() {
},
{
displayedUrl:
(UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + "example.com",
(UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") +
"example.com",
highlightedTitle: [["The Title", false]],
highlightedUrl: [
[(UrlbarPrefs.get("view.stripHttps") ? "" : "https://") + "ex", false],
[
(UrlbarPrefs.get("update1.view.stripHttps") ? "" : "https://") + "ex",
false,
],
["ample", true],
[".com", false],
],
@ -164,7 +168,7 @@ add_task(async function test_case_insensitive_highlights_1() {
query: "exam",
title: "The examPLE URL EXAMple",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm",
},
{
@ -187,7 +191,7 @@ add_task(async function test_case_insensitive_highlights_2() {
query: "EXAM",
title: "The examPLE URL EXAMple",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm",
},
{
@ -210,7 +214,7 @@ add_task(async function test_case_insensitive_highlights_3() {
query: "eXaM",
title: "The examPLE URL EXAMple",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm",
},
{
@ -233,7 +237,7 @@ add_task(async function test_case_insensitive_highlights_4() {
query: "ExAm",
title: "The examPLE URL EXAMple",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm",
},
{
@ -256,7 +260,7 @@ add_task(async function test_case_insensitive_highlights_5() {
query: "exam foo",
title: "The examPLE URL foo EXAMple FOO",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm/fOo",
},
{
@ -288,7 +292,7 @@ add_task(async function test_case_insensitive_highlights_6() {
query: "EXAM FOO",
title: "The examPLE URL foo EXAMple FOO",
url:
(UrlbarPrefs.get("view.stripHttps") ? "https" : "http") +
(UrlbarPrefs.get("update1.view.stripHttps") ? "https" : "http") +
"://example.com/ExAm/fOo",
},
{

Просмотреть файл

@ -281,7 +281,7 @@ notification[value="translation"] menulist > .menulist-dropmarker {
font-size: 1.05em;
}
@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") {
@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") {
.urlbarView {
font-size: inherit;
}

Просмотреть файл

@ -300,7 +300,7 @@
font-size: 14px;
}
@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") {
@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") {
.urlbarView {
font-size: inherit;
}

Просмотреть файл

@ -554,7 +554,7 @@ menuitem.bookmark-item {
}
}
@supports -moz-bool-pref("browser.urlbar.megabar.expandTextOnFocus") {
@supports -moz-bool-pref("browser.urlbar.update1.expandTextOnFocus") {
#urlbar[breakout-extend] {
font-size: 1.25em;
}