Bug 1226238 - (Part 1) Remove share button from reader view. r=ahunt,Gijs
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 22 Feb 2016 10:09:07 -0500
changeset 285609 e2414186e18ad96183afc486a4ecd3d0397ed04d
parent 285608 ba871a36752cdf91f4fc5a6f328e2af6ebb29587
child 285610 8ecfd8490dfc7705428e7d250778865595af5e63
push id17837
push usermleibovic@mozilla.com
push dateFri, 26 Feb 2016 01:10:33 +0000
treeherderfx-team@89eb5bb84d99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahunt, Gijs
bugs1226238
milestone47.0a1
Bug 1226238 - (Part 1) Remove share button from reader view. r=ahunt,Gijs MozReview-Commit-ID: 3TFzz809KcM
browser/modules/ReaderParent.jsm
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/chrome/content/Reader.js
mobile/android/chrome/content/browser.js
mobile/android/themes/core/aboutReaderControls.css
mobile/android/themes/core/images/reader-share-icon-hdpi.png
mobile/android/themes/core/images/reader-share-icon-mdpi.png
mobile/android/themes/core/images/reader-share-icon-xhdpi.png
mobile/android/themes/core/images/reader-share-icon-xxhdpi.png
mobile/android/themes/core/jar.mn
toolkit/components/reader/AboutReader.jsm
toolkit/components/reader/content/aboutReader.html
toolkit/locales/en-US/chrome/global/aboutReader.properties
toolkit/themes/shared/aboutReaderControls.css
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -23,17 +23,16 @@ var ReaderParent = {
   _readerModeInfoPanelOpen: false,
 
   MESSAGES: [
     "Reader:AddToList",
     "Reader:ArticleGet",
     "Reader:FaviconRequest",
     "Reader:ListStatusRequest",
     "Reader:RemoveFromList",
-    "Reader:Share",
     "Reader:SystemUIVisibility",
     "Reader:UpdateReaderButton",
     "Reader:SetIntPref",
     "Reader:SetCharPref",
   ],
 
   init: function() {
     let mm = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
@@ -67,19 +66,16 @@ var ReaderParent = {
             })
           },
           function onRejection(reason) {
             Cu.reportError("Error requesting favicon URL for about:reader content: " + reason);
           }).catch(Cu.reportError);
         }
         break;
       }
-      case "Reader:Share":
-        // XXX: To implement.
-        break;
 
       case "Reader:SystemUIVisibility":
         // XXX: To implement.
         break;
 
       case "Reader:UpdateReaderButton": {
         let browser = message.target;
         if (message.data && message.data.isArticle !== undefined) {
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -691,17 +691,16 @@ public class BrowserApp extends GeckoApp
             "CharEncoding:State",
             "Experiments:GetActive",
             "Favicon:CacheLoad",
             "Feedback:LastUrl",
             "Feedback:MaybeLater",
             "Feedback:OpenPlayStore",
             "Menu:Add",
             "Menu:Remove",
-            "Reader:Share",
             "Sanitize:ClearHistory",
             "Sanitize:ClearSyncedTabs",
             "Settings:Show",
             "Telemetry:Gather",
             "Updater:Launch");
 
         Distribution distribution = Distribution.init(this);
 
@@ -1403,17 +1402,16 @@ public class BrowserApp extends GeckoApp
             "CharEncoding:State",
             "Experiments:GetActive",
             "Favicon:CacheLoad",
             "Feedback:LastUrl",
             "Feedback:MaybeLater",
             "Feedback:OpenPlayStore",
             "Menu:Add",
             "Menu:Remove",
-            "Reader:Share",
             "Sanitize:ClearHistory",
             "Sanitize:ClearSyncedTabs",
             "Settings:Show",
             "Telemetry:Gather",
             "Updater:Launch");
 
         if (AppConstants.MOZ_ANDROID_BEAM) {
             NfcAdapter nfc = NfcAdapter.getDefaultAdapter(this);
@@ -1724,21 +1722,16 @@ public class BrowserApp extends GeckoApp
         } else if ("Menu:Remove".equals(event)) {
             final int id = message.getInt("id") + ADDON_MENU_OFFSET;
             ThreadUtils.postToUiThread(new Runnable() {
                 @Override
                 public void run() {
                     removeAddonMenuItem(id);
                 }
             });
-
-        } else if ("Reader:Share".equals(event)) {
-            final String title = message.getString("title");
-            final String url = message.getString("url");
-            GeckoAppShell.openUriExternal(url, "text/plain", "", "", Intent.ACTION_SEND, title, false);
         } else if ("Sanitize:ClearHistory".equals(event)) {
             handleClearHistory(message.optBoolean("clearSearchHistory", false));
             callback.sendSuccess(true);
         } else if ("Sanitize:ClearSyncedTabs".equals(event)) {
             handleClearSyncedTabs();
             callback.sendSuccess(true);
         } else if ("Settings:Show".equals(event)) {
             final String resource =
--- a/mobile/android/chrome/content/Reader.js
+++ b/mobile/android/chrome/content/Reader.js
@@ -158,24 +158,16 @@ var Reader = {
 
       case "Reader:RemoveFromList":
         Messaging.sendRequest({
           type: "Reader:RemoveFromList",
           url: message.data.url
         });
         break;
 
-      case "Reader:Share":
-        Messaging.sendRequest({
-          type: "Reader:Share",
-          url: message.data.url,
-          title: message.data.title
-        });
-        break;
-
       case "Reader:SystemUIVisibility":
         Messaging.sendRequest({
           type: "SystemUI:Visibility",
           visible: message.data.visible
         });
         break;
 
       case "Reader:ToolbarHidden":
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -193,17 +193,16 @@ lazilyLoadedObserverScripts.forEach(func
   ["Reader", [
     ["Reader:AddToList", false],
     ["Reader:ArticleGet", false],
     ["Reader:DropdownClosed", true], // 'true' allows us to survive mid-air cycle-collection.
     ["Reader:DropdownOpened", false],
     ["Reader:FaviconRequest", false],
     ["Reader:ListStatusRequest", false],
     ["Reader:RemoveFromList", false],
-    ["Reader:Share", false],
     ["Reader:ToolbarHidden", false],
     ["Reader:SystemUIVisibility", false],
     ["Reader:UpdateReaderButton", false],
     ["Reader:SetIntPref", false],
     ["Reader:SetCharPref", false],
   ], "chrome://browser/content/Reader.js"],
 ].forEach(aScript => {
   let [name, messages, script] = aScript;
--- a/mobile/android/themes/core/aboutReaderControls.css
+++ b/mobile/android/themes/core/aboutReaderControls.css
@@ -249,20 +249,16 @@
 .toggle-button.on {
   background-image: url('chrome://browser/skin/images/reader-toggle-on-icon-mdpi.png');
 }
 
 .toggle-button {
   background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-mdpi.png');
 }
 
-.share-button {
-  background-image: url('chrome://browser/skin/images/reader-share-icon-mdpi.png');
-}
-
 .style-button {
   background-image: url('chrome://browser/skin/images/reader-style-icon-mdpi.png');
 }
 
 .open .style-button {
   background-image: url('chrome://browser/skin/images/reader-style-icon-active-mdpi.png');
 }
 
@@ -278,20 +274,16 @@
   .toggle-button.on {
     background-image: url('chrome://browser/skin/images/reader-toggle-on-icon-hdpi.png');
   }
 
   .toggle-button {
     background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-hdpi.png');
   }
 
-  .share-button {
-    background-image: url('chrome://browser/skin/images/reader-share-icon-hdpi.png');
-  }
-
   .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-hdpi.png');
   }
 
   .open .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-active-hdpi.png');
   }
 
@@ -308,20 +300,16 @@
   .toggle-button.on {
     background-image: url('chrome://browser/skin/images/reader-toggle-on-icon-xhdpi.png');
   }
 
   .toggle-button {
     background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-xhdpi.png');
   }
 
-  .share-button {
-    background-image: url('chrome://browser/skin/images/reader-share-icon-xhdpi.png');
-  }
-
   .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-xhdpi.png');
   }
 
   .open .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-active-xhdpi.png');
   }
 
@@ -338,20 +326,16 @@
   .toggle-button.on {
     background-image: url('chrome://browser/skin/images/reader-toggle-on-icon-xxhdpi.png');
   }
 
   .toggle-button {
     background-image: url('chrome://browser/skin/images/reader-toggle-off-icon-xxhdpi.png');
   }
 
-  .share-button {
-    background-image: url('chrome://browser/skin/images/reader-share-icon-xhdpi.png');
-  }
-
   .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-xxhdpi.png');
   }
 
   .open .style-button {
     background-image: url('chrome://browser/skin/images/reader-style-icon-active-xxhdpi.png');
   }
 
deleted file mode 100644
index c58461cdcf9c580ceeb5e7bcd948da18f843e94c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 2332164dea93cfc364de7c531a4c4b5f7881ef50..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index b2d752db355233f9b666bd61523c91443091e396..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 6cd73a7d06fc91ae77bca5bf5aff0d27d72deeb6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/mobile/android/themes/core/jar.mn
+++ b/mobile/android/themes/core/jar.mn
@@ -101,20 +101,16 @@ chrome.jar:
   skin/images/reader-toggle-on-icon-mdpi.png     (images/reader-toggle-on-icon-mdpi.png)
   skin/images/reader-toggle-on-icon-hdpi.png     (images/reader-toggle-on-icon-hdpi.png)
   skin/images/reader-toggle-on-icon-xhdpi.png    (images/reader-toggle-on-icon-xhdpi.png)
   skin/images/reader-toggle-on-icon-xxhdpi.png   (images/reader-toggle-on-icon-xxhdpi.png)
   skin/images/reader-toggle-off-icon-mdpi.png    (images/reader-toggle-off-icon-mdpi.png)
   skin/images/reader-toggle-off-icon-hdpi.png    (images/reader-toggle-off-icon-hdpi.png)
   skin/images/reader-toggle-off-icon-xhdpi.png   (images/reader-toggle-off-icon-xhdpi.png)
   skin/images/reader-toggle-off-icon-xxhdpi.png  (images/reader-toggle-off-icon-xxhdpi.png)
-  skin/images/reader-share-icon-mdpi.png         (images/reader-share-icon-mdpi.png)
-  skin/images/reader-share-icon-hdpi.png         (images/reader-share-icon-hdpi.png)
-  skin/images/reader-share-icon-xhdpi.png        (images/reader-share-icon-xhdpi.png)
-  skin/images/reader-share-icon-xxhdpi.png       (images/reader-share-icon-xxhdpi.png)
   skin/images/reader-style-icon-active-mdpi.png  (images/reader-style-icon-active-mdpi.png)
   skin/images/reader-style-icon-active-hdpi.png  (images/reader-style-icon-active-hdpi.png)
   skin/images/reader-style-icon-active-xhdpi.png (images/reader-style-icon-active-xhdpi.png)
   skin/images/reader-style-icon-active-xxhdpi.png (images/reader-style-icon-active-xxhdpi.png)
   skin/images/reader-style-icon-mdpi.png         (images/reader-style-icon-mdpi.png)
   skin/images/reader-style-icon-hdpi.png         (images/reader-style-icon-hdpi.png)
   skin/images/reader-style-icon-xhdpi.png        (images/reader-style-icon-xhdpi.png)
   skin/images/reader-style-icon-xxhdpi.png       (images/reader-style-icon-xxhdpi.png)
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -66,17 +66,16 @@ var AboutReader = function(mm, win, arti
   win.addEventListener("unload", this, false);
   win.addEventListener("scroll", this, false);
   win.addEventListener("resize", this, false);
 
   doc.addEventListener("visibilitychange", this, false);
 
   this._setupStyleDropdown();
   this._setupButton("close-button", this._onReaderClose.bind(this), "aboutReader.toolbar.close");
-  this._setupButton("share-button", this._onShare.bind(this), "aboutReader.toolbar.share");
 
   try {
     if (Services.prefs.getBoolPref("browser.readinglist.enabled")) {
       this._setupButton("toggle-button", this._onReaderToggle.bind(this, "button"), "aboutReader.toolbar.addToReadingList");
       this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
       this._setupButton("remove-button", this._onReaderToggle.bind(this, "footer"),
         "aboutReader.footer.deleteThisArticle", "aboutReader.footer.deleteThisArticle");
       this._doc.getElementById("reader-footer").setAttribute('readinglist-enabled', "true");
@@ -358,27 +357,16 @@ AboutReader.prototype = {
       this._mm.sendAsyncMessage("Reader:AddToList", { article: this._article });
       UITelemetry.addEvent("save.1", aMethod, null, "reading_list");
     } else {
       this._mm.sendAsyncMessage("Reader:RemoveFromList", { url: this._article.url });
       UITelemetry.addEvent("unsave.1", aMethod, null, "reading_list");
     }
   },
 
-  _onShare: function() {
-    if (!this._article)
-      return;
-
-    this._mm.sendAsyncMessage("Reader:Share", {
-      url: this._article.url,
-      title: this._article.title
-    });
-    UITelemetry.addEvent("share.1", "list", null, "reader");
-  },
-
   /**
    * To help introduce ReadingList, we want to automatically
    * open the Desktop sidebar the first time ReaderMode is used.
    */
   _showListIntro: function() {
     this._mm.sendAsyncMessage("ReadingList:ShowIntro");
   },
 
--- a/toolkit/components/reader/content/aboutReader.html
+++ b/toolkit/components/reader/content/aboutReader.html
@@ -44,17 +44,16 @@
     </div>
   </div>
 
   <ul id="reader-toolbar" class="toolbar">
     <style scoped>
       @import url("chrome://global/skin/aboutReaderControls.css");
     </style>
     <li><button id="close-button" class="button close-button"/></li>
-    <li><button id="share-button" class="button share-button"/></li>
     <ul id="style-dropdown" class="dropdown">
       <li><button class="dropdown-toggle button style-button"/></li>
       <li id="reader-popup" class="dropdown-popup">
         <div id="font-type-buttons"></div>
         <hr></hr>
         <div id="font-size-buttons">
           <button id="font-size-minus" class="minus-button"/>
           <button id="font-size-sample"/>
--- a/toolkit/locales/en-US/chrome/global/aboutReader.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutReader.properties
@@ -22,17 +22,16 @@ aboutReader.fontType.sans-serif=Sans-ser
 aboutReader.fontTypeSample=Aa
 
 aboutReader.toolbar.close=Close Reader View
 aboutReader.toolbar.typeControls=Type controls
 aboutReader.toolbar.addToReadingList=Add to Reading List
 aboutReader.toolbar.removeFromReadingList=Remove from Reading List
 aboutReader.toolbar.openReadingList=Open Reading List
 aboutReader.toolbar.closeReadingList=Close Reading List
-aboutReader.toolbar.share=Share
 
 aboutReader.footer.deleteThisArticle=Delete this article
 
 # These are used for the Reader View toolbar button and the menuitem within the
 # View menu.
 readerView.enter=Enter Reader View
 readerView.enter.accesskey=R
 readerView.close=Close Reader View
--- a/toolkit/themes/shared/aboutReaderControls.css
+++ b/toolkit/themes/shared/aboutReaderControls.css
@@ -322,21 +322,16 @@
   border-radius: 2px;
   box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
   font-size: 18px;
 }
 
 
 /*======= Toolbar icons =======*/
 
-/* Android-only controls */
-.share-button {
-  display: none;
-}
-
 .close-button {
   background-image: url("chrome://global/skin/reader/RM-Close-24x24.svg#close");
   height: 68px;
   background-position: center 8px;
 }
 
 .close-button:hover {
   background-image: url("chrome://global/skin/reader/RM-Close-24x24.svg#close-hover");