MozReview-Commit-ID: EfMOcZbAiSe
This commit is contained in:
Wes Kocher 2017-01-27 16:39:29 -08:00
Родитель e07bdc0fa2 7cd28f7e5d
Коммит 18e735dcef
276 изменённых файлов: 2300 добавлений и 10639 удалений

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

@ -96,37 +96,11 @@ ifndef TEST_MOZBUILD
.PHONY: backend
backend: $(BUILD_BACKEND_FILES)
# A traditional rule would look like this:
# backend.%:
# @echo do stuff
#
# But with -j<n>, and multiple items in BUILD_BACKEND_FILES, the command would
# run multiple times in parallel.
#
# "Fortunately", make has some weird semantics for pattern rules: if there are
# multiple targets in a pattern rule and each of them is matched at most once,
# the command will only run once. So:
# backend%RecursiveMakeBackend backend%FasterMakeBackend:
# @echo do stuff
# backend: backend.RecursiveMakeBackend backend.FasterMakeBackend
# would only execute the command once.
#
# Credit where due: http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file/3077254#3077254
$(subst .,%,$(BUILD_BACKEND_FILES)):
@echo 'Build configuration changed. Regenerating backend.'
$(PYTHON) config.status
include $(topsrcdir)/build/rebuild-backend.mk
Makefile: $(BUILD_BACKEND_FILES)
@$(TOUCH) $@
define build_backend_rule
$(1)_files := $$(shell cat $(1).in)
$(1): $$($(1)_files)
$$($(1)_files):
endef
$(foreach file,$(BUILD_BACKEND_FILES),$(eval $(call build_backend_rule,$(file))))
default:: $(BUILD_BACKEND_FILES)
endif

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

@ -1259,6 +1259,8 @@ pref("plain_text.wrap_long_lines", true);
// before content.
pref("dom.debug.propagate_gesture_events_through_content", false);
// All the Geolocation preferences are here.
//
// The request URL of the GeoLocation backend.
#ifdef RELEASE_OR_BETA
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%");
@ -1288,6 +1290,11 @@ pref("geo.provider.use_gpsd", true);
#endif
#endif
// We keep allowing non-HTTPS geo requests on all the release
// channels, for now.
// TODO: default to false (or remove altogether) for #1072859.
pref("geo.security.allowinsecure", true);
// Necko IPC security checks only needed for app isolation for cookies/cache/etc:
// currently irrelevant for desktop e10s
pref("network.disable.ipc.security", true);

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

