Bug 969045 - Add feedback item in Settings charm. r=mbrubeck, a=sledru
authorSam Foster <sfoster@mozilla.com>
Fri, 07 Feb 2014 09:35:03 -0800
changeset 182853 3b7e60dc640c220a79233448e34a0a5973705555
parent 182852 ab0a84051348e75d4405e1a1a9b878c271bfa345
child 182854 452f9c9477d25d910fe11a6f397a2e53acf56231
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, sledru
bugs969045
milestone29.0a2
Bug 969045 - Add feedback item in Settings charm. r=mbrubeck, a=sledru
browser/metro/base/content/browser-ui.js
browser/metro/base/content/browser.xul
browser/metro/base/content/flyoutpanels/SettingsCharm.js
browser/metro/locales/jar.mn
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -43,16 +43,17 @@ let Elements = {};
   ["browsers",           "browsers"],
   ["navbar",             "navbar"],
   ["autocomplete",       "urlbar-autocomplete"],
   ["contextappbar",      "contextappbar"],
   ["findbar",            "findbar"],
   ["contentViewport",    "content-viewport"],
   ["progress",           "progress-control"],
   ["progressContainer",  "progress-container"],
+  ["feedbackLabel",  "feedback-label"],
 ].forEach(function (aElementGlobal) {
   let [name, id] = aElementGlobal;
   XPCOMUtils.defineLazyGetter(Elements, name, function() {
     return document.getElementById(id);
   });
 });
 
 /**
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -25,16 +25,18 @@
 <!ENTITY % searchPanelDTD SYSTEM "chrome://browser/locale/searchPanel.dtd">
 %searchPanelDTD;
 #ifdef MOZ_SERVICES_SYNC
 <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
 %syncBrandDTD;
 <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/sync.dtd">
 %syncDTD;
 #endif
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
 ]>
 
 <window id="main-window"
         onload="Browser.startup();"
         onunload="Browser.shutdown();"
         windowtype="navigator:browser"
         chromedir="&locale.dir;"
         title="&brandShortName;"
@@ -847,10 +849,11 @@ Desktop browser's sync prefs.
     </box>
 
     <box id="autofill-container" class="menu-container" hidden="true">
       <vbox id="autofill-popup" class="menu-popup">
         <richlistbox id="menupopup-commands" onclick="if (event.target != this) AutofillMenuUI.selectByIndex(this.selectedIndex);" flex="1"/>
       </vbox>
     </box>
   </stack>
-
+  <!-- XXX: Expose feedback string to SettingsCharm.js -->
+  <label value="&helpFeedbackPage.label;" id="feedback-label" href="https://input.mozilla.org/feedback/metrofirefox" hidden="true"/>
 </window>
--- a/browser/metro/base/content/flyoutpanels/SettingsCharm.js
+++ b/browser/metro/base/content/flyoutpanels/SettingsCharm.js
@@ -47,16 +47,27 @@ var SettingsCharm = {
 */
 
     // About
     this.addEntry({
         label: Strings.browser.GetStringFromName("aboutCharm1"),
         onselected: function() FlyoutPanelsUI.show('AboutFlyoutPanel')
     });
 
+    // Feedback
+    this.addEntry({
+        // feedbackLabel is a temporary measure to expose this string
+        // from the baseMenuOverlay.dtd
+        label: Elements.feedbackLabel.value,
+        onselected: function() {
+          let url = Elements.feedbackLabel.getAttribute("href");
+          BrowserUI.addAndShowTab(url, Browser.selectedTab);
+        }
+    });
+
     // Help
     this.addEntry({
         label: Strings.browser.GetStringFromName("helpOnlineCharm"),
         onselected: function() {
           let url = Services.urlFormatter.formatURLPref("app.support.baseURL");
           BrowserUI.addAndShowTab(url, Browser.selectedTab);
         }
     });
--- a/browser/metro/locales/jar.mn
+++ b/browser/metro/locales/jar.mn
@@ -34,12 +34,14 @@
 
 #
 # Browser jar resources
 #
 
 @AB_CD@.jar:
 relativesrcdir browser/locales:
   locale/browser/syncBrand.dtd            (%chrome/browser/syncBrand.dtd)
+# Temporary hack to provide a 'feedback' string
+  locale/browser/baseMenuOverlay.dtd      (%chrome/browser/baseMenuOverlay.dtd)
   locale/browser/netError.dtd             (%chrome/overrides/netError.dtd)
 % override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
   locale/browser/appstrings.properties    (%chrome/overrides/appstrings.properties)
 % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties