Bug 1158884 - hide pocket on android, fix AboutReader.jsm on android, r=margaret,jaws a=dolske
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 27 Apr 2015 18:01:44 +0100
changeset 260433 20872d739a18
parent 260431 62ee103ccbbe
child 260434 92c7576dce37
push id782
push userjdolske@mozilla.com
push date2015-05-09 00:18 +0000
treeherdermozilla-release@067c9c7a5e75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, jaws, dolske
bugs1158884
milestone38.0
Bug 1158884 - hide pocket on android, fix AboutReader.jsm on android, r=margaret,jaws a=dolske
mobile/android/themes/core/aboutReader.css
toolkit/components/reader/AboutReader.jsm
--- a/mobile/android/themes/core/aboutReader.css
+++ b/mobile/android/themes/core/aboutReader.css
@@ -326,16 +326,20 @@ body {
 }
 
 /* Remove dotted border when button is focused */
 .button::-moz-focus-inner,
 .dropdown-popup > div > button::-moz-focus-inner {
   border: 0;
 }
 
+.button[hidden] {
+  display: none;
+}
+
 .dropdown {
   left: 0;
   text-align: center;
   display: inline-block;
   list-style: none;
   margin: 0px;
   padding: 0px;
 }
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -7,17 +7,20 @@
 let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "AboutReader" ];
 
 Cu.import("resource://gre/modules/ReaderMode.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm");
+const gIsFirefoxDesktop = Services.appinfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
+if (gIsFirefoxDesktop) {
+  XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm");
+}
 XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry", "resource://gre/modules/UITelemetry.jsm");
 
 const READINGLIST_COMMAND_ID = "readingListSidebar";
 
 let gStrings = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
 
@@ -79,19 +82,23 @@ let AboutReader = function(mm, win, arti
       this._setupButton("remove-button", this._onReaderToggle.bind(this, "footer"),
         "aboutReader.footer.deleteThisArticle", "aboutReader.footer.deleteThisArticle");
       this._doc.getElementById("reader-footer").setAttribute('readinglist-enabled', "true");
     }
   } catch (e) {
     // Pref doesn't exist.
   }
 
-  let pocketPlacement = CustomizableUI.getPlacementOfWidget("pocket-button");
-  if (pocketPlacement && pocketPlacement.area) {
-    this._setupButton("pocket-button", this._onPocketToggle.bind(this, "button"));
+  if (gIsFirefoxDesktop) {
+    let pocketPlacement = CustomizableUI.getPlacementOfWidget("pocket-button");
+    if (pocketPlacement && pocketPlacement.area) {
+      this._setupButton("pocket-button", this._onPocketToggle.bind(this, "button"));
+    } else {
+      this._doc.getElementById("pocket-button").hidden = true;
+    }
   } else {
     this._doc.getElementById("pocket-button").hidden = true;
   }
 
   let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values"));
   let colorSchemeOptions = colorSchemeValues.map((value) => {
     return { name: gStrings.GetStringFromName("aboutReader.colorScheme." + value),
              value: value,