Bug 1164698 - Update Pocket code to latest version (May 13th code drop). r=dolske a=dolske
authorNate Weiner <nate@readitlater.com>
Wed, 13 May 2015 20:45:00 -0700
changeset 267452 0954ecdb1dd92896c068d34d55772e89afe5d00e
parent 267451 0c7b1e15da63ce60341249bc3ff5ca83304e9b2a
child 267453 843ba44b79682b39a62e818acb0cb055c0c2726e
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, dolske
bugs1164698
milestone39.0
Bug 1164698 - Update Pocket code to latest version (May 13th code drop). r=dolske a=dolske
browser/components/pocket/panels/js/signup.js
browser/components/pocket/pktApi.js
--- a/browser/components/pocket/panels/js/signup.js
+++ b/browser/components/pocket/panels/js/signup.js
@@ -182,16 +182,17 @@ PKT_SIGNUP_OVERLAY.prototype = {
             return;
         }
         this.active = true;
 
         // set translations
         this.getTranslations();
         this.dictJSON.fxasignedin = this.fxasignedin ? 1 : 0;
         this.dictJSON.variant = (this.variant ? this.variant : 'undefined');
+        this.dictJSON.variant += this.fxasignedin ? '_fxa' : '_nonfxa';
         this.dictJSON.pockethost = this.pockethost;
         this.dictJSON.showlearnmore = (this.variant.indexOf('_lm') > -1 || this.variant == 'storyboard' || this.variant == 'hero') ? 1 : 0;
 
         // extra modifier class for collapsed state
         if (this.inoverflowmenu)
         {
             $('body').addClass('pkt_ext_signup_overflow');
         }
--- a/browser/components/pocket/pktApi.js
+++ b/browser/components/pocket/pktApi.js
@@ -242,17 +242,19 @@ var pktApi = (function() {
     */
     function apiRequest(options) {
         if ((typeof options === "undefined") || (typeof options.path === "undefined")) {
             return false;
         }
 
         var url = baseAPIUrl + options.path;
         var data = options.data || {};
-        data.locale_lang = window.navigator.language;
+        data.locale_lang = Cc["@mozilla.org/chrome/chrome-registry;1"].
+             getService(Ci.nsIXULChromeRegistry).
+             getSelectedLocale("browser");
         data.consumer_key = oAuthConsumerKey;
 
         var request = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);
         request.open("POST", url, true);
 		request.onreadystatechange = function(e){
 			if (request.readyState == 4) {
 				if (request.status === 200) {
                     // There could still be an error if the response is no valid json