Bug 1134927 - Add 'Add to Reading List' back to context menu. r=margaret a=readinglist
authorTyler St. Onge <tylertstonge@gmail.com>
Tue, 24 Feb 2015 18:55:00 -0500
changeset 247907 4d847c044609c115f85121c30e245a37ae6b90f3
parent 247906 d828b6d179ddc99fc75044bc99eb283d82126e77
child 247908 bc07944f02c11093dd46f7062c2e772a8c1088f5
push id7710
push usermleibovic@mozilla.com
push dateThu, 05 Mar 2015 18:30:54 +0000
treeherdermozilla-aurora@f03e25d599eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, readinglist
bugs1134927
milestone38.0a2
Bug 1134927 - Add 'Add to Reading List' back to context menu. r=margaret a=readinglist
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -622,16 +622,27 @@ var BrowserApp = {
           button: {
             icon: "drawable://switch_button_icon",
             label: buttonLabel,
             callback: () => { BrowserApp.selectTab(tab); },
           }
         });
       });
 
+    NativeWindow.contextmenus.add(stringGetter("contextmenu.addToReadingList"),
+      NativeWindow.contextmenus.linkOpenableContext,
+      function(aTarget) {
+        let url = NativeWindow.contextmenus._getLinkURL(aTarget);
+        Messaging.sendRequestForResult({
+            type: "Reader:AddToList",
+            title: truncate(url, MAX_TITLE_LENGTH),
+            url: truncate(url, MAX_URI_LENGTH),
+        }).catch(Cu.reportError);
+      });
+
     NativeWindow.contextmenus.add(stringGetter("contextmenu.copyLink"),
       NativeWindow.contextmenus.linkCopyableContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_copy_link");
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
       });