@ -16,7 +16,6 @@ Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
Cu.import("resource://services-sync/util.js");
const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog";
const ACTION_URL_PARAM = "action";
@ -197,9 +196,8 @@ var wrapper = {
onLogin(accountData) {
log("Received: 'login'. Data:" + JSON.stringify(accountData));
if (accountData.customizeSync) {
Services.prefs.setBoolPref(PREF_SYNC_SHOW_CUSTOMIZATION, true);
}
// We don't act on customizeSync anymore, it used to open a dialog inside
// the browser to selecte the engines to sync but we do it on the web now.
delete accountData.customizeSync;
// sessionTokenContext is erroneously sent by the content server.
// https://github.com/mozilla/fxa-content-server/issues/2766
@ -306,18 +304,6 @@ var wrapper = {
// Button onclick handlers
function handleOldSync() {
let chromeWin = window
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow);
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync";
chromeWin.switchToTabHavingURI(url, true);
}
function getStarted() {
show("remote");
@ -505,10 +491,7 @@ document.addEventListener("DOMContentLoaded", function() {
var buttonRetry = document.getElementById("buttonRetry");
buttonRetry.addEventListener("click", retry);
var oldsync = document.getElementById("oldsync");
oldsync.addEventListener("click", handleOldSync);
var buttonOpenPrefs = document.getElementById("buttonOpenPrefs")
var buttonOpenPrefs = document.getElementById("buttonOpenPrefs");
buttonOpenPrefs.addEventListener("click", openPrefs);
}, {capture: true, once: true});

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

@ -63,10 +63,6 @@
<div class="button-row">
<button id="buttonGetStarted" class="button" tabindex="1">&aboutAccountsConfig.startButton.label;</button>
</div>
<div class="links">
<button id="oldsync" tabindex="2">&aboutAccountsConfig.useOldSync.label;</button>
</div>
</section>
</div>

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

@ -4,8 +4,6 @@
var gFxAccounts = {
SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration",
_initialized: false,
_inCustomizationMode: false,
@ -25,7 +23,6 @@ var gFxAccounts = {
"weave:service:setup-complete",
"weave:service:sync:error",
"weave:ui:login:error",
"fxa-migration:state-changed",
this.FxAccountsCommon.ONLOGIN_NOTIFICATION,
this.FxAccountsCommon.ONLOGOUT_NOTIFICATION,
this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION,
@ -143,9 +140,6 @@ var gFxAccounts = {
observe(subject, topic, data) {
switch (topic) {
case "fxa-migration:state-changed":
this.onMigrationStateChanged(data, subject);
break;
case this.FxAccountsCommon.ONPROFILE_IMAGE_CHANGE_NOTIFICATION:
this.updateUI();
break;
@ -155,78 +149,18 @@ var gFxAccounts = {
}
},
onMigrationStateChanged() {
// Since we nuked most of the migration code, this notification will fire
// once after legacy Sync has been disconnected (and should never fire
// again)
let nb = window.document.getElementById("global-notificationbox");
let msg = this.strings.GetStringFromName("autoDisconnectDescription")
let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label");
let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey");
let learnMoreLink = this.fxaMigrator.learnMoreLink;
let buttons = [
{
label: signInLabel,
accessKey: signInAccessKey,
callback: () => {
this.openPreferences();
}
}
];
let fragment = document.createDocumentFragment();
let msgNode = document.createTextNode(msg);
fragment.appendChild(msgNode);
if (learnMoreLink) {
let link = document.createElement("label");
link.className = "text-link";
link.setAttribute("value", learnMoreLink.text);
link.href = learnMoreLink.href;
fragment.appendChild(link);
}
nb.appendNotification(fragment,
this.SYNC_MIGRATION_NOTIFICATION_TITLE,
undefined,
nb.PRIORITY_WARNING_LOW,
buttons);
// ensure the hamburger menu reflects the newly disconnected state.
this.updateAppMenuItem();
},
handleEvent(event) {
this._inCustomizationMode = event.type == "customizationstarting";
this.updateAppMenuItem();
this.updateUI();
},
// Note that updateUI() returns a Promise that's only used by tests.
updateUI() {
// It's possible someone signed in to FxA after seeing our notification
// about "Legacy Sync migration" (which now is actually "Legacy Sync
// auto-disconnect") so kill that notification if it still exists.
let nb = window.document.getElementById("global-notificationbox");
let n = nb.getNotificationWithValue(this.SYNC_MIGRATION_NOTIFICATION_TITLE);
if (n) {
nb.removeNotification(n, true);
}
this.updateAppMenuItem();
},
// Note that updateAppMenuItem() returns a Promise that's only used by tests.
updateAppMenuItem() {
let profileInfoEnabled = false;
try {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
} catch (e) { }
// Bail out if FxA is disabled.
if (!this.weave.fxAccountsEnabled) {
return Promise.resolve();
}
this.panelUIFooter.hidden = false;
// Make sure the button is disabled in customization mode.
@ -477,8 +411,5 @@ XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function() {
return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
});
XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator",
"resource://services-sync/FxaMigrator.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "EnsureFxAccountsWebChannel",
"resource://gre/modules/FxAccountsWebChannel.jsm");

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

@ -496,7 +496,7 @@
label="&syncSignIn.label;"
accesskey="&syncSignIn.accesskey;"
observes="sync-setup-state"
oncommand="gSyncUI.openSetup(null, 'menubar')"/>
oncommand="gSyncUI.openPrefs('menubar')"/>
<menuitem id="sync-syncnowitem"
label="&syncSyncNowItem.label;"
accesskey="&syncSyncNowItem.accesskey;"

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

@ -97,41 +97,22 @@ var gSyncUI = {
// Returns a promise that resolves with true if Sync needs to be configured,
// false otherwise.
_needsSetup() {
// If Sync is configured for FxAccounts then we do that promise-dance.
if (this.weaveService.fxAccountsEnabled) {
return fxAccounts.getSignedInUser().then(user => {
// We want to treat "account needs verification" as "needs setup".
return !(user && user.verified);
});
}
// We are using legacy sync - check that.
let firstSync = "";
try {
firstSync = Services.prefs.getCharPref("services.sync.firstSync");
} catch (e) { }
return Promise.resolve(Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
firstSync == "notReady");
return fxAccounts.getSignedInUser().then(user => {
// We want to treat "account needs verification" as "needs setup".
return !(user && user.verified);
});
},
// Returns a promise that resolves with true if the user currently signed in
// to Sync needs to be verified, false otherwise.
_needsVerification() {
// For callers who care about the distinction between "needs setup" and
// "needs verification"
if (this.weaveService.fxAccountsEnabled) {
return fxAccounts.getSignedInUser().then(user => {
// If there is no user, they can't be in a "needs verification" state.
if (!user) {
return false;
}
return !user.verified;
});
}
// Otherwise we are configured for legacy Sync, which has no verification
// concept.
return Promise.resolve(false);
return fxAccounts.getSignedInUser().then(user => {
// If there is no user, they can't be in a "needs verification" state.
if (!user) {
return false;
}
return !user.verified;
});
},
// Note that we don't show login errors in a notification bar here, but do
@ -267,7 +248,7 @@ var gSyncUI = {
handleToolbarButton() {
this._needsSetup().then(needsSetup => {
if (needsSetup || this.loginFailed()) {
this.openSetup();
this.openPrefs();
} else {
this.doSync();
}
@ -277,46 +258,12 @@ var gSyncUI = {
},
/**
* Invoke the Sync setup wizard.
* Open the Sync preferences.
*
* @param wizardType
* Indicates type of wizard to launch:
* null -- regular set up wizard
* "pair" -- pair a device first
* "reset" -- reset sync
* @param entryPoint
* Indicates the entrypoint from where this method was called.
*/
openSetup: function SUI_openSetup(wizardType, entryPoint = "syncbutton") {
if (this.weaveService.fxAccountsEnabled) {
this.openPrefs(entryPoint);
} else {
let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
if (win)
win.focus();
else {
window.openDialog("chrome://browser/content/sync/setup.xul",
"weaveSetup", "centerscreen,chrome,resizable=no",
wizardType);
}
}
},
// Open the legacy-sync device pairing UI. Note used for FxA Sync.
openAddDevice() {
if (!Weave.Utils.ensureMPUnlocked())
return;
let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
if (win)
win.focus();
else
window.openDialog("chrome://browser/content/sync/addDevice.xul",
"syncAddDevice", "centerscreen,chrome,resizable=no");
},
openPrefs(entryPoint) {
openPrefs(entryPoint = "syncbutton") {
openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
},
@ -374,9 +321,10 @@ var gSyncUI = {
return;
let email;
try {
email = Services.prefs.getCharPref("services.sync.username");
} catch (ex) {}
let user = yield fxAccounts.getSignedInUser();
if (user) {
email = user.email;
}
let needsSetup = yield this._needsSetup();
let needsVerification = yield this._needsVerification();

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

@ -565,8 +565,13 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
visibility: collapse;
}
#identity-box {
-moz-user-focus: normal;
}
#urlbar[pageproxystate="invalid"] > #identity-box {
pointer-events: none;
-moz-user-focus: ignore;
}
#identity-icon-labels {

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

@ -689,13 +689,9 @@
newlines="stripsurroundingwhitespace"
ontextentered="this.handleCommand(param);"
ontextreverted="return this.handleRevert();"
pageproxystate="invalid"
onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
onblur="setTimeout(() => { document.getElementById('identity-box').style.MozUserFocus = ''; }, 0);">
pageproxystate="invalid">
<!-- Use onclick instead of normal popup= syntax since the popup
code fires onmousedown, and hence eats our favicon drag events.
We only add the identity-box button to the tab order when the location bar
has focus, otherwise pressing F6 focuses it instead of the location bar -->
code fires onmousedown, and hence eats our favicon drag events. -->
<box id="identity-box" role="button"
align="center"
aria-label="&urlbar.viewSiteInfo.label;"

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

@ -19,6 +19,7 @@ var gGrid = {
* The DOM node of the grid.
*/
_node: null,
_gridDefaultContent: null,
get node() { return this._node; },
/**
@ -49,6 +50,7 @@ var gGrid = {
*/
init: function Grid_init() {
this._node = document.getElementById("newtab-grid");
this._gridDefaultContent = this._node.lastChild;
this._createSiteFragment();
gLinks.populateCache(() => {
@ -147,7 +149,9 @@ var gGrid = {
}
this._cells = cells;
this._node.innerHTML = "";
while (this._gridDefaultContent.nextSibling) {
this._gridDefaultContent.nextSibling.remove();
}
this._node.appendChild(fragment);
},

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

@ -122,6 +122,10 @@ input[type=button] {
pointer-events: none;
}
body:not(.compact) #topsites-heading {
display: none;
}
/*
* If you change the sizes here, make sure you
* change the preferences:

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

@ -55,6 +55,7 @@
<div id="newtab-vertical-margin">
<div id="newtab-margin-top"/>
<div id="newtab-margin-undo-container">
<div id="newtab-undo-container" undo-disabled="true">
<label id="newtab-undo-label">&newtab.undo.removedLabel;</label>
@ -79,9 +80,11 @@
<div id="newtab-horizontal-margin">
<div class="newtab-side-margin"/>
<div id="newtab-grid">
<h1 id="topsites-heading">&newtab.topSites.heading;</h1>
</div>
<div class="newtab-side-margin"/>
</div>
<div id="newtab-margin-bottom"/>
</div>
<input id="newtab-customize-button" type="button" dir="&locale.dir;"

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

@ -1,157 +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/. */
var Ci = Components.interfaces;
var Cc = Components.classes;
var Cu = Components.utils;
Cu.import("resource://services-sync/main.js");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const PIN_PART_LENGTH = 4;
const ADD_DEVICE_PAGE = 0;
const SYNC_KEY_PAGE = 1;
const DEVICE_CONNECTED_PAGE = 2;
var gSyncAddDevice = {
init: function init() {
this.pin1.setAttribute("maxlength", PIN_PART_LENGTH);
this.pin2.setAttribute("maxlength", PIN_PART_LENGTH);
this.pin3.setAttribute("maxlength", PIN_PART_LENGTH);
this.nextFocusEl = {pin1: this.pin2,
pin2: this.pin3,
pin3: this.wizard.getButton("next")};
this.throbber = document.getElementById("pairDeviceThrobber");
this.errorRow = document.getElementById("errorRow");
// Kick off a sync. That way the server will have the most recent data from
// this computer and it will show up immediately on the new device.
Weave.Service.scheduler.scheduleNextSync(0);
},
onPageShow: function onPageShow() {
this.wizard.getButton("back").hidden = true;
switch (this.wizard.pageIndex) {
case ADD_DEVICE_PAGE:
this.onTextBoxInput();
this.wizard.canRewind = false;
this.wizard.getButton("next").hidden = false;
this.pin1.focus();
break;
case SYNC_KEY_PAGE:
this.wizard.canAdvance = false;
this.wizard.canRewind = true;
this.wizard.getButton("back").hidden = false;
this.wizard.getButton("next").hidden = true;
document.getElementById("weavePassphrase").value =
Weave.Utils.hyphenatePassphrase(Weave.Service.identity.syncKey);
break;
case DEVICE_CONNECTED_PAGE:
this.wizard.canAdvance = true;
this.wizard.canRewind = false;
this.wizard.getButton("cancel").hidden = true;
break;
}
},
onWizardAdvance: function onWizardAdvance() {
switch (this.wizard.pageIndex) {
case ADD_DEVICE_PAGE:
this.startTransfer();
return false;
case DEVICE_CONNECTED_PAGE:
window.close();
return false;
}
return true;
},
startTransfer: function startTransfer() {
this.errorRow.hidden = true;
// When onAbort is called, Weave may already be gone.
const JPAKE_ERROR_USERABORT = Weave.JPAKE_ERROR_USERABORT;
let self = this;
let jpakeclient = this._jpakeclient = new Weave.JPAKEClient({
onPaired: function onPaired() {
let credentials = {account: Weave.Service.identity.account,
password: Weave.Service.identity.basicPassword,
synckey: Weave.Service.identity.syncKey,
serverURL: Weave.Service.serverURL};
jpakeclient.sendAndComplete(credentials);
},
onComplete: function onComplete() {
delete self._jpakeclient;
self.wizard.pageIndex = DEVICE_CONNECTED_PAGE;
// Schedule a Sync for soonish to fetch the data uploaded by the
// device with which we just paired.
Weave.Service.scheduler.scheduleNextSync(Weave.Service.scheduler.activeInterval);
},
onAbort: function onAbort(error) {
delete self._jpakeclient;
// Aborted by user, ignore.
if (error == JPAKE_ERROR_USERABORT) {
return;
}
self.errorRow.hidden = false;
self.throbber.hidden = true;
self.pin1.value = self.pin2.value = self.pin3.value = "";
self.pin1.disabled = self.pin2.disabled = self.pin3.disabled = false;
self.pin1.focus();
}
});
this.throbber.hidden = false;
this.pin1.disabled = this.pin2.disabled = this.pin3.disabled = true;
this.wizard.canAdvance = false;
let pin = this.pin1.value + this.pin2.value + this.pin3.value;
let expectDelay = false;
jpakeclient.pairWithPIN(pin, expectDelay);
},
onWizardBack: function onWizardBack() {
if (this.wizard.pageIndex != SYNC_KEY_PAGE)
return true;
this.wizard.pageIndex = ADD_DEVICE_PAGE;
return false;
},
onWizardCancel: function onWizardCancel() {
if (this._jpakeclient) {
this._jpakeclient.abort();
delete this._jpakeclient;
}
return true;
},
onTextBoxInput: function onTextBoxInput(textbox) {
if (textbox && textbox.value.length == PIN_PART_LENGTH)
this.nextFocusEl[textbox.id].focus();
this.wizard.canAdvance = (this.pin1.value.length == PIN_PART_LENGTH
&& this.pin2.value.length == PIN_PART_LENGTH
&& this.pin3.value.length == PIN_PART_LENGTH);
},
goToSyncKeyPage: function goToSyncKeyPage() {
this.wizard.pageIndex = SYNC_KEY_PAGE;
}
};
// onWizardAdvance() and onPageShow() are run before init() so we'll set
// these up as lazy getters.
["wizard", "pin1", "pin2", "pin3"].forEach(function(id) {
XPCOMUtils.defineLazyGetter(gSyncAddDevice, id, function() {
return document.getElementById(id);
});
});

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

@ -1,129 +0,0 @@
<?xml version="1.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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncSetup.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncCommon.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
<!ENTITY % syncSetupDTD SYSTEM "chrome://browser/locale/syncSetup.dtd">
%brandDTD;
%syncBrandDTD;
%syncSetupDTD;
]>
<wizard xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="wizard"
title="&pairDevice.title.label;"
windowtype="Sync:AddDevice"
persist="screenX screenY"
onwizardnext="return gSyncAddDevice.onWizardAdvance();"
onwizardback="return gSyncAddDevice.onWizardBack();"
onwizardcancel="gSyncAddDevice.onWizardCancel();"
onload="gSyncAddDevice.init();">
<script type="application/javascript"
src="chrome://browser/content/sync/addDevice.js"/>
<script type="application/javascript"
src="chrome://browser/content/sync/utils.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"
src="chrome://global/content/printUtils.js"/>
<wizardpage id="addDevicePage"
label="&pairDevice.title.label;"
onpageshow="gSyncAddDevice.onPageShow();">
<description>
&pairDevice.dialog.description.label;
<label class="text-link"
value="&addDevice.showMeHow.label;"
href="https://services.mozilla.com/sync/help/add-device"/>
</description>
<separator class="groove-thin"/>
<description>
&addDevice.dialog.enterCode.label;
</description>
<separator class="groove-thin"/>
<vbox align="center">
<textbox id="pin1"
class="pin"
oninput="gSyncAddDevice.onTextBoxInput(this);"
onfocus="this.select();"
/>
<textbox id="pin2"
class="pin"
oninput="gSyncAddDevice.onTextBoxInput(this);"
onfocus="this.select();"
/>
<textbox id="pin3"
class="pin"
oninput="gSyncAddDevice.onTextBoxInput(this);"
onfocus="this.select();"
/>
</vbox>
<separator class="groove-thin"/>
<vbox id="pairDeviceThrobber" align="center" hidden="true">
<image/>
</vbox>
<hbox id="errorRow" pack="center" hidden="true">
<image class="statusIcon" status="error"/>
<label class="status"
value="&addDevice.dialog.tryAgain.label;"/>
</hbox>
<spacer flex="3"/>
<label class="text-link"
value="&addDevice.dontHaveDevice.label;"
onclick="gSyncAddDevice.goToSyncKeyPage();"/>
</wizardpage>
<!-- Need a non-empty label here, otherwise we get a default label on Mac -->
<wizardpage id="syncKeyPage"
label=" "
onpageshow="gSyncAddDevice.onPageShow();">
<description>
&addDevice.dialog.recoveryKey.label;
</description>
<spacer/>
<groupbox>
<label value="&recoveryKeyEntry.label;"
accesskey="&recoveryKeyEntry.accesskey;"
control="weavePassphrase"/>
<textbox id="weavePassphrase"
readonly="true"/>
</groupbox>
<groupbox align="center">
<description>&recoveryKeyBackup.description;</description>
<hbox>
<button id="printSyncKeyButton"
label="&button.syncKeyBackup.print.label;"
accesskey="&button.syncKeyBackup.print.accesskey;"
oncommand="gSyncUtils.passphrasePrint('weavePassphrase');"/>
<button id="saveSyncKeyButton"
label="&button.syncKeyBackup.save.label;"
accesskey="&button.syncKeyBackup.save.accesskey;"
oncommand="gSyncUtils.passphraseSave('weavePassphrase');"/>
</hbox>
</groupbox>
</wizardpage>
<wizardpage id="deviceConnectedPage"
label="&addDevice.dialog.connected.label;"
onpageshow="gSyncAddDevice.onPageShow();">
<vbox align="center">
<image id="successPageIcon"/>
</vbox>
<separator/>
<description class="normal">
&addDevice.dialog.successful.label;
</description>
</wizardpage>
</wizard>

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

@ -1,28 +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/. */
:root {
font-size: 80%;
}
#sync-customize-pane {
padding-inline-start: 74px;
background: top left url(chrome://browser/skin/sync-128.png) no-repeat;
background-size: 64px;
}
#sync-customize-title {
margin-inline-start: 0;
padding-bottom: 0.5em;
font-weight: bold;
}
#sync-customize-subtitle {
font-size: 90%;
}
checkbox {
margin: 0;
padding: 0.5em 0 0;
}

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

@ -1,25 +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/. */
"use strict";
Components.utils.import("resource://gre/modules/Services.jsm");
addEventListener("dialogaccept", function() {
let pane = document.getElementById("sync-customize-pane");
// First determine what the preference for the "global" sync enabled pref
// should be based on the engines selected.
let prefElts = pane.querySelectorAll("preferences > preference");
let syncEnabled = false;
for (let elt of prefElts) {
if (elt.name.startsWith("services.sync.") && elt.value) {
syncEnabled = true;
break;
}
}
Services.prefs.setBoolPref("services.sync.enabled", syncEnabled);
// and write the individual prefs.
pane.writePreferences(true);
window.arguments[0].accepted = true;
});

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

@ -1,67 +0,0 @@
<?xml version="1.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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/sync/customize.css" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % syncCustomizeDTD SYSTEM "chrome://browser/locale/syncCustomize.dtd">
%syncCustomizeDTD;
]>
<dialog id="sync-customize"
windowtype="Sync:Customize"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&syncCustomize.dialog.title;"
buttonlabelaccept="&syncCustomize.acceptButton.label;"
buttons="accept">
<prefpane id="sync-customize-pane">
<preferences>
<preference id="engine.bookmarks" name="services.sync.engine.bookmarks" type="bool"/>
<preference id="engine.history" name="services.sync.engine.history" type="bool"/>
<preference id="engine.tabs" name="services.sync.engine.tabs" type="bool"/>
<preference id="engine.passwords" name="services.sync.engine.passwords" type="bool"/>
<preference id="engine.addons" name="services.sync.engine.addons" type="bool"/>
<preference id="engine.prefs" name="services.sync.engine.prefs" type="bool"/>
</preferences>
<label id="sync-customize-title" value="&syncCustomize.title;"/>
<description id="sync-customize-subtitle"
#ifdef XP_UNIX
value="&syncCustomizeUnix.description;"
#else
value="&syncCustomize.description;"
#endif
/>
<vbox align="start">
<checkbox label="&engine.tabs.label2;"
accesskey="&engine.tabs.accesskey;"
preference="engine.tabs"/>
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
<checkbox label="&engine.history.label;"
accesskey="&engine.history.accesskey;"
preference="engine.history"/>
<checkbox label="&engine.addons.label;"
accesskey="&engine.addons.accesskey;"
preference="engine.addons"/>
<checkbox label="&engine.prefs.label;"
accesskey="&engine.prefs.accesskey;"
preference="engine.prefs"/>
</vbox>
</prefpane>
<script type="application/javascript"
src="chrome://browser/content/sync/customize.js" />
</dialog>

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

@ -1,226 +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/. */
var Ci = Components.interfaces;
var Cc = Components.classes;
Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://gre/modules/Services.jsm");
var Change = {
_dialog: null,
_dialogType: null,
_status: null,
_statusIcon: null,
_firstBox: null,
_secondBox: null,
get _passphraseBox() {
delete this._passphraseBox;
return this._passphraseBox = document.getElementById("passphraseBox");
},
get _currentPasswordInvalid() {
return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED;
},
get _updatingPassphrase() {
return this._dialogType == "UpdatePassphrase";
},
onLoad: function Change_onLoad() {
/* Load labels */
let introText = document.getElementById("introText");
let warningText = document.getElementById("warningText");
// load some other elements & info from the window
this._dialog = document.getElementById("change-dialog");
this._dialogType = window.arguments[0];
this._duringSetup = window.arguments[1];
this._status = document.getElementById("status");
this._statusIcon = document.getElementById("statusIcon");
this._statusRow = document.getElementById("statusRow");
this._firstBox = document.getElementById("textBox1");
this._secondBox = document.getElementById("textBox2");
this._dialog.getButton("finish").disabled = true;
this._dialog.getButton("back").hidden = true;
this._stringBundle =
Services.strings.createBundle("chrome://browser/locale/syncGenericChange.properties");
switch (this._dialogType) {
case "UpdatePassphrase":
case "ResetPassphrase":
document.getElementById("textBox1Row").hidden = true;
document.getElementById("textBox2Row").hidden = true;
document.getElementById("passphraseLabel").value
= this._str("new.recoverykey.label");
document.getElementById("passphraseSpacer").hidden = false;
if (this._updatingPassphrase) {
document.getElementById("passphraseHelpBox").hidden = false;
document.title = this._str("new.recoverykey.title");
introText.textContent = this._str("new.recoverykey.introText");
this._dialog.getButton("finish").label
= this._str("new.recoverykey.acceptButton");
} else {
document.getElementById("generatePassphraseButton").hidden = false;
document.getElementById("passphraseBackupButtons").hidden = false;
this._passphraseBox.setAttribute("readonly", "true");
let pp = Weave.Service.identity.syncKey;
if (Weave.Utils.isPassphrase(pp))
pp = Weave.Utils.hyphenatePassphrase(pp);
this._passphraseBox.value = pp;
this._passphraseBox.focus();
document.title = this._str("change.recoverykey.title");
introText.textContent = this._str("change.synckey.introText2");
warningText.textContent = this._str("change.recoverykey.warningText");
this._dialog.getButton("finish").label
= this._str("change.recoverykey.acceptButton");
if (this._duringSetup) {
this._dialog.getButton("finish").disabled = false;
}
}
break;
case "ChangePassword":
document.getElementById("passphraseRow").hidden = true;
let box1label = document.getElementById("textBox1Label");
let box2label = document.getElementById("textBox2Label");
box1label.value = this._str("new.password.label");
if (this._currentPasswordInvalid) {
document.title = this._str("new.password.title");
introText.textContent = this._str("new.password.introText");
this._dialog.getButton("finish").label
= this._str("new.password.acceptButton");
document.getElementById("textBox2Row").hidden = true;
} else {
document.title = this._str("change.password.title");
box2label.value = this._str("new.password.confirm");
introText.textContent = this._str("change.password3.introText");
warningText.textContent = this._str("change.password.warningText");
this._dialog.getButton("finish").label
= this._str("change.password.acceptButton");
}
break;
}
document.getElementById("change-page")
.setAttribute("label", document.title);
},
_clearStatus: function _clearStatus() {
this._status.value = "";
this._statusIcon.removeAttribute("status");
},
_updateStatus: function Change__updateStatus(str, state) {
this._updateStatusWithString(this._str(str), state);
},
_updateStatusWithString: function Change__updateStatusWithString(string, state) {
this._statusRow.hidden = false;
this._status.value = string;
this._statusIcon.setAttribute("status", state);
let error = state == "error";
this._dialog.getButton("cancel").disabled = !error;
this._dialog.getButton("finish").disabled = !error;
document.getElementById("printSyncKeyButton").disabled = !error;
document.getElementById("saveSyncKeyButton").disabled = !error;
if (state == "success")
window.setTimeout(window.close, 1500);
},
onDialogAccept() {
switch (this._dialogType) {
case "UpdatePassphrase":
case "ResetPassphrase":
return this.doChangePassphrase();
case "ChangePassword":
return this.doChangePassword();
}
return undefined;
},
doGeneratePassphrase() {
let passphrase = Weave.Utils.generatePassphrase();
this._passphraseBox.value = Weave.Utils.hyphenatePassphrase(passphrase);
this._dialog.getButton("finish").disabled = false;
},
doChangePassphrase: function Change_doChangePassphrase() {
let pp = Weave.Utils.normalizePassphrase(this._passphraseBox.value);
if (this._updatingPassphrase) {
Weave.Service.identity.syncKey = pp;
if (Weave.Service.login()) {
this._updateStatus("change.recoverykey.success", "success");
Weave.Service.persistLogin();
Weave.Service.scheduler.delayedAutoConnect(0);
} else {
this._updateStatus("new.passphrase.status.incorrect", "error");
}
} else {
this._updateStatus("change.recoverykey.label", "active");
if (Weave.Service.changePassphrase(pp))
this._updateStatus("change.recoverykey.success", "success");
else
this._updateStatus("change.recoverykey.error", "error");
}
return false;
},
doChangePassword: function Change_doChangePassword() {
if (this._currentPasswordInvalid) {
Weave.Service.identity.basicPassword = this._firstBox.value;
if (Weave.Service.login()) {
this._updateStatus("change.password.status.success", "success");
Weave.Service.persistLogin();
} else {
this._updateStatus("new.password.status.incorrect", "error");
}
} else {
this._updateStatus("change.password.status.active", "active");
if (Weave.Service.changePassword(this._firstBox.value))
this._updateStatus("change.password.status.success", "success");
else
this._updateStatus("change.password.status.error", "error");
}
return false;
},
validate(event) {
let valid = false;
let errorString = "";
if (this._dialogType == "ChangePassword") {
if (this._currentPasswordInvalid)
[valid, errorString] = gSyncUtils.validatePassword(this._firstBox);
else
[valid, errorString] = gSyncUtils.validatePassword(this._firstBox, this._secondBox);
} else {
if (!this._updatingPassphrase)
return;
valid = this._passphraseBox.value != "";
}
if (errorString == "")
this._clearStatus();
else
this._updateStatusWithString(errorString, "error");
this._statusRow.hidden = valid;
this._dialog.getButton("finish").disabled = !valid;
},
_str: function Change__string(str) {
return this._stringBundle.GetStringFromName(str);
}
};

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

@ -1,123 +0,0 @@
<?xml version="1.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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncSetup.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncCommon.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
<!ENTITY % syncSetupDTD SYSTEM "chrome://browser/locale/syncSetup.dtd">
%brandDTD;
%syncBrandDTD;
%syncSetupDTD;
]>
<wizard xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="change-dialog"
windowtype="Weave:ChangeSomething"
persist="screenX screenY"
onwizardnext="Change.onLoad()"
onwizardfinish="return Change.onDialogAccept();">
<script type="application/javascript"
src="chrome://browser/content/sync/genericChange.js"/>
<script type="application/javascript"
src="chrome://browser/content/sync/utils.js"/>
<script type="application/javascript"
src="chrome://global/content/printUtils.js"/>
<wizardpage id="change-page"
label="">
<description id="introText">
</description>
<separator class="thin"/>
<groupbox>
<grid>
<columns>
<column align="right"/>
<column flex="3"/>
<column flex="1"/>
</columns>
<rows>
<row id="textBox1Row" align="center">
<label id="textBox1Label" control="textBox1"/>
<textbox id="textBox1" type="password" oninput="Change.validate()"/>
<spacer/>
</row>
<row id="textBox2Row" align="center">
<label id="textBox2Label" control="textBox2"/>
<textbox id="textBox2" type="password" oninput="Change.validate()"/>
<spacer/>
</row>
</rows>
</grid>
<vbox id="passphraseRow">
<hbox flex="1">
<label id="passphraseLabel" control="passphraseBox"/>
<spacer flex="1"/>
<label id="generatePassphraseButton"
hidden="true"
value="&syncGenerateNewKey.label;"
class="text-link"
onclick="event.stopPropagation();
Change.doGeneratePassphrase();"/>
</hbox>
<textbox id="passphraseBox"
flex="1"
onfocus="this.select()"
oninput="Change.validate()"/>
</vbox>
<vbox id="feedback" pack="center">
<hbox id="statusRow" align="center">
<image id="statusIcon" class="statusIcon"/>
<label id="status" class="status" value=" "/>
</hbox>
</vbox>
</groupbox>
<separator class="thin"/>
<hbox id="passphraseBackupButtons"
hidden="true"
pack="center">
<button id="printSyncKeyButton"
label="&button.syncKeyBackup.print.label;"
accesskey="&button.syncKeyBackup.print.accesskey;"
oncommand="gSyncUtils.passphrasePrint('passphraseBox');"/>
<button id="saveSyncKeyButton"
label="&button.syncKeyBackup.save.label;"
accesskey="&button.syncKeyBackup.save.accesskey;"
oncommand="gSyncUtils.passphraseSave('passphraseBox');"/>
</hbox>
<vbox id="passphraseHelpBox"
hidden="true">
<description>
&existingRecoveryKey.description;
<label class="text-link"
href="https://services.mozilla.com/sync/help/manual-setup">
&addDevice.showMeHow.label;
</label>
</description>
</vbox>
<spacer id="passphraseSpacer"
flex="1"
hidden="true"/>
<description id="warningText" class="data">
</description>
<spacer flex="1"/>
</wizardpage>
</wizard>

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

@ -1,54 +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/. -->
<!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
%syncBrandDTD;
<!ENTITY % syncKeyDTD SYSTEM "chrome://browser/locale/syncKey.dtd">
%syncKeyDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
%globalDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&syncKey.page.title;</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="robots" content="noindex"/>
<style type="text/css">
#synckey { font-size: 150% }
footer { font-size: 70% }
/* Bug 575675: Need to have an a:visited rule in a chrome document. */
a:visited { color: purple; }
</style>
</head>
<body dir="&locale.dir;">
<h1>&syncKey.page.title;</h1>
<p id="synckey" dir="ltr">SYNCKEY</p>
<p>&syncKey.page.description2;</p>
<div id="column1">
<h2>&syncKey.keepItSecret.heading;</h2>
<p>&syncKey.keepItSecret.description;</p>
</div>
<div id="column2">
<h2>&syncKey.keepItSafe.heading;</h2>
<p><em>&syncKey.keepItSafe1.description;</em>&syncKey.keepItSafe2.description;<em>&syncKey.keepItSafe3.description;</em>&syncKey.keepItSafe4a.description;</p>
</div>
<p>&syncKey.findOutMore1.label;<a href="https://services.mozilla.com">https://services.mozilla.com</a>&syncKey.findOutMore2.label;</p>
<footer>
&syncKey.footer1.label;<a id="tosLink" href="termsURL">termsURL</a>&syncKey.footer2.label;<a id="ppLink" href="privacyURL">privacyURL</a>&syncKey.footer3.label;
</footer>
</body>
</html>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,490 +0,0 @@
<?xml version="1.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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncSetup.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/syncCommon.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
<!ENTITY % syncSetupDTD SYSTEM "chrome://browser/locale/syncSetup.dtd">
%brandDTD;
%syncBrandDTD;
%syncSetupDTD;
]>
<wizard id="wizard"
title="&accountSetupTitle.label;"
windowtype="Weave:AccountSetup"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onwizardnext="return gSyncSetup.onWizardAdvance()"
onwizardback="return gSyncSetup.onWizardBack()"
onwizardcancel="gSyncSetup.onWizardCancel()"
onload="gSyncSetup.init()">
<script type="application/javascript"
src="chrome://browser/content/sync/setup.js"/>
<script type="application/javascript"
src="chrome://browser/content/sync/utils.js"/>
<script type="application/javascript"
src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/javascript"
src="chrome://global/content/printUtils.js"/>
<wizardpage id="addDevicePage"
label="&pairDevice.title.label;"
onpageshow="gSyncSetup.onPageShow()">
<description>
&pairDevice.dialog.description.label;
<label class="text-link"
value="&addDevice.showMeHow.label;"
href="https://services.mozilla.com/sync/help/add-device"/>
</description>
<separator class="groove-thin"/>
<description>
&addDevice.dialog.enterCode.label;
</description>
<separator class="groove-thin"/>
<vbox align="center">
<textbox id="pin1"
class="pin"
oninput="gSyncSetup.onPINInput(this);"
onfocus="this.select();"
/>
<textbox id="pin2"
class="pin"
oninput="gSyncSetup.onPINInput(this);"
onfocus="this.select();"
/>
<textbox id="pin3"
class="pin"
oninput="gSyncSetup.onPINInput(this);"
onfocus="this.select();"
/>
</vbox>
<separator class="groove-thin"/>
<vbox id="pairDeviceThrobber" align="center" hidden="true">
<image/>
</vbox>
<hbox id="pairDeviceErrorRow" pack="center" hidden="true">
<image class="statusIcon" status="error"/>
<label class="status"
value="&addDevice.dialog.tryAgain.label;"/>
</hbox>
</wizardpage>
<wizardpage id="pickSetupType"
label="&syncBrand.fullName.label;"
onpageshow="gSyncSetup.onPageShow()">
<vbox align="center" flex="1">
<description style="padding: 0 7em;">
&setup.pickSetupType.description2;
</description>
<spacer flex="3"/>
<button id="newAccount"
class="accountChoiceButton"
label="&button.createNewAccount.label;"
oncommand="gSyncSetup.startNewAccountSetup()"
align="center"/>
<spacer flex="1"/>
</vbox>
<separator class="groove"/>
<vbox align="center" flex="1">
<spacer flex="1"/>
<button id="existingAccount"
class="accountChoiceButton"
label="&button.haveAccount.label;"
oncommand="gSyncSetup.useExistingAccount()"/>
<spacer flex="3"/>
</vbox>
</wizardpage>
<wizardpage label="&setup.newAccountDetailsPage.title.label;"
id="newAccountStart"
onextra1="gSyncSetup.onSyncOptions()"
onpageshow="gSyncSetup.onPageShow();">
<grid>
<columns>
<column/>
<column class="inputColumn" flex="1"/>
</columns>
<rows>
<row id="emailRow" align="center">
<label value="&setup.emailAddress.label;"
accesskey="&setup.emailAddress.accesskey;"
control="weaveEmail"/>
<textbox id="weaveEmail"
oninput="gSyncSetup.onEmailInput()"/>
</row>
<row id="emailFeedbackRow" align="center" hidden="true">
<spacer/>
<hbox>
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</row>
<row id="passwordRow" align="center">
<label value="&setup.choosePassword.label;"
accesskey="&setup.choosePassword.accesskey;"
control="weavePassword"/>
<textbox id="weavePassword"
type="password"
onchange="gSyncSetup.onPasswordChange()"/>
</row>
<row id="confirmRow" align="center">
<label value="&setup.confirmPassword.label;"
accesskey="&setup.confirmPassword.accesskey;"
control="weavePasswordConfirm"/>
<textbox id="weavePasswordConfirm"
type="password"
onchange="gSyncSetup.onPasswordChange()"/>
</row>
<row id="passwordFeedbackRow" align="center" hidden="true">
<spacer/>
<hbox>
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</row>
<row align="center">
<label control="server"
value="&server.label;"/>
<menulist id="server"
oncommand="gSyncSetup.onServerCommand()"
oninput="gSyncSetup.onServerInput()">
<menupopup>
<menuitem label="&serverType.default.label;"
value="main"/>
<menuitem label="&serverType.custom2.label;"
value="custom"/>
</menupopup>
</menulist>
</row>
<row id="serverFeedbackRow" align="center" hidden="true">
<spacer/>
<hbox>
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</row>
<row id="TOSRow" align="center">
<spacer/>
<hbox align="center">
<checkbox id="tos"
accesskey="&setup.tosAgree1.accesskey;"
oncommand="this.focus(); gSyncSetup.checkFields();"/>
<description id="tosDesc"
flex="1"
onclick="document.getElementById('tos').focus();
document.getElementById('tos').click()">
&setup.tosAgree1.label;
<label class="text-link"
onclick="event.stopPropagation();gSyncUtils.openToS();">
&setup.tosLink.label;
</label>
&setup.tosAgree2.label;
<label class="text-link"
onclick="event.stopPropagation();gSyncUtils.openPrivacyPolicy();">
&setup.ppLink.label;
</label>
&setup.tosAgree3.label;
</description>
</hbox>
</row>
</rows>
</grid>
<spacer flex="1"/>
<vbox flex="1" align="center">
<browser height="150"
width="500"
id="captcha"
type="content"
disablehistory="true"/>
<spacer flex="1"/>
<hbox id="captchaFeedback">
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</vbox>
</wizardpage>
<wizardpage id="addDevice"
label="&pairDevice.title.label;"
onextra1="gSyncSetup.onSyncOptions()"
onpageshow="gSyncSetup.onPageShow()">
<description>
&pairDevice.setup.description.label;
<label class="text-link"
value="&addDevice.showMeHow.label;"
href="https://services.mozilla.com/sync/help/easy-setup"/>
</description>
<label value="&addDevice.setup.enterCode.label;"
control="easySetupPIN1"/>
<spacer flex="1"/>
<vbox align="center" flex="1">
<textbox id="easySetupPIN1"
class="pin"
value=""
readonly="true"
/>
<textbox id="easySetupPIN2"
class="pin"
value=""
readonly="true"
/>
<textbox id="easySetupPIN3"
class="pin"
value=""
readonly="true"
/>
</vbox>
<spacer flex="3"/>
<label class="text-link"
value="&addDevice.dontHaveDevice.label;"
onclick="gSyncSetup.manualSetup();"/>
</wizardpage>
<wizardpage id="existingAccount"
label="&setup.signInPage.title.label;"
onextra1="gSyncSetup.onSyncOptions()"
onpageshow="gSyncSetup.onPageShow()">
<grid>
<columns>
<column/>
<column class="inputColumn" flex="1"/>
</columns>
<rows>
<row id="existingAccountRow" align="center">
<label id="existingAccountLabel"
value="&signIn.account2.label;"
accesskey="&signIn.account2.accesskey;"
control="existingAccount"/>
<textbox id="existingAccountName"
oninput="gSyncSetup.checkFields(event)"
onchange="gSyncSetup.checkFields(event)"/>
</row>
<row id="existingPasswordRow" align="center">
<label id="existingPasswordLabel"
value="&signIn.password.label;"
accesskey="&signIn.password.accesskey;"
control="existingPassword"/>
<textbox id="existingPassword"
type="password"
onkeyup="gSyncSetup.checkFields(event)"
onchange="gSyncSetup.checkFields(event)"/>
</row>
<row id="existingPasswordFeedbackRow" align="center" hidden="true">
<spacer/>
<hbox>
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</row>
<row align="center">
<spacer/>
<label class="text-link"
value="&resetPassword.label;"
onclick="gSyncUtils.resetPassword(); return false;"/>
</row>
<row align="center">
<label control="existingServer"
value="&server.label;"/>
<menulist id="existingServer"
oncommand="gSyncSetup.onExistingServerCommand()"
oninput="gSyncSetup.onExistingServerInput()">
<menupopup>
<menuitem label="&serverType.default.label;"
value="main"/>
<menuitem label="&serverType.custom2.label;"
value="custom"/>
</menupopup>
</menulist>
</row>
<row id="existingServerFeedbackRow" align="center" hidden="true">
<spacer/>
<hbox>
<image class="statusIcon"/>
<vbox>
<label class="status" value=" "/>
</vbox>
</hbox>
</row>
</rows>
</grid>
<groupbox>
<label id="existingPassphraseLabel"
value="&signIn.recoveryKey.label;"
accesskey="&signIn.recoveryKey.accesskey;"
control="existingPassphrase"/>
<textbox id="existingPassphrase"
oninput="gSyncSetup.checkFields()"/>
<hbox id="login-throbber" hidden="true">
<image/>
<label value="&verifying.label;"/>
</hbox>
<vbox align="left" id="existingPassphraseFeedbackRow" hidden="true">
<hbox>
<image class="statusIcon"/>
<label class="status" value=" "/>
</hbox>
</vbox>
</groupbox>
<vbox id="passphraseHelpBox">
<description>
&existingRecoveryKey.description;
<label class="text-link"
href="https://services.mozilla.com/sync/help/manual-setup">
&addDevice.showMeHow.label;
</label>
<spacer id="passphraseHelpSpacer"/>
<label class="text-link"
onclick="gSyncSetup.resetPassphrase(); return false;">
&resetSyncKey.label;
</label>
</description>
</vbox>
</wizardpage>
<wizardpage id="syncOptionsPage"
label="&setup.optionsPage.title;"
onpageshow="gSyncSetup.onPageShow()">
<groupbox id="syncOptions">
<grid>
<columns>
<column/>
<column flex="1" style="margin-inline-end: 2px"/>
</columns>
<rows>
<row align="center">
<label value="&syncDeviceName.label;"
accesskey="&syncDeviceName.accesskey;"
control="syncComputerName"/>
<textbox id="syncComputerName" flex="1"
onchange="gSyncUtils.changeName(this)"/>
</row>
<row>
<label value="&syncMy.label;" />
<vbox>
<checkbox label="&engine.addons.label;"
accesskey="&engine.addons.accesskey;"
id="engine.addons"
checked="true"/>
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
id="engine.bookmarks"
checked="true"/>
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
id="engine.passwords"
checked="true"/>
<checkbox label="&engine.prefs.label;"
accesskey="&engine.prefs.accesskey;"
id="engine.prefs"
checked="true"/>
<checkbox label="&engine.history.label;"
accesskey="&engine.history.accesskey;"
id="engine.history"
checked="true"/>
<checkbox label="&engine.tabs.label2;"
accesskey="&engine.tabs.accesskey;"
id="engine.tabs"
checked="true"/>
</vbox>
</row>
</rows>
</grid>
</groupbox>
<groupbox id="mergeOptions">
<radiogroup id="mergeChoiceRadio" pack="start">
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows flex="1">
<row align="center">
<radio id="resetClient"
class="mergeChoiceButton"
aria-labelledby="resetClientLabel"/>
<label id="resetClientLabel" control="resetClient">
<html:strong>&choice2.merge.recommended.label;</html:strong>
&choice2a.merge.main.label;
</label>
</row>
<row align="center">
<radio id="wipeClient"
class="mergeChoiceButton"
aria-labelledby="wipeClientLabel"/>
<label id="wipeClientLabel"
control="wipeClient">
&choice2a.client.main.label;
</label>
</row>
<row align="center">
<radio id="wipeRemote"
class="mergeChoiceButton"
aria-labelledby="wipeRemoteLabel"/>
<label id="wipeRemoteLabel"
control="wipeRemote">
&choice2a.server.main.label;
</label>
</row>
</rows>
</grid>
</radiogroup>
</groupbox>
</wizardpage>
<wizardpage id="syncOptionsConfirm"
label="&setup.optionsConfirmPage.title;"
onpageshow="gSyncSetup.onPageShow()">
<deck id="chosenActionDeck">
<vbox id="chosenActionMerge" class="confirm">
<description class="normal">
&confirm.merge2.label;
</description>
</vbox>
<vbox id="chosenActionWipeClient" class="confirm">
<description class="normal">
&confirm.client3.label;
</description>
<separator class="thin"/>
<vbox id="dataList">
<label class="data indent" id="bookmarkCount"/>
<label class="data indent" id="historyCount"/>
<label class="data indent" id="passwordCount"/>
<label class="data indent" id="addonCount"/>
<label class="data indent" id="prefsWipe"
value="&engine.prefs.label;"/>
</vbox>
<separator class="thin"/>
<description class="normal">
&confirm.client2.moreinfo.label;
</description>
</vbox>
<vbox id="chosenActionWipeServer" class="confirm">
<description class="normal">
&confirm.server2.label;
</description>
<separator class="thin"/>
<vbox id="clientList">
</vbox>
</vbox>
</deck>
</wizardpage>
<!-- In terms of the wizard flow shown to the user, the 'syncOptionsConfirm'
page above is not the last wizard page. To prevent the wizard binding from
assuming that it is, we're inserting this dummy page here. This also means
that the wizard needs to always be closed manually via wizardFinish(). -->
<wizardpage>
</wizardpage>
</wizard>

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

@ -1,229 +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/. */
// Equivalent to 0o600 permissions; used for saved Sync Recovery Key.
// This constant can be replaced when the equivalent values are available to
// chrome JS; see Bug 433295 and Bug 757351.
const PERMISSIONS_RWUSR = 0x180;
// Weave should always exist before before this file gets included.
var gSyncUtils = {
get bundle() {
delete this.bundle;
return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
},
get fxAccountsEnabled() {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
return service.fxAccountsEnabled;
},
// opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
_openLink(url) {
let thisDocEl = document.documentElement,
openerDocEl = window.opener && window.opener.document.documentElement;
if (thisDocEl.id == "accountSetup" && window.opener &&
openerDocEl.id == "BrowserPreferences" && !openerDocEl.instantApply)
openUILinkIn(url, "window");
else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
openUILinkIn(url, "window");
else if (document.documentElement.id == "change-dialog")
Services.wm.getMostRecentWindow("navigator:browser")
.openUILinkIn(url, "tab");
else
openUILinkIn(url, "tab");
},
changeName: function changeName(input) {
// Make sure to update to a modified name, e.g., empty-string -> default
Weave.Service.clientsEngine.localName = input.value;
input.value = Weave.Service.clientsEngine.localName;
},
openChange: function openChange(type, duringSetup) {
// Just re-show the dialog if it's already open
let openedDialog = Services.wm.getMostRecentWindow("Sync:" + type);
if (openedDialog != null) {
openedDialog.focus();
return;
}
// Open up the change dialog
let changeXUL = "chrome://browser/content/sync/genericChange.xul";
let changeOpt = "centerscreen,chrome,resizable=no";
Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
type, duringSetup);
},
changePassword() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ChangePassword");
},
resetPassphrase(duringSetup) {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ResetPassphrase", duringSetup);
},
updatePassphrase() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("UpdatePassphrase");
},
resetPassword() {
this._openLink(Weave.Service.pwResetURL);
},
get tosURL() {
let root = this.fxAccountsEnabled ? "fxa." : "";
return Weave.Svc.Prefs.get(root + "termsURL");
},
openToS() {
this._openLink(this.tosURL);
},
get privacyPolicyURL() {
let root = this.fxAccountsEnabled ? "fxa." : "";
return Weave.Svc.Prefs.get(root + "privacyURL");
},
openPrivacyPolicy() {
this._openLink(this.privacyPolicyURL);
},
/**
* Prepare an invisible iframe with the passphrase backup document.
* Used by both the print and saving methods.
*
* @param elid : ID of the form element containing the passphrase.
* @param callback : Function called once the iframe has loaded.
*/
_preparePPiframe(elid, callback) {
let pp = document.getElementById(elid).value;
// Create an invisible iframe whose contents we can print.
let iframe = document.createElement("iframe");
iframe.setAttribute("src", "chrome://browser/content/sync/key.xhtml");
iframe.collapsed = true;
document.documentElement.appendChild(iframe);
iframe.contentWindow.addEventListener("load", function() {
// Insert the Sync Key into the page.
let el = iframe.contentDocument.getElementById("synckey");
el.firstChild.nodeValue = pp;
// Insert the TOS and Privacy Policy URLs into the page.
let termsURL = Weave.Svc.Prefs.get("termsURL");
el = iframe.contentDocument.getElementById("tosLink");
el.setAttribute("href", termsURL);
el.firstChild.nodeValue = termsURL;
let privacyURL = Weave.Svc.Prefs.get("privacyURL");
el = iframe.contentDocument.getElementById("ppLink");
el.setAttribute("href", privacyURL);
el.firstChild.nodeValue = privacyURL;
callback(iframe);
}, {once: true});
},
/**
* Print passphrase backup document.
*
* @param elid : ID of the form element containing the passphrase.
*/
passphrasePrint(elid) {
this._preparePPiframe(elid, function(iframe) {
let webBrowserPrint = iframe.contentWindow
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebBrowserPrint);
let printSettings = PrintUtils.getPrintSettings();
// Display no header/footer decoration except for the date.
printSettings.headerStrLeft
= printSettings.headerStrCenter
= printSettings.headerStrRight
= printSettings.footerStrLeft
= printSettings.footerStrCenter = "";
printSettings.footerStrRight = "&D";
try {
webBrowserPrint.print(printSettings, null);
} catch (ex) {
// print()'s return codes are expressed as exceptions. Ignore.
}
});
},
/**
* Save passphrase backup document to disk as HTML file.
*
* @param elid : ID of the form element containing the passphrase.
*/
passphraseSave(elid) {
let dialogTitle = this.bundle.GetStringFromName("save.recoverykey.title");
let defaultSaveName = this.bundle.GetStringFromName("save.recoverykey.defaultfilename");
this._preparePPiframe(elid, function(iframe) {
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
let fpCallback = function fpCallback_done(aResult) {
if (aResult == Ci.nsIFilePicker.returnOK ||
aResult == Ci.nsIFilePicker.returnReplace) {
let stream = Cc["@mozilla.org/network/file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
stream.init(fp.file, -1, PERMISSIONS_RWUSR, 0);
let serializer = new XMLSerializer();
let output = serializer.serializeToString(iframe.contentDocument);
output = output.replace(/<!DOCTYPE (.|\n)*?]>/,
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' +
'"DTD/xhtml1-strict.dtd">');
output = Weave.Utils.encodeUTF8(output);
stream.write(output, output.length);
}
};
fp.init(window, dialogTitle, Ci.nsIFilePicker.modeSave);
fp.appendFilters(Ci.nsIFilePicker.filterHTML);
fp.defaultString = defaultSaveName;
fp.open(fpCallback);
return false;
});
},
/**
* validatePassword
*
* @param el1 : the first textbox element in the form
* @param el2 : the second textbox element, if omitted it's an update form
*
* returns [valid, errorString]
*/
validatePassword(el1, el2) {
let valid = false;
let val1 = el1.value;
let val2 = el2 ? el2.value : "";
let error = "";
if (!el2)
valid = val1.length >= Weave.MIN_PASS_LENGTH;
else if (val1 && val1 == Weave.Service.identity.username)
error = "change.password.pwSameAsUsername";
else if (val1 && val1 == Weave.Service.identity.account)
error = "change.password.pwSameAsEmail";
else if (val1 && val1 == Weave.Service.identity.basicPassword)
error = "change.password.pwSameAsPassword";
else if (val1 && val2) {
if (val1 == val2 && val1.length >= Weave.MIN_PASS_LENGTH)
valid = true;
else if (val1.length < Weave.MIN_PASS_LENGTH)
error = "change.password.tooShort";
else if (val1 != val2)
error = "change.password.mismatch";
}
let errorString = error ? Weave.Utils.getErrorString(error) : "";
return [valid, errorString];
}
};

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

@ -318,7 +318,6 @@ tags = fullscreen
skip-if = os == "linux" # Linux: Intermittent failures - bug 941575.
[browser_fxaccounts.js]
support-files = fxa_profile_handler.sjs
[browser_fxa_migrate.js]
[browser_fxa_web_channel.js]
[browser_gestureSupport.js]
skip-if = e10s # Bug 863514 - no gesture support.
@ -432,6 +431,7 @@ support-files =
support-files =
permissions.html
temporary_permissions_subframe.html
../webrtc/get_user_media.html
[browser_temporary_permissions_navigation.js]
[browser_temporary_permissions_tabs.js]
[browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js]

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

@ -16,58 +16,58 @@ StarUI._closePanelQuickForTesting = true;
function* test_bookmarks_popup({isNewBookmark, popupShowFn, popupEditFn,
shouldAutoClose, popupHideFn, isBookmarkRemoved}) {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
try {
if (!isNewBookmark) {
yield PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
url: "about:home",
title: "Home Page"
});
}
yield BrowserTestUtils.withNewTab({gBrowser, url: "about:home"}, function*(browser) {
try {
if (!isNewBookmark) {
yield PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
url: "about:home",
title: "Home Page"
});
}
is(bookmarkStar.hasAttribute("starred"), !isNewBookmark,
"Page should only be starred prior to popupshown if editing bookmark");
is(bookmarkPanel.state, "closed", "Panel should be 'closed' to start test");
let shownPromise = promisePopupShown(bookmarkPanel);
yield popupShowFn(tab.linkedBrowser);
yield shownPromise;
is(bookmarkPanel.state, "open", "Panel should be 'open' after shownPromise is resolved");
is(bookmarkStar.hasAttribute("starred"), !isNewBookmark,
"Page should only be starred prior to popupshown if editing bookmark");
is(bookmarkPanel.state, "closed", "Panel should be 'closed' to start test");
let shownPromise = promisePopupShown(bookmarkPanel);
yield popupShowFn(browser);
yield shownPromise;
is(bookmarkPanel.state, "open", "Panel should be 'open' after shownPromise is resolved");
if (popupEditFn) {
yield popupEditFn();
}
let bookmarks = [];
yield PlacesUtils.bookmarks.fetch({url: "about:home"}, bm => bookmarks.push(bm));
is(bookmarks.length, 1, "Only one bookmark should exist");
is(bookmarkStar.getAttribute("starred"), "true", "Page is starred");
is(bookmarkPanelTitle.value,
isNewBookmark ?
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle"),
"title should match isEditingBookmark state");
if (popupEditFn) {
yield popupEditFn();
}
let bookmarks = [];
yield PlacesUtils.bookmarks.fetch({url: "about:home"}, bm => bookmarks.push(bm));
is(bookmarks.length, 1, "Only one bookmark should exist");
is(bookmarkStar.getAttribute("starred"), "true", "Page is starred");
is(bookmarkPanelTitle.value,
isNewBookmark ?
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle"),
"title should match isEditingBookmark state");
if (!shouldAutoClose) {
yield new Promise(resolve => setTimeout(resolve, 400));
is(bookmarkPanel.state, "open", "Panel should still be 'open' for non-autoclose");
}
if (!shouldAutoClose) {
yield new Promise(resolve => setTimeout(resolve, 400));
is(bookmarkPanel.state, "open", "Panel should still be 'open' for non-autoclose");
}
let hiddenPromise = promisePopupHidden(bookmarkPanel);
if (popupHideFn) {
yield popupHideFn();
let hiddenPromise = promisePopupHidden(bookmarkPanel);
if (popupHideFn) {
yield popupHideFn();
}
yield hiddenPromise;
is(bookmarkStar.hasAttribute("starred"), !isBookmarkRemoved,
"Page is starred after closing");
} finally {
let bookmark = yield PlacesUtils.bookmarks.fetch({url: "about:home"});
is(!!bookmark, !isBookmarkRemoved,
"bookmark should not be present if a panel action should've removed it");
if (bookmark) {
yield PlacesUtils.bookmarks.remove(bookmark);
}
}
yield hiddenPromise;
is(bookmarkStar.hasAttribute("starred"), !isBookmarkRemoved,
"Page is starred after closing");
} finally {
let bookmark = yield PlacesUtils.bookmarks.fetch({url: "about:home"});
is(!!bookmark, !isBookmarkRemoved,
"bookmark should not be present if a panel action should've removed it");
if (bookmark) {
yield PlacesUtils.bookmarks.remove(bookmark);
}
gBrowser.removeTab(tab);
}
});
}
add_task(function* panel_shown_for_new_bookmarks_and_autocloses() {
@ -81,7 +81,7 @@ add_task(function* panel_shown_for_new_bookmarks_and_autocloses() {
});
});
add_task(function* panel_shown_for_once_for_doubleclick_on_new_bookmark_star_and_autocloses() {
add_task(function* panel_shown_once_for_doubleclick_on_new_bookmark_star_and_autocloses() {
yield test_bookmarks_popup({
isNewBookmark: true,
popupShowFn() {

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

@ -714,11 +714,10 @@ function checkState(actualState, expectedInputVal, expectedSuggestions,
var gMsgMan;
function promiseTab() {
function* promiseTab() {
let deferred = Promise.defer();
let tab = gBrowser.addTab();
registerCleanupFunction(() => gBrowser.removeTab(tab));
gBrowser.selectedTab = tab;
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
registerCleanupFunction(() => BrowserTestUtils.removeTab(tab));
let pageURL = getRootDirectory(gTestPath) + TEST_PAGE_BASENAME;
tab.linkedBrowser.addEventListener("load", function onLoad(event) {
tab.linkedBrowser.removeEventListener("load", onLoad, true);

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

@ -1,18 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const STATE_CHANGED_TOPIC = "fxa-migration:state-changed";
const NOTIFICATION_TITLE = "fxa-migration";
var imports = {};
Cu.import("resource://services-sync/FxaMigrator.jsm", imports);
add_task(function* test() {
// Fake the state where we saw an EOL notification.
Services.obs.notifyObservers(null, STATE_CHANGED_TOPIC, null);
let notificationBox = document.getElementById("global-notificationbox");
Assert.ok(notificationBox.allNotifications.some(n => {
return n.getAttribute("value") == NOTIFICATION_TITLE;
}), "Disconnect notification should be present");
});

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

@ -16,9 +16,9 @@ const TEST_ROOT = "http://example.com/browser/browser/base/content/test/general/
// The stub functions.
let stubs = {
updateAppMenuItem() {
return unstubs["updateAppMenuItem"].call(gFxAccounts).then(() => {
Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateAppMenuItem", null);
updateUI() {
return unstubs["updateUI"].call(gFxAccounts).then(() => {
Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateUI", null);
});
},
// Opening preferences is trickier than it should be as leaks are reported
@ -72,7 +72,7 @@ var panelUIFooter = document.getElementById("PanelUI-footer-fxa");
add_task(function* test_nouser() {
let user = yield fxAccounts.getSignedInUser();
Assert.strictEqual(user, null, "start with no user signed in");
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem");
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI");
Services.obs.notifyObservers(null, this.FxAccountsCommon.ONLOGOUT_NOTIFICATION, null);
yield promiseUpdateDone;
@ -93,7 +93,7 @@ add_task(function* test_nouser() {
XXX - Bug 1191162 - need a better hawk mock story or this will leak in debug builds.
add_task(function* test_unverifiedUser() {
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem");
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI");
yield setSignedInUser(false); // this will fire the observer that does the update.
yield promiseUpdateDone;
@ -112,10 +112,10 @@ add_task(function* test_unverifiedUser() {
*/
add_task(function* test_verifiedUserEmptyProfile() {
// We see 2 updateAppMenuItem() calls - one for the signedInUser and one after
// We see 2 updateUI() calls - one for the signedInUser and one after
// we first fetch the profile. We want them both to fire or we aren't testing
// the state we think we are testing.
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 2);
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI", 2);
configureProfileURL({}); // successful but empty profile.
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
@ -134,7 +134,7 @@ add_task(function* test_verifiedUserEmptyProfile() {
});
add_task(function* test_verifiedUserDisplayName() {
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 2);
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI", 2);
configureProfileURL({ displayName: "Test User Display Name" });
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
@ -149,7 +149,7 @@ add_task(function* test_verifiedUserDisplayName() {
add_task(function* test_verifiedUserProfileFailure() {
// profile failure means only one observer fires.
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 1);
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI", 1);
configureProfileURL(null, 500);
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
@ -240,7 +240,7 @@ var signOut = Task.async(function* () {
// This test needs to make sure that any updates for the logout have
// completed before starting the next test, or we see the observer
// notifications get out of sync.
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem");
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateUI");
// we always want a "localOnly" signout here...
yield fxAccounts.signOut(true);
yield promiseUpdateDone;

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

@ -6,11 +6,16 @@
Cu.import("resource:///modules/SitePermissions.jsm", this);
Cu.import("resource:///modules/E10SUtils.jsm");
const SUBFRAME_PAGE = "https://example.com/browser/browser/base/content/test/general/temporary_permissions_subframe.html";
const ORIGIN = "https://example.com";
const PERMISSIONS_PAGE = getRootDirectory(gTestPath).replace("chrome://mochitests/content", ORIGIN) + "permissions.html"
const SUBFRAME_PAGE = getRootDirectory(gTestPath).replace("chrome://mochitests/content", ORIGIN) + "temporary_permissions_subframe.html"
const EXPIRE_TIME_MS = 100;
const TIMEOUT_MS = 500;
// Test that setting temp permissions triggers a change in the identity block.
add_task(function* testTempPermissionChangeEvents() {
let uri = NetUtil.newURI("https://example.com");
let uri = NetUtil.newURI(ORIGIN);
let id = "geo";
yield BrowserTestUtils.withNewTab(uri.spec, function*(browser) {
@ -31,9 +36,61 @@ add_task(function* testTempPermissionChangeEvents() {
});
});
// Test that temporary permissions can be re-requested after they expired
// and that the identity block is updated accordingly.
// TODO (blocked by bug 1334421): Write a check for webrtc permissions,
// because they use a different code path.
add_task(function* testTempPermissionRequestAfterExpiry() {
yield SpecialPowers.pushPrefEnv({set: [
["privacy.temporary_permission_expire_time_ms", EXPIRE_TIME_MS],
]});
let uri = NetUtil.newURI(ORIGIN);
let id = "geo";
yield BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, function*(browser) {
let blockedIcon = gIdentityHandler._identityBox
.querySelector(`.blocked-permission-icon[data-permission-id='${id}']`);
SitePermissions.set(uri, id, SitePermissions.BLOCK, SitePermissions.SCOPE_TEMPORARY, browser);
Assert.deepEqual(SitePermissions.get(uri, id, browser), {
state: SitePermissions.BLOCK,
scope: SitePermissions.SCOPE_TEMPORARY,
});
ok(blockedIcon.hasAttribute("showing"), "blocked permission icon is shown");
yield new Promise((c) => setTimeout(c, TIMEOUT_MS));
Assert.deepEqual(SitePermissions.get(uri, id, browser), {
state: SitePermissions.UNKNOWN,
scope: SitePermissions.SCOPE_PERSISTENT,
});
let popupshown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
// Request a permission;
yield BrowserTestUtils.synthesizeMouseAtCenter(`#${id}`, {}, browser);
yield popupshown;
ok(!blockedIcon.hasAttribute("showing"), "blocked permission icon is not shown");
let popuphidden = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popuphidden");
let notification = PopupNotifications.panel.firstChild;
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
yield popuphidden;
SitePermissions.remove(uri, id, browser);
});
});
// Test that temp blocked permissions requested by subframes (with a different URI) affect the whole page.
add_task(function* testTempPermissionSubframes() {
let uri = NetUtil.newURI("https://example.com");
let uri = NetUtil.newURI(ORIGIN);
let id = "geo";
yield BrowserTestUtils.withNewTab(SUBFRAME_PAGE, function*(browser) {

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

@ -0,0 +1,7 @@
[DEFAULT]
support-files =
head.js
[browser_identityBlock_focus.js]
skip-if = os == 'mac' # Bug 1334418 (try only)
support-files = ../general/permissions.html

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

@ -0,0 +1,62 @@
/* Tests that the identity block can be reached via keyboard
* shortcuts and that it has the correct tab order.
*/
const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
const PERMISSIONS_PAGE = TEST_PATH + "permissions.html";
function synthesizeKeyAndWaitForFocus(element, keyCode, options) {
let focused = BrowserTestUtils.waitForEvent(element, "focus");
EventUtils.synthesizeKey(keyCode, options);
return focused;
}
// Checks that the identity block is the next element after the urlbar
// to be focused if there are no active notification anchors.
add_task(function* testWithoutNotifications() {
yield BrowserTestUtils.withNewTab("https://example.com", function*() {
yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
yield synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true})
is(document.activeElement, gIdentityHandler._identityBox,
"identity block should be focused");
});
});
// Checks that when there is a notification anchor, it will receive
// focus before the identity block.
add_task(function* testWithoutNotifications() {
yield BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, function*(browser) {
let popupshown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
// Request a permission;
BrowserTestUtils.synthesizeMouseAtCenter("#geo", {}, browser);
yield popupshown;
yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
let geoIcon = document.getElementById("geo-notification-icon");
yield synthesizeKeyAndWaitForFocus(geoIcon, "VK_TAB", {shiftKey: true})
is(document.activeElement, geoIcon, "notification anchor should be focused");
yield synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true})
is(document.activeElement, gIdentityHandler._identityBox,
"identity block should be focused");
});
});
// Checks that with invalid pageproxystate the identity block is ignored.
add_task(function* testInvalidPageProxyState() {
yield BrowserTestUtils.withNewTab("about:blank", function*(browser) {
// Loading about:blank will automatically focus the urlbar, which, however, can
// race with the test code. So we only send the shortcut if the urlbar isn't focused yet.
if (document.activeElement != gURLBar.inputField) {
yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
}
is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
yield synthesizeKeyAndWaitForFocus(gBrowser.getTabForBrowser(browser), "VK_TAB", {shiftKey: true})
isnot(document.activeElement, gIdentityHandler._identityBox,
"identity block should not be focused");
// Restore focus to the url bar.
gURLBar.focus();
});
});

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

@ -0,0 +1,6 @@
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");

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

@ -139,17 +139,6 @@ browser.jar:
content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js)
content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css)
content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml)
content/browser/sync/setup.xul (content/sync/setup.xul)
content/browser/sync/addDevice.js (content/sync/addDevice.js)
content/browser/sync/addDevice.xul (content/sync/addDevice.xul)
content/browser/sync/setup.js (content/sync/setup.js)
content/browser/sync/genericChange.xul (content/sync/genericChange.xul)
content/browser/sync/genericChange.js (content/sync/genericChange.js)
content/browser/sync/key.xhtml (content/sync/key.xhtml)
content/browser/sync/utils.js (content/sync/utils.js)
* content/browser/sync/customize.xul (content/sync/customize.xul)
content/browser/sync/customize.js (content/sync/customize.js)
content/browser/sync/customize.css (content/sync/customize.css)
content/browser/safeMode.css (content/safeMode.css)
content/browser/safeMode.js (content/safeMode.js)
content/browser/safeMode.xul (content/safeMode.xul)

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

@ -22,6 +22,7 @@ BROWSER_CHROME_MANIFESTS += [
'content/test/plugins/browser.ini',
'content/test/popupNotifications/browser.ini',
'content/test/referrer/browser.ini',
'content/test/siteIdentity/browser.ini',
'content/test/social/browser.ini',
'content/test/tabcrashed/browser.ini',
'content/test/tabPrompts/browser.ini',

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

@ -138,7 +138,7 @@
<hbox pack="center">
<toolbarbutton class="PanelUI-remotetabs-prefs-button"
label="&appMenuRemoteTabs.openprefs.label;"
oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/>
oncommand="gSyncUI.openPrefs('synced-tabs');"/>
</hbox>
</vbox>
</hbox>
@ -172,7 +172,7 @@
<label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label>
<toolbarbutton class="PanelUI-remotetabs-prefs-button"
label="&appMenuRemoteTabs.signin.label;"
oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/>
oncommand="gSyncUI.openPrefs('synced-tabs');"/>
</vbox>
<!-- When Sync needs re-authentication. This uses the exact same messaging
as "Sync is not configured" but remains a separate box so we get
@ -186,7 +186,7 @@
<label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label>
<toolbarbutton class="PanelUI-remotetabs-prefs-button"
label="&appMenuRemoteTabs.signin.label;"
oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/>
oncommand="gSyncUI.openPrefs('synced-tabs');"/>
</vbox>
</hbox>
</vbox>

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

@ -55,11 +55,6 @@ let headers = {
};
add_task(function* setup() {
// SelfSupport has a tendency to fire when running this test alone, without
// a good way to turn it off we just set the url to ""
yield SpecialPowers.pushPrefEnv({
set: [["browser.selfsupport.url", ""]],
});
extension = makeExtension();
yield extension.startup();
});

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

@ -235,7 +235,6 @@ let NewTabMessages = {
}
}
PlacesProvider.links.uninit();
NewTabPrefsProvider.prefs.uninit();
NewTabSearchProvider.search.uninit();
NewTabWebChannel.uninit();

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

@ -94,7 +94,7 @@ Links.prototype = {
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver,
Ci.nsISupportsWeakReference])
Ci.nsISupportsWeakReference])
},
/**
@ -109,17 +109,6 @@ Links.prototype = {
}
},
/**
* Must be called before the provider is unloaded.
*/
uninit: function PlacesProvider_uninit() {
try {
PlacesUtils.history.removeObserver(this.historyObserver);
} catch (e) {
Cu.reportError(e);
}
},
/**
* Gets the current set of links delivered by this provider.
*

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

@ -27,6 +27,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
do_get_profile();
function run_test() {
PlacesProvider.links.init();
run_next_test();
}
@ -138,7 +139,6 @@ add_task(function* test_Links_getLinks_Deduplication() {
add_task(function* test_Links_onLinkChanged() {
let provider = PlacesProvider.links;
provider.init();
let url = "https://example.com/onFrecencyChanged1";
let linkChangedMsgCount = 0;
@ -169,12 +169,10 @@ add_task(function* test_Links_onLinkChanged() {
yield linkChangedPromise;
yield PlacesTestUtils.clearHistory();
provider.uninit();
});
add_task(function* test_Links_onClearHistory() {
let provider = PlacesProvider.links;
provider.init();
let clearHistoryPromise = new Promise(resolve => {
let handler = () => {
@ -193,12 +191,10 @@ add_task(function* test_Links_onClearHistory() {
}
yield PlacesTestUtils.clearHistory();
yield clearHistoryPromise;
provider.uninit();
});
add_task(function* test_Links_onDeleteURI() {
let provider = PlacesProvider.links;
provider.init();
let testURL = "https://example.com/toDelete";
@ -216,12 +212,10 @@ add_task(function* test_Links_onDeleteURI() {
yield PlacesTestUtils.addVisits(testURI);
yield PlacesUtils.history.remove(testURL);
yield deleteURIPromise;
provider.uninit();
});
add_task(function* test_Links_onManyLinksChanged() {
let provider = PlacesProvider.links;
provider.init();
let promise = new Promise(resolve => {
let handler = () => {
@ -242,7 +236,6 @@ add_task(function* test_Links_onManyLinksChanged() {
observe(null, "idle-daily", "");
yield promise;
provider.uninit();
});
add_task(function* test_Links_execute_query() {

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

@ -281,14 +281,6 @@ BrowserGlue.prototype = {
Services.obs.removeObserver(this, "places-database-locked");
this._isPlacesLockedObserver = false;
break;
case "places-shutdown":
if (this._isPlacesShutdownObserver) {
Services.obs.removeObserver(this, "places-shutdown");
this._isPlacesShutdownObserver = false;
}
// places-shutdown is fired when the profile is about to disappear.
this._onPlacesShutdown();
break;
case "idle":
this._backupBookmarks();
break;
@ -419,8 +411,6 @@ BrowserGlue.prototype = {
os.addObserver(this, "places-database-locked", false);
this._isPlacesLockedObserver = true;
os.addObserver(this, "distribution-customization-complete", false);
os.addObserver(this, "places-shutdown", false);
this._isPlacesShutdownObserver = true;
os.addObserver(this, "handle-xul-text-link", false);
os.addObserver(this, "profile-before-change", false);
if (AppConstants.MOZ_TELEMETRY_REPORTING) {
@ -474,8 +464,6 @@ BrowserGlue.prototype = {
os.removeObserver(this, "places-init-complete");
if (this._isPlacesLockedObserver)
os.removeObserver(this, "places-database-locked");
if (this._isPlacesShutdownObserver)
os.removeObserver(this, "places-shutdown");
os.removeObserver(this, "handle-xul-text-link");
os.removeObserver(this, "profile-before-change");
if (AppConstants.MOZ_TELEMETRY_REPORTING) {
@ -1004,8 +992,14 @@ BrowserGlue.prototype = {
Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
}
if (this._bookmarksBackupIdleTime) {
this._idleService.removeIdleObserver(this, this._bookmarksBackupIdleTime);
delete this._bookmarksBackupIdleTime;
}
BrowserUsageTelemetry.uninit();
SelfSupportBackend.uninit();
PageThumbs.uninit();
NewTabMessages.uninit();
AboutNewTab.uninit();
webrtcUI.uninit();
@ -1622,20 +1616,6 @@ BrowserGlue.prototype = {
});
},
/**
* Places shut-down tasks
* - finalize components depending on Places.
* - export bookmarks as HTML, if so configured.
*/
_onPlacesShutdown: function BG__onPlacesShutdown() {
PageThumbs.uninit();
if (this._bookmarksBackupIdleTime) {
this._idleService.removeIdleObserver(this, this._bookmarksBackupIdleTime);
delete this._bookmarksBackupIdleTime;
}
},
/**
* If a backup for today doesn't exist, this creates one.
*/

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

@ -12,11 +12,8 @@ XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() {
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
"resource://gre/modules/FxAccounts.jsm");
const PAGE_NO_ACCOUNT = 0;
const PAGE_HAS_ACCOUNT = 1;
const PAGE_NEEDS_UPDATE = 2;
const FXA_PAGE_LOGGED_OUT = 3;
const FXA_PAGE_LOGGED_IN = 4;
const FXA_PAGE_LOGGED_OUT = 0;
const FXA_PAGE_LOGGED_IN = 1;
// Indexes into the "login status" deck.
// We are in a successful verified state - everything should work!
@ -38,17 +35,6 @@ var gSyncPane = {
document.getElementById("weavePrefsDeck").selectedIndex = val;
},
get _usingCustomServer() {
return Weave.Svc.Prefs.isSet("serverURL");
},
needsUpdate() {
this.page = PAGE_NEEDS_UPDATE;
let label = document.getElementById("loginError");
label.textContent = Weave.Utils.getErrorString(Weave.Status.login);
label.className = "error";
},
init() {
this._setupEventListeners();
@ -92,20 +78,19 @@ var gSyncPane = {
} catch (e) {}
if (!username) {
this.page = FXA_PAGE_LOGGED_OUT;
} else if (xps.fxAccountsEnabled) {
// Use cached values while we wait for the up-to-date values
let cachedComputerName;
try {
cachedComputerName = Services.prefs.getCharPref("services.sync.client.name");
} catch (e) {
cachedComputerName = "";
}
document.getElementById("fxaEmailAddress1").textContent = username;
this._populateComputerName(cachedComputerName);
this.page = FXA_PAGE_LOGGED_IN;
} else { // Old Sync
this.page = PAGE_HAS_ACCOUNT;
return;
}
// Use cached values while we wait for the up-to-date values
let cachedComputerName;
try {
cachedComputerName = Services.prefs.getCharPref("services.sync.client.name");
} catch (e) {
cachedComputerName = "";
}
document.getElementById("fxaEmailAddress1").textContent = username;
this._populateComputerName(cachedComputerName);
this.page = FXA_PAGE_LOGGED_IN;
},
_init() {
@ -131,10 +116,6 @@ var gSyncPane = {
}, gSyncPane);
});
XPCOMUtils.defineLazyGetter(this, "_stringBundle", () => {
return Services.strings.createBundle("chrome://browser/locale/preferences/preferences.properties");
});
XPCOMUtils.defineLazyGetter(this, "_accountsStringBundle", () => {
return Services.strings.createBundle("chrome://browser/locale/accounts.properties");
});
@ -146,10 +127,8 @@ var gSyncPane = {
document.getElementById("fxaMobilePromo-ios").setAttribute("href", url);
document.getElementById("fxaMobilePromo-ios-hasFxaAccount").setAttribute("href", url);
document.getElementById("tosPP-small-ToS").setAttribute("href", gSyncUtils.tosURL);
document.getElementById("tosPP-normal-ToS").setAttribute("href", gSyncUtils.tosURL);
document.getElementById("tosPP-small-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
document.getElementById("tosPP-normal-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
document.getElementById("tosPP-small-ToS").setAttribute("href", Weave.Svc.Prefs.get("fxa.termsURL"));
document.getElementById("tosPP-small-PP").setAttribute("href", Weave.Svc.Prefs.get("fxa.privacyURL"));
fxAccounts.promiseAccountsManageURI(this._getEntryPoint()).then(accountsManageURI => {
document.getElementById("verifiedManage").setAttribute("href", accountsManageURI);
@ -200,30 +179,6 @@ var gSyncPane = {
.addEventListener(aEventType, aCallback.bind(gSyncPane));
}
setEventListener("noAccountSetup", "click", function(aEvent) {
aEvent.stopPropagation();
gSyncPane.openSetup(null);
});
setEventListener("noAccountPair", "click", function(aEvent) {
aEvent.stopPropagation();
gSyncPane.openSetup("pair");
});
setEventListener("syncChangePassword", "command",
() => gSyncUtils.changePassword());
setEventListener("syncResetPassphrase", "command",
() => gSyncUtils.resetPassphrase());
setEventListener("syncReset", "command", gSyncPane.resetSync);
setEventListener("syncAddDeviceLabel", "click", function() {
gSyncPane.openAddDevice();
return false;
});
setEventListener("syncEnginesList", "select", function() {
if (this.selectedCount)
this.clearSelection();
});
setEventListener("syncComputerName", "change", function(e) {
gSyncUtils.changeName(e.target);
});
setEventListener("fxaChangeDeviceName", "command", function() {
this._toggleComputerNameControls(true);
this._focusComputerNameTextbox();
@ -245,22 +200,6 @@ var gSyncPane = {
this._updateComputerNameValue(true);
this._focusAfterComputerNameTextbox();
});
setEventListener("unlinkDevice", "click", function() {
gSyncPane.startOver(true);
return false;
});
setEventListener("loginErrorUpdatePass", "click", function() {
gSyncPane.updatePass();
return false;
});
setEventListener("loginErrorResetPass", "click", function() {
gSyncPane.resetPass();
return false;
});
setEventListener("loginErrorStartOver", "click", function() {
gSyncPane.startOver(true);
return false;
});
setEventListener("noFxaSignUp", "command", function() {
gSyncPane.signUp();
return false;
@ -304,161 +243,104 @@ var gSyncPane = {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
// service.fxAccountsEnabled is false iff sync is already configured for
// the legacy provider.
if (service.fxAccountsEnabled) {
let displayNameLabel = document.getElementById("fxaDisplayName");
let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
fxaEmailAddress1Label.hidden = false;
displayNameLabel.hidden = true;
let profileInfoEnabled;
try {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
} catch (ex) {}
let displayNameLabel = document.getElementById("fxaDisplayName");
let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
fxaEmailAddress1Label.hidden = false;
displayNameLabel.hidden = true;
// determine the fxa status...
this._showLoadPage(service);
let profileInfoEnabled;
try {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
} catch (ex) {}
fxAccounts.getSignedInUser().then(data => {
if (!data) {
this.page = FXA_PAGE_LOGGED_OUT;
return false;
}
this.page = FXA_PAGE_LOGGED_IN;
// We are logged in locally, but maybe we are in a state where the
// server rejected our credentials (eg, password changed on the server)
let fxaLoginStatus = document.getElementById("fxaLoginStatus");
let syncReady;
// Not Verfied implies login error state, so check that first.
if (!data.verified) {
fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
syncReady = false;
// So we think we are logged in, so login problems are next.
// (Although if the Sync identity manager is still initializing, we
// ignore login errors and assume all will eventually be good.)
// LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
// All other login failures are assumed to be transient and should go
// away by themselves, so aren't reflected here.
} else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
syncReady = false;
// Else we must be golden (or in an error state we expect to magically
// resolve itself)
} else {
fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
syncReady = true;
}
fxaEmailAddress1Label.textContent = data.email;
document.getElementById("fxaEmailAddress2").textContent = data.email;
document.getElementById("fxaEmailAddress3").textContent = data.email;
this._populateComputerName(Weave.Service.clientsEngine.localName);
let engines = document.getElementById("fxaSyncEngines")
for (let checkbox of engines.querySelectorAll("checkbox")) {
checkbox.disabled = !syncReady;
}
document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
// determine the fxa status...
this._showLoadPage(service);
// Clear the profile image (if any) of the previously logged in account.
document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
fxAccounts.getSignedInUser().then(data => {
if (!data) {
this.page = FXA_PAGE_LOGGED_OUT;
return false;
}
this.page = FXA_PAGE_LOGGED_IN;
// We are logged in locally, but maybe we are in a state where the
// server rejected our credentials (eg, password changed on the server)
let fxaLoginStatus = document.getElementById("fxaLoginStatus");
let syncReady;
// Not Verfied implies login error state, so check that first.
if (!data.verified) {
fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
syncReady = false;
// So we think we are logged in, so login problems are next.
// (Although if the Sync identity manager is still initializing, we
// ignore login errors and assume all will eventually be good.)
// LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
// All other login failures are assumed to be transient and should go
// away by themselves, so aren't reflected here.
} else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
syncReady = false;
// Else we must be golden (or in an error state we expect to magically
// resolve itself)
} else {
fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
syncReady = true;
}
fxaEmailAddress1Label.textContent = data.email;
document.getElementById("fxaEmailAddress2").textContent = data.email;
document.getElementById("fxaEmailAddress3").textContent = data.email;
this._populateComputerName(Weave.Service.clientsEngine.localName);
let engines = document.getElementById("fxaSyncEngines")
for (let checkbox of engines.querySelectorAll("checkbox")) {
checkbox.disabled = !syncReady;
}
document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
// If the account is verified the next promise in the chain will
// fetch profile data.
return data.verified;
}).then(isVerified => {
if (isVerified) {
return fxAccounts.getSignedInUserProfile();
}
return null;
}).then(data => {
let fxaLoginStatus = document.getElementById("fxaLoginStatus");
if (data && profileInfoEnabled) {
if (data.displayName) {
fxaLoginStatus.setAttribute("hasName", true);
displayNameLabel.hidden = false;
displayNameLabel.textContent = data.displayName;
} else {
fxaLoginStatus.removeAttribute("hasName");
}
if (data.avatar) {
let bgImage = "url(\"" + data.avatar + "\")";
let profileImageElement = document.getElementById("fxaProfileImage");
profileImageElement.style.listStyleImage = bgImage;
// Clear the profile image (if any) of the previously logged in account.
document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
let img = new Image();
img.onerror = () => {
// Clear the image if it has trouble loading. Since this callback is asynchronous
// we check to make sure the image is still the same before we clear it.
if (profileImageElement.style.listStyleImage === bgImage) {
profileImageElement.style.removeProperty("list-style-image");
}
};
img.src = data.avatar;
}
// If the account is verified the next promise in the chain will
// fetch profile data.
return data.verified;
}).then(isVerified => {
if (isVerified) {
return fxAccounts.getSignedInUserProfile();
}
return null;
}).then(data => {
let fxaLoginStatus = document.getElementById("fxaLoginStatus");
if (data && profileInfoEnabled) {
if (data.displayName) {
fxaLoginStatus.setAttribute("hasName", true);
displayNameLabel.hidden = false;
displayNameLabel.textContent = data.displayName;
} else {
fxaLoginStatus.removeAttribute("hasName");
}
}, err => {
FxAccountsCommon.log.error(err);
}).catch(err => {
// If we get here something's really busted
Cu.reportError(String(err));
});
if (data.avatar) {
let bgImage = "url(\"" + data.avatar + "\")";
let profileImageElement = document.getElementById("fxaProfileImage");
profileImageElement.style.listStyleImage = bgImage;
// If fxAccountEnabled is false and we are in a "not configured" state,
// then fxAccounts is probably fully disabled rather than just unconfigured,
// so handle this case. This block can be removed once we remove support
// for fxAccounts being disabled.
} else if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
this.page = PAGE_NO_ACCOUNT;
// else: sync was previously configured for the legacy provider, so we
// make the "old" panels available.
} else if (Weave.Status.login == Weave.LOGIN_FAILED_INVALID_PASSPHRASE ||
Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
this.needsUpdate();
} else {
this.page = PAGE_HAS_ACCOUNT;
document.getElementById("accountName").textContent = Weave.Service.identity.account;
document.getElementById("syncComputerName").value = Weave.Service.clientsEngine.localName;
document.getElementById("tosPP-normal").hidden = this._usingCustomServer;
}
},
startOver(showDialog) {
if (showDialog) {
let flags = Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING +
Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL +
Services.prompt.BUTTON_POS_1_DEFAULT;
let buttonChoice =
Services.prompt.confirmEx(window,
this._stringBundle.GetStringFromName("syncUnlink.title"),
this._stringBundle.GetStringFromName("syncUnlink.label"),
flags,
this._stringBundle.GetStringFromName("syncUnlinkConfirm.label"),
null, null, null, {});
// If the user selects cancel, just bail
if (buttonChoice == 1)
return;
}
Weave.Service.startOver();
this.updateWeavePrefs();
},
updatePass() {
if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED)
gSyncUtils.changePassword();
else
gSyncUtils.updatePassphrase();
},
resetPass() {
if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED)
gSyncUtils.resetPassword();
else
gSyncUtils.resetPassphrase();
let img = new Image();
img.onerror = () => {
// Clear the image if it has trouble loading. Since this callback is asynchronous
// we check to make sure the image is still the same before we clear it.
if (profileImageElement.style.listStyleImage === bgImage) {
profileImageElement.style.removeProperty("list-style-image");
}
};
img.src = data.avatar;
}
} else {
fxaLoginStatus.removeAttribute("hasName");
}
}, err => {
FxAccountsCommon.log.error(err);
}).catch(err => {
// If we get here something's really busted
Cu.reportError(String(err));
});
},
_getEntryPoint() {
@ -477,41 +359,10 @@ var gSyncPane = {
this.replaceTabWithUrl("about:accounts?" + params);
},
/**
* Invoke the Sync setup wizard.
*
* @param wizardType
* Indicates type of wizard to launch:
* null -- regular set up wizard
* "pair" -- pair a device first
* "reset" -- reset sync
*/
openSetup(wizardType) {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
if (service.fxAccountsEnabled) {
this._openAboutAccounts();
} else {
let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
if (win)
win.focus();
else {
window.openDialog("chrome://browser/content/sync/setup.xul",
"weaveSetup", "centerscreen,chrome,resizable=no",
wizardType);
}
}
},
openContentInBrowser(url, options) {
let win = Services.wm.getMostRecentWindow("navigator:browser");
if (!win) {
// no window to use, so use _openLink to create a new one. We don't
// always use that as it prefers to open a new window rather than use
// an existing one.
gSyncUtils._openLink(url);
openUILinkIn(url, "tab");
return;
}
win.switchToTabHavingURI(url, true, options);
@ -607,11 +458,6 @@ var gSyncPane = {
.then(onSuccess, onError);
},
openOldSyncSupportPage() {
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync";
this.openContentInBrowser(url);
},
unlinkFirefoxAccount(confirm) {
if (confirm) {
// We use a string bundle shared with aboutAccounts.
@ -644,22 +490,6 @@ var gSyncPane = {
});
},
openAddDevice() {
if (!Weave.Utils.ensureMPUnlocked())
return;
let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
if (win)
win.focus();
else
window.openDialog("chrome://browser/content/sync/addDevice.xul",
"syncAddDevice", "centerscreen,chrome,resizable=no");
},
resetSync() {
this.openSetup("reset");
},
_populateComputerName(value) {
let textbox = document.getElementById("fxaSyncComputerName");
if (!textbox.hasAttribute("placeholder")) {

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

@ -27,8 +27,6 @@
<script type="application/javascript"
src="chrome://browser/content/preferences/in-content/sync.js"/>
<script type="application/javascript"
src="chrome://browser/content/sync/utils.js"/>
<hbox id="header-sync"
class="header"
@ -39,138 +37,6 @@
</hbox>
<deck id="weavePrefsDeck" data-category="paneSync" hidden="true">
<!-- These panels are for the "legacy" sync provider -->
<vbox id="noAccount" align="center">
<spacer flex="1"/>
<description id="syncDesc">
&weaveDesc.label;
</description>
<separator/>
<label id="noAccountSetup" class="text-link">
&setupButton.label;
</label>
<vbox id="pairDevice">
<separator/>
<label id="noAccountPair" class="text-link">
&pairDevice.label;
</label>
</vbox>
<spacer flex="3"/>
</vbox>
<vbox id="hasAccount">
<groupbox class="syncGroupBox">
<!-- label is set to account name -->
<caption id="accountCaption" align="center">
<image id="accountCaptionImage"/>
<label id="accountName"/>
</caption>
<hbox>
<button type="menu"
label="&manageAccount.label;"
accesskey="&manageAccount.accesskey;">
<menupopup>
<menuitem id="syncChangePassword" label="&changePassword2.label;"/>
<menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/>
<menuseparator/>
<menuitem id="syncReset" label="&resetSync2.label;"/>
</menupopup>
</button>
</hbox>
<hbox>
<label id="syncAddDeviceLabel"
class="text-link">
&pairDevice.label;
</label>
</hbox>
<vbox>
<label>&syncMy.label;</label>
<richlistbox id="syncEnginesList"
orient="vertical">
<richlistitem>
<checkbox label="&engine.addons.label;"
accesskey="&engine.addons.accesskey;"
preference="engine.addons"/>
</richlistitem>
<richlistitem>
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
</richlistitem>
<richlistitem>
<checkbox label="&engine.passwords.label;"
accesskey="&engine.passwords.accesskey;"
preference="engine.passwords"/>
</richlistitem>
<richlistitem>
<checkbox label="&engine.prefs.label;"
accesskey="&engine.prefs.accesskey;"
preference="engine.prefs"/>
</richlistitem>
<richlistitem>
<checkbox label="&engine.history.label;"
accesskey="&engine.history.accesskey;"
preference="engine.history"/>
</richlistitem>
<richlistitem>
<checkbox label="&engine.tabs.label2;"
accesskey="&engine.tabs.accesskey;"
preference="engine.tabs"/>
</richlistitem>
</richlistbox>
</vbox>
</groupbox>
<groupbox class="syncGroupBox">
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label control="syncComputerName">
&syncDeviceName.label;
</label>
<textbox id="syncComputerName"/>
</row>
</rows>
</grid>
<hbox>
<label id="unlinkDevice" class="text-link">
&unlinkDevice.label;
</label>
</hbox>
</groupbox>
<vbox id="tosPP-normal">
<label id="tosPP-normal-ToS" class="text-link">
&prefs.tosLink.label;
</label>
<label id="tosPP-normal-PP" class="text-link">
&prefs.ppLink.label;
</label>
</vbox>
</vbox>
<vbox id="needsUpdate" align="center" pack="center">
<hbox>
<label id="loginError"/>
<label id="loginErrorUpdatePass" class="text-link">
&updatePass.label;
</label>
<label id="loginErrorResetPass" class="text-link">
&resetPass.label;
</label>
</hbox>
<label id="loginErrorStartOver" class="text-link">
&unlinkDevice.label;
</label>
</vbox>
<!-- These panels are for the Firefox Accounts identity provider -->
<vbox id="noFxaAccount">
<hbox>
<vbox id="fxaContentWrapper">

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

@ -166,7 +166,7 @@ SyncedTabsDeckComponent.prototype = {
},
openSyncPrefs() {
this._getChromeWindow(this._window).gSyncUI.openSetup(null, "tabs-sidebar");
this._getChromeWindow(this._window).gSyncUI.openPrefs("tabs-sidebar");
}
};

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

@ -212,11 +212,11 @@ add_task(function* testActions() {
};
let chromeWindowMock = {
gSyncUI: {
openSetup() {}
openPrefs() {}
}
};
sinon.spy(windowMock, "openUILink");
sinon.spy(chromeWindowMock.gSyncUI, "openSetup");
sinon.spy(chromeWindowMock.gSyncUI, "openPrefs");
let getChromeWindowMock = sinon.stub();
getChromeWindowMock.returns(chromeWindowMock);
@ -236,5 +236,5 @@ add_task(function* testActions() {
component.openSyncPrefs();
Assert.ok(getChromeWindowMock.calledWith(windowMock));
Assert.ok(chromeWindowMock.gSyncUI.openSetup.called);
Assert.ok(chromeWindowMock.gSyncUI.openPrefs.called);
});

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

@ -8,7 +8,7 @@ support-files =
[browser_backgroundTab.js]
[browser_closeTab.js]
[browser_fxa.js]
skip-if = debug || asan # updateAppMenuItem leaks
skip-if = debug || asan # updateUI leaks
[browser_no_tabs.js]
[browser_openPreferences.js]
[browser_openSearchPanel.js]

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

@ -18,7 +18,7 @@ function test() {
registerCleanupFunction(function*() {
yield signOut();
gFxAccounts.updateAppMenuItem();
gFxAccounts.updateUI();
});
var tests = [
@ -35,7 +35,7 @@ var tests = [
yield setSignedInUser();
let userData = yield fxAccounts.getSignedInUser();
isnot(userData, null, "Logged in now");
gFxAccounts.updateAppMenuItem(); // Causes a leak
gFxAccounts.updateUI(); // Causes a leak (see bug 1332985)
yield showMenuPromise("appMenu");
yield showHighlightPromise("accountStatus");
let highlight = document.getElementById("UITourHighlightContainer");

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

@ -182,10 +182,12 @@ AutocompleteFactory.prototype = {
this._factory = factory;
let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(proto.classID, proto.classDescription,
proto.contractID, factory);
if (proto.classID && !registrar.isCIDRegistered(proto.classID)) {
registrar.registerFactory(proto.classID, proto.classDescription,
proto.contractID, factory);
}
if (proto.classID2) {
if (proto.classID2 && !registrar.isCIDRegistered(proto.classID2)) {
this._classID2 = proto.classID2;
registrar.registerFactory(proto.classID2, proto.classDescription,
proto.contractID2, factory);
@ -194,10 +196,14 @@ AutocompleteFactory.prototype = {
unregister() {
let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.unregisterFactory(this._classID, this._factory);
if (this._classID2) {
if (this._classID && registrar.isCIDRegistered(this._classID)) {
registrar.unregisterFactory(this._classID, this._factory);
}
if (this._classID2 && registrar.isCIDRegistered(this._classID2)) {
registrar.unregisterFactory(this._classID2, this._factory);
}
this._factory = null;
},
};

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

@ -6,7 +6,6 @@
<!ENTITY aboutAccountsConfig.description "Sign in to sync your tabs, bookmarks, passwords &amp; more.">
<!ENTITY aboutAccountsConfig.startButton.label "Get started">
<!ENTITY aboutAccountsConfig.useOldSync.label "Using an older version of Sync?">
<!ENTITY aboutAccountsConfig.syncPreferences.label "Sync preferences">
<!ENTITY aboutAccounts.noConnection.title "No connection">
<!ENTITY aboutAccounts.noConnection.description "You must be connected to the Internet to sign in.">

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

@ -2,14 +2,6 @@
# 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/.
# autoDisconnectDescription is shown in an info bar when we detect an old
# Sync is being used.
autoDisconnectDescription = Weve rebuilt Sync to make it easier for everyone.
# autoDisconnectSignIn.label and .accessKey are for buttons when we auto-disconnect
autoDisconnectSignIn.label = Sign in to Sync
autoDisconnectSignIn.accessKey = S
# LOCALIZATION NOTE (reconnectDescription) - %S = Email address of user's Firefox Account
reconnectDescription = Reconnect %S

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

@ -4,6 +4,7 @@
<!-- These strings are used in the about:newtab page -->
<!ENTITY newtab.pageTitle "New Tab">
<!ENTITY newtab.topSites.heading "Your Top Sites">
<!ENTITY newtab.customize.classic "Show your top sites">
<!ENTITY newtab.customize.cog.enhanced "Include suggested sites">
<!ENTITY newtab.customize.cog.title2 "NEW TAB CONTROLS">

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

@ -177,10 +177,6 @@ important=Important
default=Default
siteUsage=%1$S %2$S
syncUnlink.title=Do you want to unlink your device?
syncUnlink.label=This device will no longer be associated with your Sync account. All of your personal data, both on this device and in your Sync account, will remain intact.
syncUnlinkConfirm.label=Unlink
# LOCALIZATION NOTE (featureEnableRequiresRestart, featureDisableRequiresRestart, restartTitle): %S = brandShortName
featureEnableRequiresRestart=%S must restart to enable this feature.
featureDisableRequiresRestart=%S must restart to disable this feature.

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

@ -2,27 +2,8 @@
- 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/. -->
<!-- The page shown when not logged in... -->
<!ENTITY setupButton.label "Set Up &syncBrand.fullName.label;">
<!ENTITY setupButton.accesskey "S">
<!ENTITY weaveDesc.label "&syncBrand.fullName.label; lets you access your history, bookmarks, passwords and open tabs across all your devices.">
<!-- The page shown when logged in... -->
<!-- Login error feedback -->
<!ENTITY updatePass.label "Update">
<!ENTITY resetPass.label "Reset">
<!-- Manage Account -->
<!ENTITY manageAccount.label "Manage Account">
<!ENTITY manageAccount.accesskey "n">
<!ENTITY changePassword2.label "Change Password…">
<!ENTITY myRecoveryKey.label "My Recovery Key">
<!ENTITY resetSync2.label "Reset Sync…">
<!ENTITY pairDevice.label "Pair a Device">
<!ENTITY syncMy.label "Sync My">
<!ENTITY engine.bookmarks.label "Bookmarks">
<!ENTITY engine.bookmarks.accesskey "m">
<!ENTITY engine.tabs.label2 "Open Tabs">
@ -37,7 +18,6 @@
<!ENTITY engine.addons.accesskey "A">
<!-- Device Settings -->
<!ENTITY syncDeviceName.label "Device Name:">
<!ENTITY fxaSyncDeviceName.label "Device Name">
<!ENTITY changeSyncDeviceName.label "Change Device Name…">
<!ENTITY changeSyncDeviceName.accesskey "h">
@ -45,15 +25,10 @@
<!ENTITY cancelChangeSyncDeviceName.accesskey "n">
<!ENTITY saveChangeSyncDeviceName.label "Save">
<!ENTITY saveChangeSyncDeviceName.accesskey "v">
<!ENTITY unlinkDevice.label "Unlink This Device">
<!-- Footer stuff -->
<!ENTITY prefs.tosLink.label "Terms of Service">
<!ENTITY prefs.ppLink.label "Privacy Policy">
<!-- Firefox Accounts stuff -->
<!ENTITY fxaPrivacyNotice.link.label "Privacy Notice">
<!ENTITY determiningAcctStatus.label "Determining your account status…">
<!-- LOCALIZATION NOTE (signedInUnverified.beforename.label,
signedInUnverified.aftername.label): these two string are used respectively
@ -84,12 +59,6 @@ both, to better adapt this sentence to their language.
<!ENTITY forget.label "Forget this Email">
<!ENTITY forget.accesskey "F">
<!ENTITY welcome.description "Access your tabs, bookmarks, passwords and more wherever you use &brandShortName;.">
<!ENTITY welcome.signIn.label "Sign In">
<!ENTITY welcome.createAccount.label "Create Account">
<!ENTITY welcome.useOldSync.label "Using an older version of Sync?">
<!ENTITY signedOut.caption "Take Your Web With You">
<!ENTITY signedOut.description "Synchronize your bookmarks, history, tabs, passwords, add-ons, and preferences across all your devices.">
<!ENTITY signedOut.accountBox.title "Connect with a &syncBrand.fxAccount.label;">

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

@ -1,27 +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/. -->
<!ENTITY syncCustomize.dialog.title "Sync Selection">
<!ENTITY syncCustomize.acceptButton.label "Start">
<!ENTITY syncCustomize.title "What would you like to sync?">
<!ENTITY syncCustomize.description "You can change this selection in Options.">
<!ENTITY syncCustomizeUnix.description "You can change this selection in Preferences.">
<!--
These engine names are the same as in browser/preferences/sync.dtd except
for the last two that are marked as being specific to Desktop browsers.
-->
<!ENTITY engine.bookmarks.label "Bookmarks">
<!ENTITY engine.bookmarks.accesskey "m">
<!ENTITY engine.history.label "History">
<!ENTITY engine.history.accesskey "r">
<!ENTITY engine.tabs.label2 "Open Tabs">
<!ENTITY engine.tabs.accesskey "T">
<!ENTITY engine.passwords.label "Passwords">
<!ENTITY engine.passwords.accesskey "P">
<!ENTITY engine.addons.label "Desktop Add-ons">
<!ENTITY engine.addons.accesskey "A">
<!ENTITY engine.prefs.label "Desktop Preferences">
<!ENTITY engine.prefs.accesskey "S">

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

@ -1,37 +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/.
#LOCALIZATION NOTE (change.password.title): This (and associated change.password/passphrase) are used when the user elects to change their password.
change.password.title = Change your Password
change.password.acceptButton = Change Password
change.password.status.active = Changing your password…
change.password.status.success = Your password has been changed.
change.password.status.error = There was an error changing your password.
change.password3.introText = Your password must be at least 8 characters long. It cannot be the same as either your user name or your Recovery Key.
change.password.warningText = Note: All of your other devices will be unable to connect to your account once you change this password.
change.recoverykey.title = My Recovery Key
change.recoverykey.acceptButton = Change Recovery Key
change.recoverykey.label = Changing Recovery Key and uploading local data, please wait…
change.recoverykey.error = There was an error while changing your Recovery Key!
change.recoverykey.success = Your Recovery Key was successfully changed!
change.synckey.introText2 = To ensure your total privacy, all of your data is encrypted prior to being uploaded. The key to decrypt your data is not uploaded.
# LOCALIZATION NOTE (change.recoverykey.warningText) "Sync" should match &syncBrand.shortName.label; from syncBrand.dtd
change.recoverykey.warningText = Note: Changing this will erase all data stored on the Sync server and upload new data secured by this Recovery Key. Your other devices will not sync until the new Recovery Key is entered for that device.
new.recoverykey.label = Your Recovery Key
# LOCALIZATION NOTE (new.password.title): This (and associated new.password/passphrase) are used on a second computer when it detects that your password or passphrase has been changed on a different device.
new.password.title = Update Password
new.password.introText = Your password was rejected by the server, please update your password.
new.password.label = Enter your new password
new.password.confirm = Confirm your new password
new.password.acceptButton = Update Password
new.password.status.incorrect = Password incorrect, please try again.
new.recoverykey.title = Update Recovery Key
new.recoverykey.introText = Your Recovery Key was changed using another device, please enter your updated Recovery Key.
new.recoverykey.acceptButton = Update Recovery Key

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

@ -1,18 +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/. -->
<!ENTITY syncKey.page.title "Your &syncBrand.fullName.label; Key">
<!ENTITY syncKey.page.description2 "This key is used to decode the data in your &syncBrand.fullName.label; account. You will need to enter the key each time you configure &syncBrand.fullName.label; on a new device.">
<!ENTITY syncKey.keepItSecret.heading "Keep it secret">
<!ENTITY syncKey.keepItSecret.description "Your &syncBrand.fullName.label; account is encrypted to protect your privacy. Without this key, it would take years for anyone to decode your personal information. You are the only person who holds this key. This means youre the only one who can access your &syncBrand.fullName.label; data.">
<!ENTITY syncKey.keepItSafe.heading "Keep it safe">
<!ENTITY syncKey.keepItSafe1.description "Do not lose this key.">
<!ENTITY syncKey.keepItSafe2.description " We dont keep a copy of your key (that wouldnt be keeping it secret!) so ">
<!ENTITY syncKey.keepItSafe3.description "we cant help you recover it">
<!ENTITY syncKey.keepItSafe4a.description " if its lost. Youll need to use this key any time you connect a new device to &syncBrand.fullName.label;.">
<!ENTITY syncKey.findOutMore1.label "Find out more about &syncBrand.fullName.label; and your privacy at ">
<!ENTITY syncKey.findOutMore2.label ".">
<!ENTITY syncKey.footer1.label "&syncBrand.fullName.label; Terms of Service are available at ">
<!ENTITY syncKey.footer2.label ". The Privacy Policy is available at ">
<!ENTITY syncKey.footer3.label ".">

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

@ -1,8 +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/. -->
<!ENTITY quota.dialogTitle.label "Server Quota">
<!ENTITY quota.retrievingInfo.label "Retrieving quota information…">
<!ENTITY quota.typeColumn.label "Type">
<!ENTITY quota.sizeColumn.label "Size">

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

@ -1,42 +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/.
collection.addons.label = Add-ons
collection.bookmarks.label = Bookmarks
collection.history.label = History
collection.passwords.label = Passwords
collection.prefs.label = Preferences
collection.tabs.label = Tabs
# LOCALIZATION NOTE (quota.usageNoQuota.label): %1$S and %2$S are numeric value
# and unit (as defined in the download manager) of the amount of space occupied
# on the server
quota.usageNoQuota.label = You are currently using %1$S %2$S.
# LOCALIZATION NOTE (quota.usagePercentage.label):
# %1$S is the percentage of space used,
# %2$S and %3$S numeric value and unit (as defined in the download manager)
# of the amount of space used,
# %3$S and %4$S numeric value and unit (as defined in the download manager)
# of the total space available.
quota.usagePercentage.label = You are using %1$S%% (%2$S %3$S) of your allowed %4$S %5$S.
quota.usageError.label = Could not retrieve quota information.
quota.retrieving.label = Retrieving…
# LOCALIZATION NOTE (quota.sizeValueUnit.label): %1$S is the amount of space
# occupied by the engine, %2$K the corresponding unit (e.g. kB) as defined in
# the download manager.
quota.sizeValueUnit.label = %1$S %2$S
quota.remove.label = Remove
quota.treeCaption.label = Uncheck items to stop syncing them and free up space on the server.
# LOCALIZATION NOTE (quota.removal.label): %S is a list of engines that will be
# disabled and whose data will be removed once the user confirms.
quota.removal.label = Firefox Sync will remove the following data: %S.
# LOCALIZATION NOTE (quota.list.separator): This is the separator string used
# for the list of engines (incl. spaces where appropriate)
quota.list.separator = ,\u0020
# LOCALIZATION NOTE (quota.freeup.label): %1$S and %2$S are numeric value
# and unit (as defined in the download manager) of the amount of space freed
# up by disabling the unchecked engines. If displayed this string is
# concatenated directly to quota.removal.label and may need to start off with
# whitespace.
quota.freeup.label = \u0020This will free up %1$S %2$S.

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

@ -1,114 +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/. -->
<!ENTITY accountSetupTitle.label "&syncBrand.fullName.label; Setup">
<!-- First page of the wizard -->
<!ENTITY setup.pickSetupType.description2 "Welcome! If youve never used &syncBrand.fullName.label; before, you will need to create a new account.">
<!ENTITY button.createNewAccount.label "Create a New Account">
<!ENTITY button.haveAccount.label "I Have an Account">
<!ENTITY setup.choicePage.title.label "Have you used &syncBrand.fullName.label; before?">
<!ENTITY setup.choicePage.new.label "Ive never used &syncBrand.shortName.label; before">
<!ENTITY setup.choicePage.existing2.label "Im already using &syncBrand.shortName.label; on another device">
<!-- New Account AND Existing Account -->
<!ENTITY server.label "Server">
<!ENTITY serverType.default.label "Default: Mozilla &syncBrand.fullName.label; server">
<!ENTITY serverType.custom2.label "Use a custom server…">
<!ENTITY signIn.account2.label "Account">
<!ENTITY signIn.account2.accesskey "A">
<!ENTITY signIn.password.label "Password">
<!ENTITY signIn.password.accesskey "P">
<!ENTITY signIn.recoveryKey.label "Recovery Key">
<!ENTITY signIn.recoveryKey.accesskey "K">
<!-- New Account Page 1: Basic Account Info -->
<!ENTITY setup.newAccountDetailsPage.title.label "Account Details">
<!ENTITY setup.emailAddress.label "Email Address">
<!ENTITY setup.emailAddress.accesskey "E">
<!ENTITY setup.choosePassword.label "Choose a Password">
<!ENTITY setup.choosePassword.accesskey "P">
<!ENTITY setup.confirmPassword.label "Confirm Password">
<!ENTITY setup.confirmPassword.accesskey "m">
<!-- LOCALIZATION NOTE: tosAgree1, tosLink, tosAgree2, ppLink, tosAgree3 are
joined with implicit white space, so spaces in the strings aren't necessary -->
<!ENTITY setup.tosAgree1.label "I agree to the">
<!ENTITY setup.tosAgree1.accesskey "a">
<!ENTITY setup.tosLink.label "Terms of Service">
<!ENTITY setup.tosAgree2.label "and the">
<!ENTITY setup.ppLink.label "Privacy Policy">
<!ENTITY setup.tosAgree3.label "">
<!ENTITY setup.tosAgree2.accesskey "">
<!-- My Recovery Key dialog -->
<!ENTITY setup.newRecoveryKeyPage.title.label "&brandShortName; Cares About Your Privacy">
<!ENTITY setup.newRecoveryKeyPage.description.label "To ensure your total privacy, all of your data is encrypted prior to being uploaded. The Recovery Key which is necessary to decrypt your data is not uploaded.">
<!ENTITY recoveryKeyEntry.label "Your Recovery Key">
<!ENTITY recoveryKeyEntry.accesskey "K">
<!ENTITY syncGenerateNewKey.label "Generate a new key">
<!ENTITY recoveryKeyBackup.description "Your Recovery Key is required to access &syncBrand.fullName.label; on other machines. Please create a backup copy. We cannot help you recover your Recovery Key.">
<!ENTITY button.syncKeyBackup.print.label "Print…">
<!ENTITY button.syncKeyBackup.print.accesskey "P">
<!ENTITY button.syncKeyBackup.save.label "Save…">
<!ENTITY button.syncKeyBackup.save.accesskey "S">
<!-- Existing Account Page 1: Pair a Device (incl. Pair a Device dialog strings) -->
<!ENTITY pairDevice.title.label "Pair a Device">
<!ENTITY addDevice.showMeHow.label "Show me how.">
<!ENTITY addDevice.dontHaveDevice.label "I dont have the device with me">
<!ENTITY pairDevice.setup.description.label "To activate, select &#x0022;Pair a Device&#x0022; on your other device.">
<!ENTITY addDevice.setup.enterCode.label "Then, enter this code:">
<!ENTITY pairDevice.dialog.description.label "To activate your new device, select &#x0022;Set Up Sync&#x0022; on the device.">
<!ENTITY addDevice.dialog.enterCode.label "Enter the code that the device provides:">
<!ENTITY addDevice.dialog.tryAgain.label "Please try again.">
<!ENTITY addDevice.dialog.successful.label "The device has been successfully added. The initial synchronization can take several minutes and will finish in the background.">
<!ENTITY addDevice.dialog.recoveryKey.label "To activate your device you will need to enter your Recovery Key. Please print or save this key and take it with you.">
<!ENTITY addDevice.dialog.connected.label "Device Connected">
<!-- Existing Account Page 2: Manual Login -->
<!ENTITY setup.signInPage.title.label "Sign In">
<!ENTITY existingRecoveryKey.description "You can get a copy of your Recovery Key by going to &syncBrand.shortName.label; Options on your other device, and selecting &#x0022;My Recovery Key&#x0022; under &#x0022;Manage Account&#x0022;.">
<!ENTITY verifying.label "Verifying…">
<!ENTITY resetPassword.label "Reset Password">
<!ENTITY resetSyncKey.label "I have lost my other device.">
<!-- Sync Options -->
<!ENTITY setup.optionsPage.title "Sync Options">
<!ENTITY syncDeviceName.label "Device Name:">
<!ENTITY syncDeviceName.accesskey "c">
<!ENTITY syncMy.label "Sync My">
<!ENTITY engine.bookmarks.label "Bookmarks">
<!ENTITY engine.bookmarks.accesskey "m">
<!ENTITY engine.tabs.label2 "Open Tabs">
<!ENTITY engine.tabs.accesskey "T">
<!ENTITY engine.history.label "History">
<!ENTITY engine.history.accesskey "r">
<!ENTITY engine.passwords.label "Passwords">
<!ENTITY engine.passwords.accesskey "P">
<!ENTITY engine.prefs.label "Preferences">
<!ENTITY engine.prefs.accesskey "S">
<!ENTITY engine.addons.label "Add-ons">
<!ENTITY engine.addons.accesskey "A">
<!ENTITY choice2a.merge.main.label "Merge this devices data with my &syncBrand.shortName.label; data">
<!ENTITY choice2.merge.recommended.label "Recommended:">
<!ENTITY choice2a.client.main.label "Replace all data on this device with my &syncBrand.shortName.label; data">
<!ENTITY choice2a.server.main.label "Replace all other devices with this devices data">
<!-- Confirm Merge Options -->
<!ENTITY setup.optionsConfirmPage.title "Confirm">
<!ENTITY confirm.merge2.label "&syncBrand.fullName.label; will now merge all this devices browser data into your Sync account.">
<!ENTITY confirm.client3.label "Warning: The following &brandShortName; data on this device will be deleted:">
<!ENTITY confirm.client2.moreinfo.label "&brandShortName; will then copy your &syncBrand.fullName.label; data to this device.">
<!ENTITY confirm.server2.label "Warning: The following devices will be overwritten with your local data:">
<!-- New & Existing Account: Setup Complete -->
<!ENTITY setup.successPage.title "Setup Complete">
<!ENTITY changeOptions.label "You can change this preference by selecting Sync Options below.">
<!ENTITY continueUsing.label "You may now continue using &brandShortName;.">

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

@ -2,51 +2,6 @@
# 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/.
button.syncOptions.label = Sync Options
button.syncOptionsDone.label = Done
button.syncOptionsCancel.label = Cancel
invalidEmail.label = Invalid email address
serverInvalid.label = Please enter a valid server URL
usernameNotAvailable.label = Already in use
verifying.label = Verifying…
# LOCALIZATION NOTE (additionalClientCount.label):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 is the number of additional clients (was %S for a short while, use #1 instead, even if both work)
additionalClientCount.label = and #1 additional device;and #1 additional devices
# LOCALIZATION NOTE (bookmarksCount.label):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 is the number of bookmarks (was %S for a short while, use #1 instead, even if both work)
bookmarksCount.label = #1 bookmark;#1 bookmarks
# LOCALIZATION NOTE (historyDaysCount.label):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 is the number of days (was %S for a short while, use #1 instead, even if both work)
historyDaysCount.label = #1 day of history;#1 days of history
# LOCALIZATION NOTE (passwordsCount.label):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 is the number of passwords (was %S for a short while, use #1 instead, even if both work)
passwordsCount.label = #1 password;#1 passwords
# LOCALIZATION NOTE (addonsCount.label): Semicolon-separated list of plural forms.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 is the number of add-ons, see the link above for forms
addonsCount.label = #1 add-on;#1 add-ons
save.recoverykey.title = Save Recovery Key
save.recoverykey.defaultfilename = Firefox Recovery Key.html
newAccount.action.label = Firefox Sync is now set up to automatically sync all of your browser data.
newAccount.change.label = You can choose exactly what to sync by selecting Sync Options below.
resetClient.change2.label = Firefox Sync will now merge all this devices browser data into your Sync account.
wipeClient.change2.label = Firefox Sync will now replace all of the browser data on this device with the data in your Sync account.
wipeRemote.change2.label = Firefox Sync will now replace all of the browser data in your Sync account with the data on this device.
existingAccount.change.label = You can change this preference by selecting Sync Options below.
# Several other strings are used (via Weave.Status.login), but they come from
# /services/sync

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

@ -20,7 +20,6 @@
locale/browser/aboutSearchReset.dtd (%chrome/browser/aboutSearchReset.dtd)
locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd)
locale/browser/aboutTabCrashed.dtd (%chrome/browser/aboutTabCrashed.dtd)
locale/browser/syncCustomize.dtd (%chrome/browser/syncCustomize.dtd)
locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd)
locale/browser/browser.dtd (%chrome/browser/browser.dtd)
locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd)
@ -85,12 +84,7 @@
locale/browser/preferences/siteDataSettings.dtd (%chrome/browser/preferences/siteDataSettings.dtd)
locale/browser/preferences/translation.dtd (%chrome/browser/preferences/translation.dtd)
locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd)
locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd)
locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties)
locale/browser/syncGenericChange.properties (%chrome/browser/syncGenericChange.properties)
locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd)
locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd)
locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties)
% resource search-plugins chrome://browser/locale/searchplugins/
#if BUILD_FASTER
locale/browser/searchplugins/ (searchplugins/*.xml)

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

@ -279,6 +279,11 @@ this.PermissionPromptPrototype = {
this.allow();
return;
}
// Tell the browser to refresh the identity block display in case there
// are expired permission states.
this.browser.dispatchEvent(new this.browser.ownerGlobal
.CustomEvent("PermissionStateChange"));
}
// Transform the PermissionPrompt actions into PopupNotification actions.

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

@ -129,6 +129,13 @@ const TemporaryBlockedPermissions = {
},
};
/**
* A module to manage permanent and temporary permissions
* by URI and browser.
*
* Some methods have the side effect of dispatching a "PermissionStateChange"
* event on changes to temporary permissions, as mentioned in the respective docs.
*/
this.SitePermissions = {
// Permission states.
UNKNOWN: Services.perms.UNKNOWN_ACTION,
@ -296,6 +303,9 @@ this.SitePermissions = {
/**
* Returns the state and scope of a particular permission for a given URI.
*
* This method will NOT dispatch a "PermissionStateChange" event on the specified
* browser if a temporary permission was removed because it has expired.
*
* @param {nsIURI} uri
* The URI to check.
* @param {String} permissionID
@ -344,6 +354,8 @@ this.SitePermissions = {
/**
* Sets the state of a particular permission for a given URI or browser.
* This method will dispatch a "PermissionStateChange" event on the specified
* browser if a temporary permission was set
*
* @param {nsIURI} uri
* The URI to set the permission for.
@ -402,6 +414,8 @@ this.SitePermissions = {
/**
* Removes the saved state of a particular permission for a given URI and/or browser.
* This method will dispatch a "PermissionStateChange" event on the specified
* browser if a temporary permission was removed.
*
* @param {nsIURI} uri
* The URI to remove the permission for.

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

@ -6,10 +6,13 @@
Cu.import("resource:///modules/SitePermissions.jsm", this);
const EXPIRE_TIME_MS = 100;
const TIMEOUT_MS = 500;
// This tests the time delay to expire temporary permission entries.
add_task(function* testTemporaryPermissionExpiry() {
SpecialPowers.pushPrefEnv({set: [
["privacy.temporary_permission_expire_time_ms", 100],
["privacy.temporary_permission_expire_time_ms", EXPIRE_TIME_MS],
]});
let uri = Services.io.newURI("https://example.com")
@ -23,7 +26,7 @@ add_task(function* testTemporaryPermissionExpiry() {
scope: SitePermissions.SCOPE_TEMPORARY,
});
yield new Promise((c) => setTimeout(c, 500));
yield new Promise((c) => setTimeout(c, TIMEOUT_MS));
Assert.deepEqual(SitePermissions.get(uri, id, browser), {
state: SitePermissions.UNKNOWN,

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

@ -373,6 +373,11 @@ function prompt(aBrowser, aRequest) {
return;
}
// Tell the browser to refresh the identity block display in case there
// are expired permission states.
aBrowser.dispatchEvent(new aBrowser.ownerGlobal
.CustomEvent("PermissionStateChange"));
let uri = Services.io.newURI(aRequest.documentURI);
let host = getHost(uri);
let chromeDoc = aBrowser.ownerDocument;

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

@ -113,10 +113,6 @@ browser.jar:
skin/classic/browser/sync-horizontalbar.png
skin/classic/browser/sync-horizontalbar@2x.png
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
skin/classic/browser/syncProgress-horizontalbar.png
skin/classic/browser/syncProgress-horizontalbar@2x.png
#ifdef E10S_TESTING_ONLY

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

@ -83,19 +83,6 @@
/* Sync Pane */
#syncDesc {
padding: 0 8em;
}
#accountCaptionImage {
list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
}
#syncAddDeviceLabel {
margin-top: 1em;
margin-bottom: 1em;
}
#noFxaAccount {
line-height: 1.2em;
}

Двоичные данные
browser/themes/linux/sync-notification-24.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

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

@ -1,49 +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/. */
/* The following are used by both sync/setup.xul and sync/genericChange.xul */
.status {
color: -moz-dialogtext;
}
.statusIcon {
margin-inline-start: 4px;
max-height: 16px;
max-width: 16px;
}
.statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading.png");
}
.statusIcon[status="error"] {
list-style-image: url("moz-icon://stock/gtk-dialog-error?size=menu");
}
.statusIcon[status="success"] {
list-style-image: url("moz-icon://stock/gtk-dialog-info?size=menu");
}
/* .data is only used by sync/genericChange.xul, but it seems unnecessary to have
a separate stylesheet for it. */
.data {
font-size: 90%;
font-weight: bold;
}
dialog#change-dialog {
width: 40em;
}
image#syncIcon {
list-style-image: url("chrome://browser/skin/sync-32.png");
}
#introText {
margin-top: 2px;
}
#feedback {
height: 2em;
}

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

@ -1,26 +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/. */
#quotaDialog {
width: 33em;
height: 25em;
}
treechildren::-moz-tree-checkbox {
list-style-image: none;
}
treechildren::-moz-tree-checkbox(checked) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif");
}
treechildren::-moz-tree-checkbox(disabled) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
}
#treeCaption {
height: 4em;
}
.captionWarning {
font-weight: bold;
}

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

@ -1,133 +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/. */
wizard {
-moz-appearance: none;
width: 55em;
height: 45em;
padding: 0;
background-color: Window;
}
.wizard-page-box {
-moz-appearance: none;
padding-left: 0;
padding-right: 0;
margin: 0;
}
wizardpage {
-moz-box-pack: center;
-moz-box-align: center;
margin: 0;
padding: 0 6em;
background-color: Window;
}
.wizard-header {
-moz-appearance: none;
border: none;
padding: 2em 0 1em 0;
text-align: center;
}
.wizard-header-label {
font-size: 24pt;
font-weight: normal;
}
.wizard-buttons {
background-color: rgba(0,0,0,0.1);
padding: 1em;
}
.wizard-buttons-separator {
visibility: collapse;
}
.wizard-header-icon {
visibility: collapse;
}
.accountChoiceButton {
font: menu;
}
.confirm {
border: 1px solid black;
padding: 1em;
border-radius: 5px;
}
/* Override the text-link style from global.css */
description > .text-link,
description > .text-link:focus {
margin: 0px;
padding: 0px;
border: 0px;
}
.success,
.error {
padding: 2px;
border-radius: 2px;
}
.error {
background-color: #FF0000 !important;
color: #FFFFFF !important;
}
.success {
background-color: #00FF00 !important;
}
.warning {
font-weight: bold;
font-size: 100%;
color: red;
}
.mainDesc {
font-weight: bold;
font-size: 100%;
}
.normal {
font-size: 100%;
}
.inputColumn {
margin-inline-end: 2px
}
.pin {
font-size: 18pt;
width: 4em;
text-align: center;
}
#passphraseHelpSpacer {
width: 0.5em;
}
#pairDeviceThrobber,
#login-throbber {
-moz-box-align: center;
}
#pairDeviceThrobber > image,
#login-throbber > image {
width: 16px;
list-style-image: url("chrome://global/skin/icons/loading.png");
}
#captchaFeedback {
visibility: hidden;
}
#successPageIcon {
/* TODO replace this with a 128px version (bug 591122) */
list-style-image: url("chrome://browser/skin/sync-32.png");
}

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

@ -162,10 +162,6 @@ browser.jar:
skin/classic/browser/sync-horizontalbar.png
skin/classic/browser/sync-horizontalbar@2x.png
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
skin/classic/browser/syncProgress-horizontalbar.png
skin/classic/browser/syncProgress-horizontalbar@2x.png
skin/classic/browser/Toolbar-background-noise.png (Toolbar-background-noise.png)

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

@ -108,19 +108,6 @@ caption {
/* ----- SYNC PANE ----- */
#syncDesc {
padding: 0 8em;
}
#accountCaptionImage {
list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
}
#syncAddDeviceLabel {
margin-top: 1em;
margin-bottom: 1em;
}
#noFxaAccount {
line-height: 1.2em;
}

Двоичные данные
browser/themes/osx/sync-notification-24.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 776 B

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

@ -1,55 +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/. */
/* The following are used by both sync/setup.xul and sync/genericChange.xul */
.status {
color: -moz-dialogtext;
}
.statusIcon {
margin-inline-start: 4px;
max-height: 16px;
max-width: 16px;
}
.statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading.png");
}
@media (min-resolution: 2dppx) {
.statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
}
}
.statusIcon[status="error"] {
list-style-image: url("chrome://global/skin/icons/error-16.png");
}
.statusIcon[status="success"] {
list-style-image: url("chrome://global/skin/icons/information-16.png");
}
/* .data is only used by sync/genericChange.xul, but it seems unnecessary to have
a separate stylesheet for it. */
.data {
font-size: 90%;
font-weight: bold;
}
dialog#change-dialog {
width: 40em;
}
image#syncIcon {
list-style-image: url("chrome://browser/skin/sync-32.png");
}
#introText {
margin-top: 2px;
}
#feedback {
height: 2em;
}

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

@ -1,26 +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/. */
#quotaDialog {
width: 33em;
height: 25em;
}
treechildren::-moz-tree-checkbox {
list-style-image: none;
}
treechildren::-moz-tree-checkbox(checked) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif");
}
treechildren::-moz-tree-checkbox(disabled) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
}
#treeCaption {
height: 4em;
}
.captionWarning {
font-weight: bold;
}

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

