mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Backed out changeset 89a029b06eb1 (bug 1304306) for package failures and eslint failure. r=backout on a CLOSED TREE
This commit is contained in:
parent
a4f8405116
commit
a112ccc40d
@ -1579,7 +1579,6 @@ pref("services.sync.validation.enabled", true);
|
||||
|
||||
// Preferences for the form autofill system extension
|
||||
pref("browser.formautofill.experimental", false);
|
||||
pref("browser.formautofill.enabled", false);
|
||||
|
||||
// Enable safebrowsing v4 tables (suffixed by "-proto") update.
|
||||
#ifdef NIGHTLY_BUILD
|
||||
|
@ -32,14 +32,11 @@
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ProfileStorage",
|
||||
"resource://formautofill/ProfileStorage.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormAutofillPreferences",
|
||||
"resource://formautofill/FormAutofillPreferences.jsm");
|
||||
|
||||
const PROFILE_JSON_FILE_NAME = "autofill-profiles.json";
|
||||
|
||||
@ -60,8 +57,6 @@ let FormAutofillParent = {
|
||||
.getService(Ci.nsIMessageListenerManager);
|
||||
mm.addMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
mm.addMessageListener("FormAutofill:GetProfiles", this);
|
||||
|
||||
Services.obs.addObserver(this, "advanced-pane-loaded", false);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -82,20 +77,6 @@ let FormAutofillParent = {
|
||||
}
|
||||
},
|
||||
|
||||
observe: function(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "advanced-pane-loaded": {
|
||||
let formAutofillPreferences = new FormAutofillPreferences();
|
||||
let document = subject.document;
|
||||
let prefGroup = formAutofillPreferences.init(document);
|
||||
let parentNode = document.getElementById("mainPrefPane");
|
||||
let insertBeforeNode = document.getElementById("locationBarGroup");
|
||||
parentNode.insertBefore(prefGroup, insertBeforeNode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the instance of ProfileStorage. To avoid syncing issues, anyone
|
||||
* who needs to access the profile should request the instance by this instead
|
||||
@ -122,8 +103,6 @@ let FormAutofillParent = {
|
||||
.getService(Ci.nsIMessageListenerManager);
|
||||
mm.removeMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
mm.removeMessageListener("FormAutofill:GetProfiles", this);
|
||||
|
||||
Services.obs.removeObserver(this, "advanced-pane-loaded");
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1,137 +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/. */
|
||||
|
||||
/**
|
||||
* Creates form autofill preferences group.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const PREF_AUTOFILL_ENABLED = "browser.formautofill.enabled";
|
||||
|
||||
function FormAutofillPreferences() {
|
||||
this.bundle = Services.strings.createBundle(
|
||||
"chrome://formautofill/locale/formautofill.properties");
|
||||
}
|
||||
|
||||
FormAutofillPreferences.prototype = {
|
||||
/**
|
||||
* Check if Form Autofill feature is enabled.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isAutofillEnabled() {
|
||||
return Services.prefs.getBoolPref(PREF_AUTOFILL_ENABLED);
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the current page is Preferences/Privacy.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isPrivacyPane() {
|
||||
return this.refs.document.location.href == "about:preferences#privacy";
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the Form Autofill preference group.
|
||||
*
|
||||
* @param {XULDocument} document
|
||||
* @returns {XULElement}
|
||||
*/
|
||||
init(document) {
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
let formAutofillGroup = document.createElementNS(XUL_NS, "groupbox");
|
||||
let caption = document.createElementNS(XUL_NS, "caption");
|
||||
let captionLabel = document.createElementNS(XUL_NS, "label");
|
||||
let hbox = document.createElementNS(XUL_NS, "hbox");
|
||||
let enabledCheckbox = document.createElementNS(XUL_NS, "checkbox");
|
||||
let spacer = document.createElementNS(XUL_NS, "spacer");
|
||||
let savedProfilesBtn = document.createElementNS(XUL_NS, "button");
|
||||
|
||||
this.refs = {
|
||||
document,
|
||||
formAutofillGroup,
|
||||
enabledCheckbox,
|
||||
savedProfilesBtn,
|
||||
};
|
||||
|
||||
formAutofillGroup.id = "formAutofillGroup";
|
||||
formAutofillGroup.hidden = !this.isPrivacyPane;
|
||||
// Use .setAttribute because HTMLElement.dataset is not available on XUL elements
|
||||
formAutofillGroup.setAttribute("data-category", "panePrivacy");
|
||||
|
||||
captionLabel.textContent = this.bundle.GetStringFromName("preferenceGroupTitle");
|
||||
savedProfilesBtn.setAttribute("label", this.bundle.GetStringFromName("savedProfiles"));
|
||||
enabledCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableProfileAutofill"));
|
||||
|
||||
// Manually set the checked state
|
||||
if (this.isAutofillEnabled) {
|
||||
enabledCheckbox.setAttribute("checked", true);
|
||||
}
|
||||
|
||||
spacer.flex = 1;
|
||||
|
||||
formAutofillGroup.appendChild(caption);
|
||||
caption.appendChild(captionLabel);
|
||||
formAutofillGroup.appendChild(hbox);
|
||||
hbox.appendChild(enabledCheckbox);
|
||||
hbox.appendChild(spacer);
|
||||
hbox.appendChild(savedProfilesBtn);
|
||||
|
||||
this.attachEventListeners();
|
||||
|
||||
return formAutofillGroup;
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove event listeners and the preference group.
|
||||
*/
|
||||
uninit() {
|
||||
this.detachEventListeners();
|
||||
this.refs.formAutofillGroup.remove();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle events
|
||||
*
|
||||
* @param {DOMEvent} event
|
||||
*/
|
||||
handleEvent(event) {
|
||||
switch (event.type) {
|
||||
case "command": {
|
||||
let target = event.target;
|
||||
|
||||
if (target == this.refs.enabledCheckbox) {
|
||||
// Set preference directly instead of relying on <Preference>
|
||||
Services.prefs.setBoolPref(PREF_AUTOFILL_ENABLED, target.checked);
|
||||
} else if (target == this.refs.savedProfilesBtn) {
|
||||
// TODO: Open Saved Profiles dialog
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Attach event listener
|
||||
*/
|
||||
attachEventListeners() {
|
||||
this.refs.formAutofillGroup.addEventListener("command", this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove event listener
|
||||
*/
|
||||
detachEventListeners() {
|
||||
this.refs.formAutofillGroup.removeEventListener("command", this);
|
||||
},
|
||||
};
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["FormAutofillPreferences"];
|
@ -1,7 +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/.
|
||||
|
||||
preferenceGroupTitle = Form Autofill
|
||||
enableProfileAutofill = Enable Profile Autofill
|
||||
savedProfiles = Saved Profiles…
|
@ -1,8 +0,0 @@
|
||||
#filter substitution
|
||||
# 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/.
|
||||
|
||||
@AB_CD@.jar:
|
||||
% locale formautofill @AB_CD@ %locale/@AB_CD@/
|
||||
locale/@AB_CD@/ (en-US/*)
|
@ -1,7 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
@ -7,8 +7,6 @@
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
DIRS += ['locale']
|
||||
|
||||
FINAL_TARGET_FILES.features['formautofill@mozilla.org'] += [
|
||||
'bootstrap.js'
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user