From 95a154b9cceb1e3619651a88df6991468a7d3c23 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Mon, 28 Aug 2017 13:34:21 +0200 Subject: [PATCH] Backed out changeset 1d4c737cf76d (bug 1371113) for frequently failing browser-chrome's browser/base/content/test/performance/browser_startup.js. r=backout --- .../formautofill/FormAutofillDoorhanger.jsm | 74 ++++--------------- .../formautofill/content/icon-credit-card.svg | 8 -- .../locales/en-US/formautofill.properties | 10 +-- 3 files changed, 18 insertions(+), 74 deletions(-) delete mode 100644 browser/extensions/formautofill/content/icon-credit-card.svg diff --git a/browser/extensions/formautofill/FormAutofillDoorhanger.jsm b/browser/extensions/formautofill/FormAutofillDoorhanger.jsm index 01e7f92d05ba..c8cb06cb19cc 100644 --- a/browser/extensions/formautofill/FormAutofillDoorhanger.jsm +++ b/browser/extensions/formautofill/FormAutofillDoorhanger.jsm @@ -26,12 +26,10 @@ FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]); const BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties"; const GetStringFromName = Services.strings.createBundle(BUNDLE_URI).GetStringFromName; let changeAutofillOptsKey = "changeAutofillOptions"; -let autofillOptsKey = "autofillOptionsLink"; -let autofillSecurityOptionsKey = "autofillSecurityOptionsLink"; -if (AppConstants.platform == "macosx") { +let viewAutofillOptsKey = "viewAutofillOptionsLink"; +if (AppConstants.platform != "macosx") { changeAutofillOptsKey += "OSX"; - autofillOptsKey += "OSX"; - autofillSecurityOptionsKey += "OSX"; + viewAutofillOptsKey += "OSX"; } const CONTENT = { @@ -71,7 +69,6 @@ const CONTENT = { update: { notificationId: "autofill-address", message: GetStringFromName("updateAddressMessage"), - linkMessage: GetStringFromName(autofillOptsKey), anchor: { id: "autofill-address-notification-icon", URL: "chrome://formautofill/content/formfill-anchor.svg", @@ -92,34 +89,6 @@ const CONTENT = { popupIconURL: "chrome://formautofill/content/icon-address-update.svg", }, }, - creditCard: { - notificationId: "autofill-credit-card", - message: GetStringFromName("saveCreditCardMessage"), - linkMessage: GetStringFromName(autofillSecurityOptionsKey), - anchor: { - id: "autofill-credit-card-notification-icon", - URL: "chrome://formautofill/content/formfill-anchor.svg", - tooltiptext: GetStringFromName("openAutofillMessagePanel"), - }, - mainAction: { - label: GetStringFromName("saveCreditCardLabel"), - accessKey: "S", - callbackState: "save", - }, - secondaryActions: [{ - label: GetStringFromName("cancelCreditCardLabel"), - accessKey: "D", - callbackState: "cancel", - }, { - label: GetStringFromName("disableCreditCardLabel"), - accessKey: "N", - callbackState: "disable", - }], - options: { - persistWhileVisible: true, - popupIconURL: "chrome://formautofill/content/icon-credit-card.svg", - }, - }, }; let FormAutofillDoorhanger = { @@ -167,10 +136,8 @@ let FormAutofillDoorhanger = { * Target browser element for showing doorhanger. * @param {string} id * The ID of the doorhanger. - * @param {string} message - * The localized string for link title. */ - _appendPrivacyPanelLink(browser, id, message) { + _appendPrivacyPanelLink(browser, id) { let notificationId = id + "-notification"; let chromeDoc = browser.ownerDocument; let notification = chromeDoc.getElementById(notificationId); @@ -181,7 +148,7 @@ let FormAutofillDoorhanger = { privacyLinkElement.className = "text-link"; privacyLinkElement.setAttribute("useoriginprincipal", true); privacyLinkElement.setAttribute("href", "about:preferences#privacy"); - privacyLinkElement.setAttribute("value", message); + privacyLinkElement.setAttribute("value", GetStringFromName(viewAutofillOptsKey)); notificationcontent.appendChild(privacyLinkElement); notification.append(notificationcontent); } @@ -254,22 +221,13 @@ let FormAutofillDoorhanger = { async show(browser, type) { log.debug("show doorhanger with type:", type); return new Promise((resolve) => { - let { - notificationId, - message, - linkMessage, - anchor, - mainAction, - secondaryActions, - options, - } = CONTENT[type]; - + let content = CONTENT[type]; let chromeWin = browser.ownerGlobal; - options.eventCallback = (topic) => { + content.options.eventCallback = (topic) => { log.debug("eventCallback:", topic); if (topic == "removed" || topic == "dismissed") { - this._removeCheckboxListener(browser, {notificationId, options}); + this._removeCheckboxListener(browser, content); return; } @@ -277,23 +235,23 @@ let FormAutofillDoorhanger = { if (topic != "shown") { return; } - this._addCheckboxListener(browser, {notificationId, options}); + this._addCheckboxListener(browser, content); // There's no preferences link or other customization in first time use doorhanger. if (type == "firstTimeUse") { return; } - this._appendPrivacyPanelLink(browser, notificationId, linkMessage); + this._appendPrivacyPanelLink(browser, content.notificationId); }; - this._setAnchor(browser, anchor); + this._setAnchor(browser, content.anchor); chromeWin.PopupNotifications.show( browser, - notificationId, - message, - anchor.id, - ...this._createActions(mainAction, secondaryActions, resolve), - options, + content.notificationId, + content.message, + content.anchor.id, + ...this._createActions(content.mainAction, content.secondaryActions, resolve), + content.options, ); }); }, diff --git a/browser/extensions/formautofill/content/icon-credit-card.svg b/browser/extensions/formautofill/content/icon-credit-card.svg deleted file mode 100644 index 3ba136897641..000000000000 --- a/browser/extensions/formautofill/content/icon-credit-card.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/browser/extensions/formautofill/locales/en-US/formautofill.properties b/browser/extensions/formautofill/locales/en-US/formautofill.properties index ace30005944e..5d4b933d6459 100644 --- a/browser/extensions/formautofill/locales/en-US/formautofill.properties +++ b/browser/extensions/formautofill/locales/en-US/formautofill.properties @@ -8,20 +8,14 @@ savedAddresses = Saved Addresses… enableCreditCardAutofill = Autofill credit cards savedCreditCards = Saved Credit Cards… saveAddressesMessage = Firefox now saves addresses so you can fill out forms faster. -autofillOptionsLink = Form Autofill Options -autofillSecurityOptionsLink = Form Autofill & Security Options +viewAutofillOptionsLink = View Form Autofill Options changeAutofillOptions = Change Form Autofill Options -autofillOptionsLinkOSX = Form Autofill Preferences -autofillSecurityOptionsLinkOSX = Form Autofill & Security Preferences +viewAutofillOptionsLinkOSX = View Form Autofill Preferences changeAutofillOptionsOSX = Change Form Autofill Preferences addressesSyncCheckbox = Share addresses with synced devices updateAddressMessage = Would you like to update your address with this new information? createAddressLabel = Create New Address updateAddressLabel = Update Address -saveCreditCardMessage = Would you like Firefox to save this credit card? (Security code will not be saved) -saveCreditCardLabel = Save Credit Card -cancelCreditCardLabel = Don’t Save -disableCreditCardLabel = Never Save credit Cards openAutofillMessagePanel = Open Form Autofill message panel autocompleteFooterOption = Form Autofill Options autocompleteFooterOptionShort = More Options