@ -1,139 +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/. */
wizard {
-moz-appearance: none;
width: 55em;
height: 45em;
padding: 0;
background-color: Window;
}
.wizard-page-box {
-moz-appearance: none;
padding-left: 0;
padding-right: 0;
margin: 0;
}
wizardpage {
-moz-box-pack: center;
-moz-box-align: center;
margin: 0;
padding: 0 6em;
background-color: Window;
}
.wizard-header {
-moz-appearance: none;
border: none;
padding: 2em 0 1em 0;
text-align: center;
}
.wizard-header-label {
font-size: 24pt;
font-weight: normal;
}
.wizard-buttons {
background-color: rgba(0,0,0,0.1);
padding: 1em;
}
.wizard-buttons-separator {
visibility: collapse;
}
.wizard-header-icon {
visibility: collapse;
}
.accountChoiceButton {
font: menu;
}
.confirm {
border: 1px solid black;
padding: 1em;
border-radius: 5px;
}
/* Override the text-link style from global.css */
description > .text-link,
description > .text-link:focus {
margin: 0px;
padding: 0px;
border: 0px;
}
.success,
.error {
padding: 2px;
border-radius: 2px;
}
.error {
background-color: #FF0000 !important;
color: #FFFFFF !important;
}
.success {
background-color: #00FF00 !important;
}
.warning {
font-weight: bold;
font-size: 100%;
color: red;
}
.mainDesc {
font-weight: bold;
font-size: 100%;
}
.normal {
font-size: 100%;
}
.inputColumn {
margin-inline-end: 2px
}
.pin {
font-size: 18pt;
width: 4em;
text-align: center;
}
#passphraseHelpSpacer {
width: 0.5em;
}
#pairDeviceThrobber,
#login-throbber {
-moz-box-align: center;
}
#pairDeviceThrobber > image,
#login-throbber > image {
width: 16px;
list-style-image: url("chrome://global/skin/icons/loading.png");
}
@media (min-resolution: 2dppx) {
#pairDeviceThrobber > image,
#login-throbber > image {
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
}
}
#captchaFeedback {
visibility: hidden;
}
#successPageIcon {
/* TODO replace this with a 128px version (bug 591122) */
list-style-image: url("chrome://browser/skin/sync-32.png");
}

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

