Bug 1333256 - Bring back the insecure field warning Learn More text in bold on beta. r=seanlee l10n=flod a=jcristau
☠☠ backed out by dd9844a556dc ☠ ☠
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 26 Jan 2017 15:53:39 -0800
changeset 353972 147b55311d5350e6d7022d031f725934d6c717a0
parent 353971 95e076f66b6b41ded3d6fb0662dec35524a714ba
child 353973 a47bf8042441aad067971bb6793efbc33fa8080f
push id6849
push usercbook@mozilla.com
push dateTue, 31 Jan 2017 15:52:37 +0000
treeherdermozilla-esr52@147b55311d53 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseanlee, jcristau
bugs1333256
milestone52.0
Bug 1333256 - Bring back the insecure field warning Learn More text in bold on beta. r=seanlee l10n=flod a=jcristau MozReview-Commit-ID: 8Z6pKwFqk3M
toolkit/components/passwordmgr/LoginManagerContent.jsm
toolkit/content/widgets/autocomplete.xml
toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
@@ -1314,17 +1314,18 @@ UserAutoCompleteResult.prototype = {
   },
 
   getLabelAt(index) {
     if (index < 0 || index >= this.matchCount) {
       throw new Error("Index out of range.");
     }
 
     if (this._showInsecureFieldWarning && index === 0) {
-      return this._stringBundle.GetStringFromName("insecureFieldWarningDescription");
+      return this._stringBundle.GetStringFromName("insecureFieldWarningDescription") + " " +
+        this._stringBundle.GetStringFromName("insecureFieldWarningLearnMore");
     }
 
     let that = this;
 
     function getLocalizedString(key, formatArgs) {
       if (formatArgs) {
         return that._stringBundle.formatStringFromName(key, formatArgs, formatArgs.length);
       }
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -1531,16 +1531,37 @@ extends="chrome://global/content/binding
 
     <implementation>
       <constructor><![CDATA[
         // Unlike other autocomplete items, the height of the insecure warning
         // increases by wrapping. So "forceHandleUnderflow" is for container to
         // recalculate an item's height and width.
         this.classList.add("forceHandleUnderflow");
       ]]></constructor>
+
+      <property name="_learnMoreString">
+        <getter><![CDATA[
+          if (!this.__learnMoreString) {
+            this.__learnMoreString =
+              Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties").
+              GetStringFromName("insecureFieldWarningLearnMore");
+          }
+          return this.__learnMoreString;
+        ]]></getter>
+      </property>
+
+      <method name="_getSearchTokens">
+        <parameter name="aSearch"/>
+        <body>
+          <![CDATA[
+            return [this._learnMoreString.toLowerCase()];
+          ]]>
+        </body>
+      </method>
+
     </implementation>
   </binding>
 
   <binding id="autocomplete-richlistitem" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
 
     <content align="center"
              onoverflow="this._onOverflow();"
              onunderflow="this._onUnderflow();">
--- a/toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
+++ b/toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
@@ -62,9 +62,9 @@ loginsDescriptionFiltered=The following 
 loginHostAge=%1$S (%2$S)
 # LOCALIZATION NOTE (noUsername):
 # String is used on the context menu when a login doesn't have a username.
 noUsername=No username
 duplicateLoginTitle=Login already exists
 duplicateLogin=A duplicate login already exists.
 
 insecureFieldWarningDescription = This connection is not secure. Logins entered here could be compromised.
-insecureFieldWarningLearnMore = Learn More
+insecureFieldWarningLearnMore = Learn More