Merge f-t to m-c, a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 31 Oct 2015 17:02:44 -0700
changeset 270547 96377bdbcdf3e444a22aeaa677da696243b00d98
parent 270541 e958f522a72c1d789f270bc4bea43869294b4a13 (current diff)
parent 270546 a095d36d85931e3d4c03627b2dae9480298ae3ea (diff)
child 270590 b28ff18cfcdc507c675ae59ae872cd64e89fcdc5
child 270591 085368f9b3ed8274ec8fd6814dc8a0b73bd39bf5
child 270651 4744545d275cb8fe6ffd365d29e35a7ae23f187a
push id29617
push userphilringnalda@gmail.com
push dateSun, 01 Nov 2015 00:21:31 +0000
treeherdermozilla-central@96377bdbcdf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone45.0a1
first release with
nightly linux32
96377bdbcdf3 / 45.0a1 / 20151101030343 / files
nightly linux64
96377bdbcdf3 / 45.0a1 / 20151101030343 / files
nightly mac
96377bdbcdf3 / 45.0a1 / 20151101030343 / files
nightly win32
96377bdbcdf3 / 45.0a1 / 20151101030343 / files
nightly win64
96377bdbcdf3 / 45.0a1 / 20151101030343 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge f-t to m-c, a=merge
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6963,16 +6963,21 @@ var gIdentityHandler = {
     return this._identityPopupContentVerif =
       document.getElementById("identity-popup-content-verifier");
   },
   get _identityPopupMixedContentLearnMore () {
     delete this._identityPopupMixedContentLearnMore;
     return this._identityPopupMixedContentLearnMore =
       document.getElementById("identity-popup-mcb-learn-more");
   },
+  get _identityPopupInsecureLoginFormsLearnMore () {
+    delete this._identityPopupInsecureLoginFormsLearnMore;
+    return this._identityPopupInsecureLoginFormsLearnMore =
+      document.getElementById("identity-popup-insecure-login-forms-learn-more");
+  },
   get _identityIconLabel () {
     delete this._identityIconLabel;
     return this._identityIconLabel = document.getElementById("identity-icon-label");
   },
   get _overrideService () {
     delete this._overrideService;
     return this._overrideService = Cc["@mozilla.org/security/certoverride;1"]
                                      .getService(Ci.nsICertOverrideService);
@@ -7284,20 +7289,22 @@ var gIdentityHandler = {
   },
 
   /**
    * Set up the title and content messages for the identity message popup,
    * based on the specified mode, and the details of the SSL cert, where
    * applicable
    */
   refreshIdentityPopup() {
-    // Update the "Learn More" hrefs for Mixed Content Blocking.
+    // Update "Learn More" for Mixed Content Blocking and Insecure Login Forms.
     let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
-    let learnMoreHref = `${baseURL}mixed-content`;
-    this._identityPopupMixedContentLearnMore.setAttribute("href", learnMoreHref);
+    this._identityPopupMixedContentLearnMore
+        .setAttribute("href", baseURL + "mixed-content");
+    this._identityPopupInsecureLoginFormsLearnMore
+        .setAttribute("href", baseURL + "insecure-password");
 
     // Determine connection security information.
     let connection = "not-secure";
     if (this._isSecureInternalUI) {
       connection = "chrome";
     } else if (this._isURILoadedFromFile) {
       connection = "file";
     } else if (this._isEV) {
--- a/browser/base/content/test/general/browser_insecureLoginForms.js
+++ b/browser/base/content/test/general/browser_insecureLoginForms.js
@@ -50,16 +50,19 @@ add_task(function* test_simple() {
          "url(\"chrome://browser/skin/identity-mixed-active-loaded.svg\")",
          "Using expected icon image in the identity block");
       is(securityViewBG,
          "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
          "Using expected icon image in the Control Center main view");
       is(securityContentBG,
          "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
          "Using expected icon image in the Control Center subview");
+      is(Array.filter(document.querySelectorAll("[observes=identity-popup-insecure-login-forms-learn-more]"),
+                      element => !is_hidden(element)).length, 1,
+         "The 'Learn more' link should be visible once.");
     }
 
     // Messages should be visible when the scheme is HTTP, and invisible when
     // the scheme is HTTPS.
     is(Array.every(document.querySelectorAll("[when-loginforms=insecure]"),
                    element => !is_hidden(element)),
        scheme == "http",
        "The relevant messages should visible or hidden.");
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -7,16 +7,17 @@
        hidden="true"
        onpopupshown="gIdentityHandler.onPopupShown(event);"
        onpopuphidden="gIdentityHandler.onPopupHidden(event);"
        orient="vertical">
 
   <broadcasterset>
     <broadcaster id="identity-popup-content-host" class="identity-popup-headline" crop="start"/>
     <broadcaster id="identity-popup-mcb-learn-more" class="text-link plain" value="&identity.learnMore;"/>
+    <broadcaster id="identity-popup-insecure-login-forms-learn-more" class="text-link plain" value="&identity.learnMore;"/>
   </broadcasterset>
 
   <panelmultiview id="identity-popup-multiView"
                   mainViewId="identity-popup-mainView">
     <panelview id="identity-popup-mainView" flex="1">
 
       <!-- Security Section -->
       <hbox id="identity-popup-security" class="identity-popup-section">
@@ -116,17 +117,17 @@
         <description id="identity-popup-content-verifier"
                      when-connection="secure secure-ev"/>
 
         <!-- Connection is Not Secure -->
         <description when-connection="not-secure"
                      and-when-loginforms="secure">&identity.description.insecure;</description>
 
         <!-- Insecure login forms -->
-        <description when-loginforms="insecure">&identity.description.insecureLoginForms;</description>
+        <description when-loginforms="insecure">&identity.description.insecureLoginForms; <label observes="identity-popup-insecure-login-forms-learn-more"/></description>
 
         <!-- Weak Cipher -->
         <description when-ciphers="weak">&identity.description.weakCipher;</description>
         <description class="identity-popup-warning-yellow"
                      when-ciphers="weak">&identity.description.weakCipher2;</description>
 
         <!-- Active Mixed Content Blocked -->
         <description class="identity-popup-warning-gray"
--- a/browser/components/loop/content/css/panel.css
+++ b/browser/components/loop/content/css/panel.css
@@ -5,16 +5,24 @@ html {
   font-size: 10px;
   font-family: menu;
 }
 
 body {
   background: none;
 }
 
+/* Beta Ribbon */
+.beta-ribbon {
+  background: url("../shared/img/beta-ribbon.svg") no-repeat;
+  background-size: 30px;
+  width: 30px;
+  height: 30px;
+}
+
 /* Panel styles */
 
 .panel {
   /* hide the extra margin space that the panel resizer now wants to show */
   overflow: hidden;
   font: menu;
   background-color: #fbfbfb;
   height: 410px;
@@ -25,16 +33,23 @@ body {
 .panel-content {
   height: 410px;
   width: 330px;
   display: flex;
   flex-flow: column nowrap;
   align-items: flex-start;
 }
 
+.panel-content > .beta-ribbon {
+  position: fixed;
+  left: 0;
+  top: 0;
+  z-index: 1000;
+}
+
 /* Notifications displayed over tabs */
 
 .panel .messages {
   width: 100%;
   margin: 0;
 }
 
 .panel .messages .alert {
--- a/browser/components/loop/content/js/panel.js
+++ b/browser/components/loop/content/js/panel.js
@@ -801,19 +801,17 @@ loop.panel = (function(_, mozL10n) {
           previewImage: previewImage,
           description: description,
           url: url
         });
       }.bind(this));
     },
 
     handleCreateButtonClick: function() {
-      var createRoomAction = new sharedActions.CreateRoom({
-        nameTemplate: mozL10n.get("rooms_default_room_name_template")
-      });
+      var createRoomAction = new sharedActions.CreateRoom();
 
       createRoomAction.urls = [{
         location: this.state.url,
         description: this.state.description,
         thumbnail: this.state.previewImage
       }];
       this.props.dispatcher.dispatch(createRoomAction);
     },
@@ -939,16 +937,17 @@ loop.panel = (function(_, mozL10n) {
       }
 
       if (!this.state.hasEncryptionKey) {
         return React.createElement(SignInRequestView, {mozLoop: this.props.mozLoop});
       }
 
       return (
         React.createElement("div", {className: "panel-content"}, 
+          React.createElement("div", {className: "beta-ribbon"}), 
           React.createElement(NotificationListView, {
             clearOnDocumentHidden: true, 
             notifications: this.props.notifications}), 
             React.createElement(RoomList, {dispatcher: this.props.dispatcher, 
               mozLoop: this.props.mozLoop, 
               store: this.props.roomStore}), 
           React.createElement("div", {className: "footer"}, 
             React.createElement("div", {className: "user-details"}, 
--- a/browser/components/loop/content/js/panel.jsx
+++ b/browser/components/loop/content/js/panel.jsx
@@ -801,19 +801,17 @@ loop.panel = (function(_, mozL10n) {
           previewImage: previewImage,
           description: description,
           url: url
         });
       }.bind(this));
     },
 
     handleCreateButtonClick: function() {
-      var createRoomAction = new sharedActions.CreateRoom({
-        nameTemplate: mozL10n.get("rooms_default_room_name_template")
-      });
+      var createRoomAction = new sharedActions.CreateRoom();
 
       createRoomAction.urls = [{
         location: this.state.url,
         description: this.state.description,
         thumbnail: this.state.previewImage
       }];
       this.props.dispatcher.dispatch(createRoomAction);
     },
@@ -939,16 +937,17 @@ loop.panel = (function(_, mozL10n) {
       }
 
       if (!this.state.hasEncryptionKey) {
         return <SignInRequestView mozLoop={this.props.mozLoop} />;
       }
 
       return (
         <div className="panel-content">
+          <div className="beta-ribbon" />
           <NotificationListView
             clearOnDocumentHidden={true}
             notifications={this.props.notifications} />
             <RoomList dispatcher={this.props.dispatcher}
               mozLoop={this.props.mozLoop}
               store={this.props.roomStore} />
           <div className="footer">
             <div className="user-details">
--- a/browser/components/loop/content/js/roomStore.js
+++ b/browser/components/loop/content/js/roomStore.js
@@ -235,73 +235,36 @@ loop.store = loop.store || {};
         })
         .slice()
         .sort(function(a, b) {
           return b.ctime - a.ctime;
         });
     },
 
     /**
-     * Finds the next available room number in the provided room list.
-     *
-     * @param  {String} nameTemplate The room name template; should contain a
-     *                               {{conversationLabel}} placeholder.
-     * @return {Number}
-     */
-    findNextAvailableRoomNumber: function(nameTemplate) {
-      var searchTemplate = nameTemplate.replace("{{conversationLabel}}", "");
-      var searchRegExp = new RegExp("^" + searchTemplate + "(\\d+)$");
-
-      var roomNumbers = this._storeState.rooms.map(function(room) {
-        var match = searchRegExp.exec(room.decryptedContext.roomName);
-        return match && match[1] ? parseInt(match[1], 10) : 0;
-      });
-
-      if (!roomNumbers.length) {
-        return 1;
-      }
-
-      return Math.max.apply(null, roomNumbers) + 1;
-    },
-
-    /**
-     * Generates a room names against the passed template string.
-     *
-     * @param  {String} nameTemplate The room name template.
-     * @return {String}
-     */
-    _generateNewRoomName: function(nameTemplate) {
-      var roomLabel = this.findNextAvailableRoomNumber(nameTemplate);
-      return nameTemplate.replace("{{conversationLabel}}", roomLabel);
-    },
-
-    /**
      * Creates a new room.
      *
      * @param {sharedActions.CreateRoom} actionData The new room information.
      */
     createRoom: function(actionData) {
       this.setStoreState({
         pendingCreation: true,
         error: null
       });
 
       var roomCreationData = {
-        decryptedContext: {
-          roomName: this._generateNewRoomName(actionData.nameTemplate)
-        },
+        decryptedContext: {},
         maxSize: this.maxRoomCreationSize
       };
 
       if ("urls" in actionData) {
         roomCreationData.decryptedContext.urls = actionData.urls;
       }
 
       this._notifications.remove("create-room-error");
-
       this._mozLoop.rooms.create(roomCreationData, function(err, createdRoom) {
         var buckets = this._mozLoop.ROOM_CREATE;
         if (err) {
           this._mozLoop.telemetryAddValue("LOOP_ROOM_CREATE", buckets.CREATE_FAIL);
           this.dispatchAction(new sharedActions.CreateRoomError({ error: err }));
           return;
         }
 
--- a/browser/components/loop/content/shared/js/actions.js
+++ b/browser/components/loop/content/shared/js/actions.js
@@ -236,19 +236,16 @@ loop.shared.actions = (function() {
       // srcMediaElement: Object (only present if receiving is true)
     }),
 
     /**
      * Creates a new room.
      * XXX: should move to some roomActions module - refs bug 1079284
      */
     CreateRoom: Action.define("createRoom", {
-      // The localized template to use to name the new room
-      // (eg. "Conversation {{conversationLabel}}").
-      nameTemplate: String
       // See https://wiki.mozilla.org/Loop/Architecture/Context#Format_of_context.value
       // urls: Object - Optional
     }),
 
     /**
      * When a room has been created.
      * XXX: should move to some roomActions module - refs bug 1079284
      */
--- a/browser/components/loop/test/desktop-local/panel_test.js
+++ b/browser/components/loop/test/desktop-local/panel_test.js
@@ -995,17 +995,16 @@ describe("loop.panel", function() {
       // Simulate being visible
       view.onDocumentVisible();
 
       var node = view.getDOMNode();
 
       TestUtils.Simulate.click(node.querySelector(".new-room-button"));
 
       sinon.assert.calledWith(dispatch, new sharedActions.CreateRoom({
-        nameTemplate: "Fake title",
         urls: [{
           location: "http://invalid.com",
           description: "fakeSite",
           thumbnail: favicon
         }]
       }));
     });
 
--- a/browser/components/loop/test/desktop-local/roomStore_test.js
+++ b/browser/components/loop/test/desktop-local/roomStore_test.js
@@ -209,64 +209,25 @@ describe("loop.store.RoomStore", functio
         it("should clear the list of rooms", function() {
           fakeMozLoop.rooms.trigger("refresh", "refresh");
 
           expect(store.getStoreState().rooms).to.have.length.of(0);
         });
       });
     });
 
-    describe("#findNextAvailableRoomNumber", function() {
-      var fakeNameTemplate = "RoomWord {{conversationLabel}}";
-
-      it("should find next available room number from an empty room list",
-        function() {
-          store.setStoreState({ rooms: [] });
-
-          expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(1);
-        });
-
-      it("should find next available room number from a non empty room list",
-        function() {
-          store.setStoreState({
-            rooms: [{ decryptedContext: { roomName: "RoomWord 1" } }]
-          });
-
-          expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(2);
-        });
-
-      it("should not be sensitive to initial list order", function() {
-        store.setStoreState({
-          rooms: [{
-            decryptedContext: {
-              roomName: "RoomWord 99"
-            }
-          }, {
-            decryptedContext: {
-              roomName: "RoomWord 98"
-            }
-          }]
-        });
-
-        expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(100);
-      });
-    });
-
     describe("#createRoom", function() {
-      var fakeNameTemplate = "Conversation {{conversationLabel}}";
       var fakeLocalRoomId = "777";
       var fakeOwner = "fake@invalid";
       var fakeRoomCreationData;
 
       beforeEach(function() {
         sandbox.stub(dispatcher, "dispatch");
         store.setStoreState({ pendingCreation: false, rooms: [] });
-        fakeRoomCreationData = {
-          nameTemplate: fakeNameTemplate
-        };
+        fakeRoomCreationData = {};
       });
 
       it("should clear any existing room errors", function() {
         sandbox.stub(fakeMozLoop.rooms, "create");
 
         store.createRoom(new sharedActions.CreateRoom(fakeRoomCreationData));
 
         sinon.assert.calledOnce(fakeNotifications.remove);
@@ -293,19 +254,17 @@ describe("loop.store.RoomStore", functio
       });
 
       it("should request creation of a new room", function() {
         sandbox.stub(fakeMozLoop.rooms, "create");
 
         store.createRoom(new sharedActions.CreateRoom(fakeRoomCreationData));
 
         sinon.assert.calledWith(fakeMozLoop.rooms.create, {
-          decryptedContext: {
-            roomName: "Conversation 1"
-          },
+          decryptedContext: { },
           maxSize: store.maxRoomCreationSize
         });
       });
 
       it("should request creation of a new room with context", function() {
         sandbox.stub(fakeMozLoop.rooms, "create");
 
         fakeRoomCreationData.urls = [{
@@ -313,17 +272,16 @@ describe("loop.store.RoomStore", functio
           description: "fakeSite",
           thumbnail: "fakeimage.png"
         }];
 
         store.createRoom(new sharedActions.CreateRoom(fakeRoomCreationData));
 
         sinon.assert.calledWith(fakeMozLoop.rooms.create, {
           decryptedContext: {
-            roomName: "Conversation 1",
             urls: [{
               location: "http://invalid.com",
               description: "fakeSite",
               thumbnail: "fakeimage.png"
             }]
           },
           maxSize: store.maxRoomCreationSize
         });
--- a/browser/locales/en-US/chrome/browser/loop/loop.properties
+++ b/browser/locales/en-US/chrome/browser/loop/loop.properties
@@ -174,19 +174,16 @@ feedback_rejoin_button=Rejoin
 ## an abusive user.
 feedback_report_user_button=Report User
 feedback_window_heading=How was your conversation?
 feedback_request_button=Leave Feedback
 
 help_label=Help
 tour_label=Tour
 
-## LOCALIZATION NOTE(rooms_default_room_name_template): {{conversationLabel}}
-## will be replaced by a number. For example "Conversation 1" or "Conversation 12".
-rooms_default_room_name_template=Conversation {{conversationLabel}}
 rooms_leave_button_label=Leave
 ## LOCALIZATION NOTE (rooms_list_recently_browsed): String is in all caps
 ## for emphasis reasons, it is a heading. Proceed as appropriate for locale.
 rooms_list_recently_browsed=RECENTLY BROWSED
 ## LOCALIZATION NOTE (rooms_list_currently_browsing): String is in all caps
 ## for emphasis reasons, it is a heading. Proceed as appropriate for locale.
 rooms_list_currently_browsing=CURRENTLY BROWSING
 rooms_change_failed_label=Conversation cannot be updated
--- a/mobile/android/base/sync/repositories/domain/FormHistoryRecord.java
+++ b/mobile/android/base/sync/repositories/domain/FormHistoryRecord.java
@@ -17,17 +17,17 @@ import org.mozilla.gecko.sync.repositori
  * @see "<a href='http://mxr.mozilla.org/services-central/source/services-central/services/sync/modules/engines/forms.js'>http://mxr.mozilla.org/services-central/source/services-central/services/sync/modules/engines/forms.js</a>."
  */
 public class FormHistoryRecord extends Record {
   private static final String LOG_TAG = "FormHistoryRecord";
 
   public static final String  COLLECTION_NAME = "forms";
   private static final String PAYLOAD_NAME    = "name";
   private static final String PAYLOAD_VALUE   = "value";
-  public static final long FORMS_TTL = 60 * 24 * 60 * 60; // 60 days in seconds.
+  public static final long FORMS_TTL = 3 * 365 * 24 * 60 * 60;   // Three years in seconds.
 
   /**
    * The name of the saved form field.
    */
   public String fieldName;
 
   /**
    * The value of the saved form field.
--- a/services/sync/modules/engines/forms.js
+++ b/services/sync/modules/engines/forms.js
@@ -11,17 +11,17 @@ var Cu = Components.utils;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-common/async.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://gre/modules/Log.jsm");
 
-const FORMS_TTL = 5184000; // 60 days
+const FORMS_TTL = 3 * 365 * 24 * 60 * 60;   // Three years in seconds.
 
 this.FormRec = function FormRec(collection, id) {
   CryptoWrapper.call(this, collection, id);
 }
 FormRec.prototype = {
   __proto__: CryptoWrapper.prototype,
   _logName: "Sync.Record.Form",
   ttl: FORMS_TTL