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:44:53 -0700
changeset 260496 11c4678a21bb
parent 260495 f724af08988f
child 260497 195e873a8ab1
push id799
push userjdolske@mozilla.com
push date2015-05-14 03:46 +0000
treeherdermozilla-release@11c4678a21bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, dolske
bugs1164698
milestone38.0.1
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