Bug 1081296 - Add sumo link for promotional translation doorhanger. r=florian
authorFelipe Gomes <felipc@gmail.com>
Fri, 10 Oct 2014 17:37:51 -0300
changeset 233118 3e779f1cf1d9c24484844184cbe659cf50d8326f
parent 233117 562ae8bddcd5d956e0c4fcc1bb31e83b95e1902b
child 233119 24ffba42510dae9ee20a80849772349b9a1ddf1b
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)
reviewersflorian
bugs1081296
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1081296 - Add sumo link for promotional translation doorhanger. r=florian
browser/components/translation/translation-infobar.xml
--- a/browser/components/translation/translation-infobar.xml
+++ b/browser/components/translation/translation-infobar.xml
@@ -26,17 +26,18 @@
           <xul:panel anonid="welcomePanel" class="translation-welcome-panel"
                      type="arrow" align="start">
             <xul:image class="translation-welcome-logo"/>
             <xul:vbox flex="1" class="translation-welcome-content">
               <xul:description class="translation-welcome-headline"
                                anonid="welcomeHeadline"/>
               <xul:description class="translation-welcome-body" anonid="welcomeBody"/>
               <xul:hbox align="center">
-                <xul:label anonid="learnMore" class="plain text-link"/>
+                <xul:label anonid="learnMore" class="plain text-link"
+                           onclick="openUILinkIn('https://support.mozilla.org/en-US/products/firefox/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
                 <xul:spacer flex="1"/>
                 <xul:button class="translate-infobar-element" anonid="thanksButton"
                             onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
               </xul:hbox>
             </xul:vbox>
           </xul:panel>
           <xul:deck anonid="translationStates" selectedIndex="0">
 
@@ -210,17 +211,18 @@
 
             if (aTranslation.translatedTo)
               toLanguage.value = aTranslation.translatedTo;
 
             if (aTranslation.state)
               this.state = aTranslation.state;
 
             const kWelcomePref = "browser.translation.ui.welcomeMessageShown";
-            if (Services.prefs.prefHasUserValue(kWelcomePref))
+            if (Services.prefs.prefHasUserValue(kWelcomePref) ||
+                this.translation.browser != gBrowser.selectedBrowser)
               return;
 
             this.addEventListener("transitionend", function onShown() {
               this.removeEventListener("transitionend", onShown);
 
               // These strings are hardcoded because they need to reach beta
               // without riding the trains.
               let localizedStrings = {