@ -842,12 +842,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png);
}
#PanelUI-footer-fxa[fxastatus="migrate-signup"] > #PanelUI-fxa-status > #PanelUI-fxa-label,
#PanelUI-footer-fxa[fxastatus="migrate-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label {
list-style-image: url(chrome://browser/skin/warning.svg);
-moz-image-region: auto;
}
#PanelUI-customize {
list-style-image: url(chrome://browser/skin/menuPanel-customize.png);
}

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

@ -248,10 +248,7 @@ treecol {
active vbox needs */
#historyPane:not([selectedIndex="1"]) > #historyDontRememberPane,
#historyPane:not([selectedIndex="2"]) > #historyCustomPane,
#weavePrefsDeck:not([selectedIndex="1"]) > #hasAccount,
#weavePrefsDeck:not([selectedIndex="2"]) > #needsUpdate,
#weavePrefsDeck:not([selectedIndex="3"]) > #noFxaAccount,
#weavePrefsDeck:not([selectedIndex="4"]) > #hasFxaAccount,
#weavePrefsDeck:not([selectedIndex="1"]) > #hasFxaAccount,
#fxaLoginStatus:not([selectedIndex="1"]) > #fxaLoginUnverified,
#fxaLoginStatus:not([selectedIndex="2"]) > #fxaLoginRejected {
visibility: collapse;
@ -266,10 +263,8 @@ description > html|a {
#weavePrefsDeck > vbox > label,
#weavePrefsDeck > vbox > groupbox,
#weavePrefsDeck > vbox > description,
#weavePrefsDeck > vbox > #pairDevice > label,
#weavePrefsDeck > #needsUpdate > hbox > #loginError,
#weavePrefsDeck > #hasFxaAccount > vbox > label,
#weavePrefsDeck > #hasFxaAccount > hbox:not(#tosPP-normal) > label {
#weavePrefsDeck > #hasFxaAccount > hbox > label {
/* no margin-inline-start for elements at the beginning of a line */
margin-inline-start: 0;
}

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

@ -99,6 +99,27 @@
border-radius: 2px;
}
/* GRID */
body.compact #newtab-grid {
/* Allow #topsites-heading to use position:absolute such that it doesn't
affect how many cells we can fit into the grid. */
position: relative;
padding-top: 1em;
margin-top: -1em;
}
#topsites-heading {
color: #7A7A7A;
font-size: 1em;
font-weight: normal;
/* Position the heading such that it doesn't affect how many cells we
can fit into the grid. */
position: absolute;
top: 0;
/* The horizontal margin aligns the heading with the cells. */
margin: 0 10px;
}
/* CELLS */
.newtab-cell {
--cell-corner-radius: 8px;

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

@ -145,10 +145,6 @@ browser.jar:
skin/classic/browser/sync-horizontalbar-win7.png
skin/classic/browser/sync-horizontalbar-win7@2x.png
skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg)
skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
skin/classic/browser/syncProgress-horizontalbar.png
skin/classic/browser/syncProgress-horizontalbar@2x.png
skin/classic/browser/syncProgress-horizontalbar-win7.png

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

