Bug 1071117 - Add support to distinguish organic and inorganic feedback. r=margaret, a=sledru
authorvivek <vivekb.balakrishnan@gmail.com>
Tue, 14 Oct 2014 13:35:00 +0200
changeset 233340 0ca6566292488e44e926a752c51ff44ef3d05bd1
parent 233339 952539b39a1ee86580cb0be9dbd7c9e0ba068902
child 233341 5d9ba2f4685760d73c1872c707ca7c68647b5ca2
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, sledru
bugs1071117
milestone35.0a2
Bug 1071117 - Add support to distinguish organic and inorganic feedback. r=margaret, a=sledru
mobile/android/chrome/content/Feedback.js
mobile/android/chrome/content/aboutFeedback.js
--- a/mobile/android/chrome/content/Feedback.js
+++ b/mobile/android/chrome/content/Feedback.js
@@ -7,12 +7,12 @@ var Feedback = {
   observe: function(aMessage, aTopic, aData) {
     if (aTopic !== "Feedback:Show")
       return;
 
     // Only prompt for feedback if this isn't a distribution build.
     try {
       Services.prefs.getCharPref("distribution.id");
     } catch (e) {
-      BrowserApp.addTab("about:feedback", { selected: true, parentId: BrowserApp.selectedTab.id });
+      BrowserApp.addTab("about:feedback?source=feedback-prompt", { selected: true, parentId: BrowserApp.selectedTab.id });
     }
   }
 };
--- a/mobile/android/chrome/content/aboutFeedback.js
+++ b/mobile/android/chrome/content/aboutFeedback.js
@@ -140,16 +140,25 @@ function sendFeedback(aEvent) {
 
   data["device"] = Services.sysinfo.get("device");
   data["manufacturer"] = Services.sysinfo.get("manufacturer");
   data["platform"] = Services.appinfo.OS;
   data["version"] = Services.appinfo.version;
   data["locale"] = Services.locale.getSystemLocale().getCategory("NSILOCALE_CTYPE");
   data["channel"] = UpdateChannel.get();
 
+  // Source field is added only when Fennec prompts the user.
+  let getParam = window.location.href.split("?");
+  if (getParam.length > 1) {
+    let urlParam = new URLSearchParams(getParam[1]);
+    if(urlParam.get("source")) {
+      data["source"] = urlParam.get("source");
+    }
+  }
+
   let req = new XMLHttpRequest();
   req.addEventListener("error", function() {
 	Cu.reportError("Error sending feedback to input.mozilla.org: " + req.statusText);
   }, false);
   req.addEventListener("abort", function() {
 	Cu.reportError("Aborted sending feedback to input.mozilla.org: " + req.statusText);
   }, false);