Bug 970209 - Surround update logic in about:apps with synth apk specific wrapper; r=wesj
authorMartyn Haigh <martyn.haigh@gmail.com>
Wed, 05 Mar 2014 08:13:00 -0800
changeset 171996 606b524f6299242788eedc8a527f1999aab48bee
parent 171995 fe2afc55a0d1d231c7aef79d8d5fc8ef206bc43e
child 171997 799bd9fbd0457aa896a06222663c5c7c8f028d01
push id40614
push usermyk@mozilla.com
push dateWed, 05 Mar 2014 16:13:43 +0000
treeherdermozilla-inbound@799bd9fbd045 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs970209
milestone30.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 970209 - Surround update logic in about:apps with synth apk specific wrapper; r=wesj
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
@@ -50,17 +50,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">&aboutApps.checkForUpdates;</div>
       </div>
     </div>
+#endif
   </body>
 </html>