@ -70,23 +70,6 @@
/* Sync Pane */
#syncDesc {
padding: 0 8em;
}
.syncGroupBox {
padding: 10px;
}
#accountCaptionImage {
list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
}
#syncAddDeviceLabel {
margin-top: 1em;
margin-bottom: 1em;
}
#noFxaAccount {
line-height: 1.2em;
}

Двоичные данные
browser/themes/windows/sync-notification-24.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 KiB

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

@ -1,55 +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/. */
/* The following are used by both sync/setup.xul and sync/genericChange.xul */
.status {
color: -moz-dialogtext;
}
.statusIcon {
margin-inline-start: 4px;
max-height: 16px;
max-width: 16px;
}
.statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading.png");
}
@media (min-resolution: 1.1dppx) {
.statusIcon[status="active"] {
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
}
}
.statusIcon[status="error"] {
list-style-image: url("chrome://global/skin/icons/error-16.png");
}
.statusIcon[status="success"] {
list-style-image: url("chrome://global/skin/icons/information-16.png");
}
/* .data is only used by sync/genericChange.xul, but it seems unnecessary to have
a separate stylesheet for it. */
.data {
font-size: 90%;
font-weight: bold;
}
dialog#change-dialog {
width: 40em;
}
image#syncIcon {
list-style-image: url("chrome://browser/skin/sync-32.png");
}
#introText {
margin-top: 2px;
}
#feedback {
height: 2em;
}

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

