Bug 970209 - Surround update logic in about:apps with synth apk specific wrapper. r=wesj, a=sledru
authorMartyn Haigh <martyn.haigh@gmail.com>
Wed, 02 Apr 2014 12:04:04 +0100
changeset 183607 3672b5508f0ea5b9d000a1b32f451ee0dd1d14ca
parent 183606 73f34f8b0b3aedd9e3fd59d2b18ab7a776ebc8ce
child 183608 f4f9a56c8d0f358d2d933089386f49a0469d157f
push id3419
push userryanvm@gmail.com
push dateWed, 02 Apr 2014 16:42:40 +0000
treeherdermozilla-beta@37ab641216bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, sledru
bugs970209
milestone29.0
Bug 970209 - Surround update logic in about:apps with synth apk specific wrapper. r=wesj, a=sledru
mobile/android/chrome/content/aboutApps.js
mobile/android/chrome/content/aboutApps.xhtml
--- a/mobile/android/chrome/content/aboutApps.js
+++ b/mobile/android/chrome/content/aboutApps.js
@@ -7,17 +7,19 @@
  * ***** END LICENSE BLOCK ***** */
 
 let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm")
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/AppsUtils.jsm");
 
+#ifdef MOZ_ANDROID_SYNTHAPKS
 XPCOMUtils.defineLazyModuleGetter(this, "WebappManager", "resource://gre/modules/WebappManager.jsm");
+#endif
 
 const DEFAULT_ICON = "chrome://browser/skin/images/default-app-icon.png";
 
 let gStrings = Services.strings.createBundle("chrome://browser/locale/aboutApps.properties");
 
 XPCOMUtils.defineLazyGetter(window, "gChromeWin", function()
   window.QueryInterface(Ci.nsIInterfaceRequestor)
     .getInterface(Ci.nsIWebNavigation)
@@ -38,19 +40,21 @@ function openLink(aEvent) {
   try {
     let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
     let url = formatter.formatURLPref(aEvent.currentTarget.getAttribute("pref"));
     let BrowserApp = gChromeWin.BrowserApp;
     BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id });
   } catch (ex) {}
 }
 
+#ifdef MOZ_ANDROID_SYNTHAPKS
 function checkForUpdates(aEvent) {
   WebappManager.checkForUpdates(true);
 }
+#endif
 
 #ifndef MOZ_ANDROID_SYNTHAPKS
 var ContextMenus = {
   target: null,
 
   init: function() {
     document.addEventListener("contextmenu", this, false);
     document.getElementById("addToHomescreenLabel").addEventListener("click", this.addToHomescreen, false);
@@ -88,17 +92,19 @@ var ContextMenus = {
 #endif
 
 function onLoad(aEvent) {
   let elmts = document.querySelectorAll("[pref]");
   for (let i = 0; i < elmts.length; i++) {
     elmts[i].addEventListener("click",  openLink,  false);
   }
 
+#ifdef MOZ_ANDROID_SYNTHAPKS
   document.getElementById("update-item").addEventListener("click", checkForUpdates, false);
+#endif
 
   navigator.mozApps.mgmt.oninstall = onInstall;
   navigator.mozApps.mgmt.onuninstall = onUninstall;
   updateList();
 
 #ifndef MOZ_ANDROID_SYNTHAPKS
   ContextMenus.init();
 #endif
--- a/mobile/android/chrome/content/aboutApps.xhtml
+++ b/mobile/android/chrome/content/aboutApps.xhtml
@@ -52,17 +52,18 @@
     </div>
 
     <div class="list-item" role="button" pref="app.marketplaceURL">
       <img class="icon" src="chrome://browser/skin/images/marketplace-logo.png" />
       <div class="inner">
         <div id="browse-title" class="title">&aboutApps.browseMarketplace;</div>
       </div>
     </div>
-
+#ifdef MOZ_ANDROID_SYNTHAPKS
     <div class="list-item" id="update-item" role="button">
       <img class="icon" src="chrome://browser/skin/images/update.png" />
       <div class="inner">
         <div id="browse-title" class="title">&aboutPage.checkForUpdates.link;</div>
       </div>
     </div>
+#endif
   </body>
 </html>