Skip to content

Commit

Permalink
Bug 1852046 - Convert all toggles to checkboxes on privacy prefs page…
Browse files Browse the repository at this point in the history
… r=dao,fluent-reviewers,desktop-theme-reviewers,hjones,bolsson

Differential Revision: https://phabricator.services.mozilla.com/D191641
  • Loading branch information
klubana-m committed Oct 25, 2023
1 parent 5c2ed09 commit 8f46ef2
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,38 @@ add_task(async function test_firefox_suggest_with_policy() {
"about:preferences#privacy",
async browser => {
is(
browser.contentDocument.getElementById(
"firefoxSuggestNonsponsoredToggle"
).pressed,
browser.contentDocument.getElementById("firefoxSuggestNonsponsored")
.checked,
false,
"Web suggestions is disabled"
);
is(
browser.contentDocument.getElementById("firefoxSuggestSponsoredToggle")
.pressed,
browser.contentDocument.getElementById("firefoxSuggestSponsored")
.checked,
true,
"Sponsored suggestions is enabled"
);
is(
browser.contentDocument.getElementById(
"firefoxSuggestDataCollectionToggle"
).pressed,
browser.contentDocument.getElementById("firefoxSuggestDataCollection")
.checked,
true,
"Improve suggest is enabled"
);
is(
browser.contentDocument.getElementById(
"firefoxSuggestNonsponsoredToggle"
).disabled,
browser.contentDocument.getElementById("firefoxSuggestNonsponsored")
.disabled,
true,
"Web suggestions is disabled"
);
is(
browser.contentDocument.getElementById("firefoxSuggestSponsoredToggle")
browser.contentDocument.getElementById("firefoxSuggestSponsored")
.disabled,
true,
"Sponsored suggestions is enabled"
);
is(
browser.contentDocument.getElementById(
"firefoxSuggestDataCollectionToggle"
).disabled,
browser.contentDocument.getElementById("firefoxSuggestDataCollection")
.disabled,
true,
"Improve suggest is enabled"
);
Expand Down
1 change: 0 additions & 1 deletion browser/components/preferences/preferences.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<script src="chrome://browser/content/preferences/findInPage.js"/>
<script type="module" src="chrome://global/content/elements/moz-support-link.mjs"/>
<script src="chrome://browser/content/migration/migration-wizard.mjs" type="module"></script>
<script type="module" src="chrome://global/content/elements/moz-toggle.mjs"/>
</head>

<html:body xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
Expand Down
55 changes: 29 additions & 26 deletions browser/components/preferences/privacy.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -729,32 +729,35 @@
/>
</hbox>
<vbox id="firefoxSuggestContainer" hidden="true">
<vbox class="firefoxSuggestOptionBox">
<html:moz-toggle id="firefoxSuggestNonsponsoredToggle"
preference="browser.urlbar.suggest.quicksuggest.nonsponsored"
data-l10n-id="addressbar-firefox-suggest-nonsponsored"
data-l10n-attrs="label, description" />
</vbox>
<vbox class="firefoxSuggestOptionBox">
<html:moz-toggle id="firefoxSuggestSponsoredToggle"
preference="browser.urlbar.suggest.quicksuggest.sponsored"
data-l10n-id="addressbar-firefox-suggest-sponsored"
data-l10n-attrs="label, description" />
</vbox>
<vbox class="firefoxSuggestOptionBox">
<html:moz-toggle id="firefoxSuggestDataCollectionToggle"
preference="browser.urlbar.quicksuggest.dataCollection.enabled"
data-l10n-id="addressbar-firefox-suggest-data-collection"
data-l10n-attrs="label, description">
<html:a slot="support-link"
is="moz-support-link"
id="firefoxSuggestDataCollectionLearnMore"
class="learnMore firefoxSuggestLearnMore"
data-l10n-id="addressbar-locbar-firefox-suggest-learn-more"
support-page="firefox-suggest"
/>
</html:moz-toggle>
</vbox>
<checkbox id="firefoxSuggestNonsponsored"
data-l10n-id="addressbar-firefox-suggest-nonsponsored"
preference="browser.urlbar.suggest.quicksuggest.nonsponsored"
/>
<description class="indent tip-caption"
data-l10n-id="addressbar-firefox-suggest-nonsponsored-desc"
/>
<checkbox id="firefoxSuggestSponsored"
data-l10n-id="addressbar-firefox-suggest-sponsored"
preference="browser.urlbar.suggest.quicksuggest.sponsored"
/>
<description class="indent tip-caption"
data-l10n-id="addressbar-firefox-suggest-sponsored-desc"
/>
<checkbox id="firefoxSuggestDataCollection"
data-l10n-id="addressbar-firefox-suggest-data-collection"
preference="browser.urlbar.quicksuggest.dataCollection.enabled"
/>
<description class="indent tip-caption">
<html:span class="tail-with-learn-more"
data-l10n-id="addressbar-firefox-suggest-data-collection-desc"
/>
<html:a is="moz-support-link"
id="firefoxSuggestDataCollectionLearnMore"
class="learnMore firefoxSuggestLearnMore"
data-l10n-id="addressbar-locbar-firefox-suggest-learn-more"
support-page="firefox-suggest"
/>
</description>
<hbox id="firefoxSuggestInfoBox" class="info-box-container smaller-font-size" align="start"
hidden="true">
<html:img class="info-icon"/>
Expand Down
Loading

0 comments on commit 8f46ef2

Please sign in to comment.