@ -1,26 +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/. */
#quotaDialog {
width: 33em;
height: 25em;
}
treechildren::-moz-tree-checkbox {
list-style-image: none;
}
treechildren::-moz-tree-checkbox(checked) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif");
}
treechildren::-moz-tree-checkbox(disabled) {
list-style-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
}
#treeCaption {
height: 4em;
}
.captionWarning {
font-weight: bold;
}

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

@ -1,145 +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/. */
wizard {
-moz-appearance: none;
width: 55em;
height: 45em;
padding: 0;
background-color: Window;
}
.wizard-page-box {
-moz-appearance: none;
padding-left: 0;
padding-right: 0;
margin: 0;
}
wizardpage {
-moz-box-pack: center;
-moz-box-align: center;
margin: 0;
padding: 0 6em;
background-color: Window;
}
.wizard-header {
-moz-appearance: none;
border: none;
padding: 2em 0 1em 0;
text-align: center;
}
.wizard-header-label {
font-size: 24pt;
font-weight: normal;
}
.wizard-buttons {
background-color: rgba(0,0,0,0.1);
padding: 1em;
}
.wizard-buttons-separator {
visibility: collapse;
}
.wizard-header-icon {
visibility: collapse;
}
.accountChoiceButton {
font: menu;
}
.confirm {
border: 1px solid black;
padding: 1em;
border-radius: 5px;
}
/* Override the text-link style from global.css */
description > .text-link,
description > .text-link:focus {
margin: 0px;
padding: 0px;
border: 0px;
}
.success,
.error {
padding: 2px;
border-radius: 2px;
}
.error {
background-color: #FF0000 !important;
color: #FFFFFF !important;
}
.success {
background-color: #00FF00 !important;
}
.warning {
font-weight: bold;
font-size: 100%;
color: red;
}
.mainDesc {
font-weight: bold;
font-size: 100%;
}
.normal {
font-size: 100%;
}
.inputColumn {
margin-inline-end: 2px
}
.pin {
font-size: 18pt;
width: 4em;
text-align: center;
}
#passphraseHelpSpacer {
width: 0.5em;
}
#pairDeviceThrobber,
#login-throbber {
-moz-box-align: center;
}
#pairDeviceThrobber > image,
#login-throbber > image {
width: 16px;
list-style-image: url("chrome://global/skin/icons/loading.png");
}
@media (min-resolution: 1.1dppx) {
#pairDeviceThrobber > image,
#login-throbber > image {
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
}
}
#captchaFeedback {
visibility: hidden;
}
#successPageIcon {
/* TODO replace this with a 128px version (bug 591122) */
list-style-image: url("chrome://browser/skin/sync-32.png");
}
#tosDesc {
margin-left: -7px;
margin-bottom: 3px;
}

33
build/rebuild-backend.mk Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# 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/.
BACKEND_GENERATION_SCRIPT ?= config.status
# A traditional rule would look like this:
# backend.%:
# @echo do stuff
#
# But with -j<n>, and multiple items in BUILD_BACKEND_FILES, the command would
# run multiple times in parallel.
#
# "Fortunately", make has some weird semantics for pattern rules: if there are
# multiple targets in a pattern rule and each of them is matched at most once,
# the command will only run once. So:
# backend%RecursiveMakeBackend backend%FasterMakeBackend:
# @echo do stuff
# backend: backend.RecursiveMakeBackend backend.FasterMakeBackend
# would only execute the command once.
#
# Credit where due: http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file/3077254#3077254
$(subst .,%,$(BUILD_BACKEND_FILES)):
@echo 'Build configuration changed. Regenerating backend.'
$(PYTHON) $(BACKEND_GENERATION_SCRIPT)
define build_backend_rule
$(1)_files := $$(shell cat $(1).in)
$(1): $$($(1)_files)
$$($(1)_files):
endef
$(foreach file,$(BUILD_BACKEND_FILES),$(eval $(call build_backend_rule,$(file))))

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

@ -26,6 +26,7 @@ const TreeRow = createFactory(require("devtools/client/shared/components/tree/tr
const { div, tr, td } = DOM;
const AUTO_EXPAND_MAX_LEVEL = 7;
const AUTO_EXPAND_MAX_NODES = 50;
const EDITOR_CONFIG_ID = "EDITOR_CONFIG";
/*
@ -146,12 +147,22 @@ const PropertiesView = createClass({
let expandedNodes = new Set();
for (let prop in object) {
if (expandedNodes.size > AUTO_EXPAND_MAX_NODES) {
// If we reached the limit of expandable nodes, bail out to avoid performance
// issues.
break;
}
let nodePath = path + "/" + prop;
expandedNodes.add(nodePath);
let nodes = this.getExpandedNodes(object[prop], nodePath, level + 1);
if (nodes) {
expandedNodes = new Set([...expandedNodes, ...nodes]);
let newSize = expandedNodes.size + nodes.size;
if (newSize < AUTO_EXPAND_MAX_NODES) {
// Avoid having a subtree half expanded.
expandedNodes = new Set([...expandedNodes, ...nodes]);
}
}
}
return expandedNodes;

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

@ -64,8 +64,8 @@ add_task(function* () {
is(tabpanel.querySelectorAll(".tree-section").length, 1,
"There should be 1 tree sections displayed in this tabpanel.");
is(tabpanel.querySelectorAll(".treeRow:not(.tree-section)").length, 4094,
"There should be 4094 json properties displayed in this tabpanel.");
is(tabpanel.querySelectorAll(".treeRow:not(.tree-section)").length, 2047,
"There should be 2047 json properties displayed in this tabpanel.");
is(tabpanel.querySelectorAll(".empty-notice").length, 0,
"The empty notice should not be displayed in this tabpanel.");
@ -83,9 +83,9 @@ add_task(function* () {
is(values[0].textContent, "Object",
"The first json property value was incorrect.");
is(labels[1].textContent, "greeting",
is(labels[1].textContent, "1",
"The second json property name was incorrect.");
is(values[1].textContent, "\"Hello long string JSON!\"",
is(values[1].textContent, "Object",
"The second json property value was incorrect.");
}
});

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

@ -653,47 +653,9 @@ nsDefaultURIFixup::ConvertFileToStringURI(const nsACString& aIn,
// Test if this is a valid path by trying to create a local file
// object. The URL of that is returned if successful.
// NOTE: Please be sure to check that the call to NS_NewLocalFile
// rejects bad file paths when using this code on a new
// platform.
nsCOMPtr<nsIFile> filePath;
nsresult rv;
// this is not the real fix but a temporary fix
// in order to really fix the problem, we need to change the
// nsICmdLineService interface to use wstring to pass paramenters
// instead of string since path name and other argument could be
// in non ascii.(see bug 87127) Since it is too risky to make interface
// change right now, we decide not to do so now.
// Therefore, the aIn we receive here maybe already in damage form
// (e.g. treat every bytes as ISO-8859-1 and cast up to char16_t
// while the real data could be in file system charset )
// we choice the following logic which will work for most of the case.
// Case will still failed only if it meet ALL the following condiction:
// 1. running on CJK, Russian, or Greek system, and
// 2. user type it from URL bar
// 3. the file name contains character in the range of
// U+00A1-U+00FF but encode as different code point in file
// system charset (e.g. ACP on window)- this is very rare case
// We should remove this logic and convert to File system charset here
// once we change nsICmdLineService to use wstring and ensure
// all the Unicode data come in is correctly converted.
// XXXbz nsICmdLineService doesn't hand back unicode, so in some cases
// what we have is actually a "utf8" version of a "utf16" string that's
// actually byte-expanded native-encoding data. Someone upstream needs
// to stop using AssignWithConversion and do things correctly. See bug
// 58866 for what happens if we remove this
// PossiblyByteExpandedFileName check.
NS_ConvertUTF8toUTF16 in(aIn);
if (PossiblyByteExpandedFileName(in)) {
// removes high byte
rv = NS_NewNativeLocalFile(NS_LossyConvertUTF16toASCII(in), false,
getter_AddRefs(filePath));
} else {
// input is unicode
rv = NS_NewLocalFile(in, false, getter_AddRefs(filePath));
}
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(aIn), false,
getter_AddRefs(filePath));
if (NS_SUCCEEDED(rv)) {
NS_GetURLSpecFromFile(filePath, aResult);
@ -832,28 +794,6 @@ nsDefaultURIFixup::PossiblyHostPortUrl(const nsACString& aUrl)
return true;
}
bool
nsDefaultURIFixup::PossiblyByteExpandedFileName(const nsAString& aIn)
{
// XXXXX HACK XXXXX : please don't copy this code.
// There are cases where aIn contains the locale byte chars padded to short
// (thus the name "ByteExpanded"); whereas other cases
// have proper Unicode code points.
// This is a temporary fix. Please refer to 58866, 86948
nsReadingIterator<char16_t> iter;
nsReadingIterator<char16_t> iterEnd;
aIn.BeginReading(iter);
aIn.EndReading(iterEnd);
while (iter != iterEnd) {
if (*iter >= 0x0080 && *iter <= 0x00FF) {
return true;
}
++iter;
}
return false;
}
nsresult
nsDefaultURIFixup::KeywordURIFixup(const nsACString& aURIString,
nsDefaultURIFixupInfo* aFixupInfo,

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

@ -36,7 +36,6 @@ private:
nsresult TryKeywordFixupForURIInfo(const nsACString& aStringURI,
nsDefaultURIFixupInfo* aFixupInfo,
nsIInputStream** aPostData);
bool PossiblyByteExpandedFileName(const nsAString& aIn);
bool PossiblyHostPortUrl(const nsACString& aUrl);
bool MakeAlternateURI(nsIURI* aURI);
bool IsDomainWhitelisted(const nsACString& aAsciiHost,

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

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=453650
-->

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

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=565388
-->

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

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=846906
-->

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

@ -125,6 +125,13 @@ FindAnimationsForCompositor(const nsIFrame* aFrame,
return false;
}
// FIXME: Bug 1334036: stylo: Implement off-main-thread animations.
if (aFrame->StyleContext()->StyleSource().IsServoComputedValues()) {
NS_WARNING("stylo: return false in FindAnimationsForCompositor because "
"haven't supported compositor-driven animations yet");
return false;
}
// First check for newly-started transform animations that should be
// synchronized with geometric animations. We need to do this before any
// other early returns (the one above is ok) since we can only check this
@ -149,11 +156,6 @@ FindAnimationsForCompositor(const nsIFrame* aFrame,
return false;
}
if (aFrame->StyleContext()->StyleSource().IsServoComputedValues()) {
NS_ERROR("stylo: cannot handle compositor-driven animations yet");
return false;
}
// The animation cascade will almost always be up-to-date by this point
// but there are some cases such as when we are restoring the refresh driver
// from test control after seeking where it might not be the case.
@ -273,14 +275,14 @@ EffectCompositor::RequestRestyle(dom::Element* aElement,
}
if (aRestyleType == RestyleType::Layer) {
// FIXME: we call RequestRestyle for both stylo and gecko, so we
// should fix this after supporting animations on the compositor.
// Prompt layers to re-sync their animations.
// FIXME: Bug 1334036: we call RequestRestyle for both stylo and gecko,
// so we should fix this after supporting animations on the compositor.
if (mPresContext->RestyleManager()->IsServo()) {
NS_ERROR("stylo: Servo-backed style system should not be using "
"EffectCompositor");
NS_WARNING("stylo: RequestRestyle to layer, but Servo-backed style "
"system haven't supported compositor-driven animations yet");
return;
}
// Prompt layers to re-sync their animations.
mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration();
EffectSet* effectSet =
EffectSet::GetEffectSet(aElement, aPseudoType);

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

@ -1,16 +1,16 @@
pref(dom.animations-api.core.enabled,true) load 1239889-1.html
asserts-if(stylo,3) pref(dom.animations-api.core.enabled,true) load 1244595-1.html # bug 1324696
asserts-if(stylo,3-10) pref(dom.animations-api.core.enabled,true) load 1216842-1.html # bug 1324695
asserts-if(stylo,3-10) pref(dom.animations-api.core.enabled,true) load 1216842-2.html # bug 1324695
asserts-if(stylo,3) pref(dom.animations-api.core.enabled,true) load 1216842-3.html # bug 1324691
asserts-if(stylo,3) pref(dom.animations-api.core.enabled,true) load 1216842-4.html # bug 1324691
asserts-if(stylo,4-10) pref(dom.animations-api.core.enabled,true) load 1216842-5.html # bug 1324693
asserts-if(stylo,4-10) pref(dom.animations-api.core.enabled,true) load 1216842-6.html # bug 1324693
asserts-if(stylo,2) pref(dom.animations-api.core.enabled,true) load 1244595-1.html # bug 1324696
pref(dom.animations-api.core.enabled,true) load 1216842-1.html # bug 1334036
pref(dom.animations-api.core.enabled,true) load 1216842-2.html # bug 1334036
pref(dom.animations-api.core.enabled,true) load 1216842-3.html
pref(dom.animations-api.core.enabled,true) load 1216842-4.html
pref(dom.animations-api.core.enabled,true) load 1216842-5.html # bug 1334036
pref(dom.animations-api.core.enabled,true) load 1216842-6.html # bug 1334036
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1272475-1.html # bug 1324693 and bug 1332657
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1272475-2.html # bug 1324693 and bug 1332657
asserts-if(stylo,5) pref(dom.animations-api.core.enabled,true) load 1278485-1.html # bug 1324691
asserts-if(stylo,31) pref(dom.animations-api.core.enabled,true) load 1277272-1.html # bug 1324694
asserts-if(stylo,2) pref(dom.animations-api.core.enabled,true) load 1290535-1.html # bug 1324690
pref(dom.animations-api.core.enabled,true) load 1278485-1.html
asserts-if(stylo,10) pref(dom.animations-api.core.enabled,true) load 1277272-1.html # bug 1324694
pref(dom.animations-api.core.enabled,true) load 1290535-1.html
pref(dom.animations-api.core.enabled,true) load 1304886-1.html
pref(dom.animations-api.core.enabled,true) load 1322382-1.html
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1322291-1.html # bug 1311257

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

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1098074
-->

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

@ -4,7 +4,7 @@
<head>
<title>Test for Bug 380418</title>
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=380418">Mozilla Bug 380418</a>

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

@ -6,7 +6,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=383430
<head>
<title>Test for Bug 383430</title>
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=383430">Mozilla Bug 383430</a>

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

@ -4,28 +4,29 @@
* 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/. */
#include "nsXULAppAPI.h"
#include "nsGeolocation.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h"
#include "nsGeolocation.h"
#include "nsDOMClassInfoID.h"
#include "mozilla/Unused.h"
#include "mozilla/WeakPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsContentUtils.h"
#include "nsContentPermissionHelper.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsGlobalWindow.h"
#include "nsIDocument.h"
#include "nsIObserverService.h"
#include "nsIScriptError.h"
#include "nsPIDOMWindow.h"
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#include "mozilla/Services.h"
#include "mozilla/Unused.h"
#include "mozilla/Preferences.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/WeakPtr.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "nsXULAppAPI.h"
class nsIPrincipal;
@ -54,6 +55,10 @@ class nsIPrincipal;
// that a window can make.
#define MAX_GEO_REQUESTS_PER_WINDOW 1500
// This preference allows to override the "secure context" by
// default policy.
#define PREF_GEO_SECURITY_ALLOWINSECURE "geo.security.allowinsecure"
using mozilla::Unused; // <snicker>
using namespace mozilla;
using namespace mozilla::dom;
@ -728,11 +733,11 @@ nsresult nsGeolocationService::Init()
// "geo.provider.testing" is always set for all plain and browser chrome
// mochitests, and also for xpcshell tests.
if (!mProvider || Preferences::GetBool("geo.provider.testing", false)) {
nsCOMPtr<nsIGeolocationProvider> override =
nsCOMPtr<nsIGeolocationProvider> geo_net_provider =
do_GetService(NS_GEOLOCATION_PROVIDER_CONTRACTID);
if (override) {
mProvider = override;
if (geo_net_provider) {
mProvider = geo_net_provider;
}
}
@ -1173,6 +1178,36 @@ Geolocation::IsAlreadyCleared(nsGeolocationRequest* aRequest)
return false;
}
bool
Geolocation::ShouldBlockInsecureRequests() const
{
// TODO: Also remove all the *_SECURE_ORIGIN Telemetry probes before
// landing the patch for #1072859. Also default to false.
if (Preferences::GetBool(PREF_GEO_SECURITY_ALLOWINSECURE, true)) {
return false;
}
nsCOMPtr<nsPIDOMWindowInner> win = do_QueryReferent(mOwner);
if (!win) {
return false;
}
nsCOMPtr<nsIDocument> doc = win->GetDoc();
if (!doc) {
return false;
}
if (!nsGlobalWindow::Cast(win)->IsSecureContext()) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM"), doc,
nsContentUtils::eDOM_PROPERTIES,
"GeolocationInsecureRequestIsForbidden");
return true;
}
return false;
}
bool
Geolocation::ClearPendingRequest(nsGeolocationRequest* aRequest)
{
@ -1225,7 +1260,7 @@ Geolocation::GetCurrentPosition(GeoPositionCallback callback,
Move(options), static_cast<uint8_t>(mProtocolType),
false);
if (!sGeoEnabled) {
if (!sGeoEnabled || ShouldBlockInsecureRequests()) {
nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(false, request);
NS_DispatchToMainThread(ev);
return NS_OK;
@ -1311,7 +1346,7 @@ Geolocation::WatchPosition(GeoPositionCallback aCallback,
Move(aOptions),
static_cast<uint8_t>(mProtocolType), true, *aRv);
if (!sGeoEnabled) {
if (!sGeoEnabled || ShouldBlockInsecureRequests()) {
nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(false, request);
NS_DispatchToMainThread(ev);
return NS_OK;

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

@ -199,6 +199,10 @@ private:
// Check if clearWatch is already called
bool IsAlreadyCleared(nsGeolocationRequest* aRequest);
// Returns whether the Geolocation object should block requests
// within a context that is not secure.
bool ShouldBlockInsecureRequests() const;
// Two callback arrays. The first |mPendingCallbacks| holds objects for only
// one callback and then they are released/removed from the array. The second
// |mWatchingCallbacks| holds objects until the object is explictly removed or

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше