Bug 642996 - Remove 'Save Link' from the Fennec context menu [r=wesj]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 19 Aug 2011 14:42:01 -0700
changeset 75561 16e0d32eb59cdb87634911efacbcdb79dcde491f
parent 75560 92c74d08dcdbf1dd7491ff0cce02d5c0a1026f3b
child 75562 e09d10ebeaa8f2000bcd521cd5563e24dd321d5d
push id1352
push usermbrubeck@mozilla.com
push dateFri, 19 Aug 2011 21:42:37 +0000
treeherdermozilla-inbound@16e0d32eb59c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs642996
milestone9.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 642996 - Remove 'Save Link' from the Fennec context menu [r=wesj]
mobile/chrome/content/ContextCommands.js
mobile/chrome/content/browser.xul
mobile/chrome/content/content.js
mobile/chrome/tests/browser_tapping.js
mobile/locales/en-US/chrome/browser.dtd
--- a/mobile/chrome/content/ContextCommands.js
+++ b/mobile/chrome/content/ContextCommands.js
@@ -48,21 +48,16 @@ var ContextCommands = {
       target.focus();
     }
   },
 
   openInNewTab: function cc_openInNewTab() {
     Browser.addTab(ContextHelper.popupState.linkURL, false, Browser.selectedTab);
   },
 
-  saveLink: function cc_saveLink() {
-    let browser = ContextHelper.popupState.target;
-    ContentAreaUtils.saveURL(ContextHelper.popupState.linkURL, null, "SaveLinkTitle", false, true, browser.documentURI);
-  },
-
   saveImage: function cc_saveImage() {
     let popupState = ContextHelper.popupState;
     let browser = popupState.target;
 
     // Bug 638523
     // Using directly SaveImageURL fails here since checking the cache for a
     // remote page seems to not work (could it be nsICacheSession prohibition)?
     ContentAreaUtils.internalSave(popupState.mediaURL, null, null,
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -634,19 +634,16 @@
             <label value="&selectAll.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-openinnewtab" type="link-openable" onclick="ContextCommands.openInNewTab();">
             <label value="&contextOpenInNewTab.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-bookmark-link" type="link" onclick="ContextCommands.bookmarkLink();">
             <label value="&contextBookmarkLink.label;"/>
           </richlistitem>
-          <richlistitem class="context-command" id="context-savelink" type="link-saveable" onclick="ContextCommands.saveLink();">
-            <label value="&contextSaveLink.label;"/>
-          </richlistitem>
           <richlistitem class="context-command" id="context-saveimage" type="image-loaded" onclick="ContextCommands.saveImage();">
             <label value="&contextSaveImage.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-copy-link" type="link" onclick="ContextCommands.copyLink();">
             <label value="&contextCopyLink.label;"/>
           </richlistitem>
           <richlistitem class="context-command" id="context-share-link" type="link-shareable" onclick="ContextCommands.shareLink();">
             <label value="&contextShareLink.label;"/>
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -1000,21 +1000,16 @@ ContextHandler.registerType("mailto", fu
   return aState.linkProtocol == "mailto";
 });
 
 ContextHandler.registerType("callto", function(aState, aElement) {
   let protocol = aState.linkProtocol;
   return protocol == "tel" || protocol == "callto" || protocol == "sip" || protocol == "voipto";
 });
 
-ContextHandler.registerType("link-saveable", function(aState, aElement) {
-  let protocol = aState.linkProtocol;
-  return (protocol && protocol != "mailto" && protocol != "javascript" && protocol != "news" && protocol != "snews");
-});
-
 ContextHandler.registerType("link-openable", function(aState, aElement) {
   return Util.isOpenableScheme(aState.linkProtocol);
 });
 
 ContextHandler.registerType("link-shareable", function(aState, aElement) {
   return Util.isShareableScheme(aState.linkProtocol);
 });
 
--- a/mobile/chrome/tests/browser_tapping.js
+++ b/mobile/chrome/tests/browser_tapping.js
@@ -258,17 +258,17 @@ gTests.push({
     info("Test a good long pan");
     clearEvents();
     EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, { type: "mousedown" });
   },
 
   contextPlainLinkTest: function() {
     waitForContextMenu(function(aJSON) {
       is(aJSON.linkTitle, "A blank page - nothing interesting", "Text content should be the content of the second link");
-      ok(checkContextTypes(["link", "link-saveable","link-openable"]), "Plain link context types");
+      ok(checkContextTypes(["link", "link-openable"]), "Plain link context types");
     }, gCurrentTest.contextPlainImageTest);
 
     let browser = gCurrentTab.browser;
     let linkDisabled = browser.contentDocument.getElementById("link-disabled");
     let event = content.document.createEvent("PopupEvents");
     event.initEvent("contextmenu", true, true);
     linkDisabled.dispatchEvent(event);
 
@@ -287,17 +287,17 @@ gTests.push({
     let img = browser.contentDocument.getElementById("img-single");
     let event = content.document.createEvent("PopupEvents");
     event.initEvent("contextmenu", true, true);
     img.dispatchEvent(event);
   },
 
   contextNestedImageTest: function() {
     waitForContextMenu(function() {
-      ok(checkContextTypes(["link", "link-saveable","image","image-shareable","image-loaded","link-openable"]), "Nested image context types");
+      ok(checkContextTypes(["link","image","image-shareable","image-loaded","link-openable"]), "Nested image context types");
     }, runNextTest);
 
     let browser = gCurrentTab.browser;
     let img = browser.contentDocument.getElementById("img-nested");
     let event = content.document.createEvent("PopupEvents");
     event.initEvent("contextmenu", true, true);
     img.dispatchEvent(event);
   }
--- a/mobile/locales/en-US/chrome/browser.dtd
+++ b/mobile/locales/en-US/chrome/browser.dtd
@@ -88,17 +88,16 @@
 <!ENTITY consoleCodeEval.label     "Code:">
 <!ENTITY consoleClear.label        "Clear">
 <!ENTITY consoleEvaluate.label     "…">
 <!ENTITY consoleErrFile.label      "Source File:">
 <!ENTITY consoleErrLine.label      "Line:">
 <!ENTITY consoleErrColumn.label    "Column:">
 
 <!ENTITY contextOpenInNewTab.label    "Open Link in New Tab">
-<!ENTITY contextSaveLink.label        "Save Link">
 <!ENTITY contextSaveImage.label       "Save Image">
 <!ENTITY contextCopyLink.label        "Copy Link">
 <!ENTITY contextShareLink.label       "Share Link">
 <!ENTITY contextShareImage.label      "Share Image">
 <!ENTITY contextBookmarkLink.label    "Bookmark Link">
 <!ENTITY contextSaveVideo.label       "Save Video">
 <!ENTITY contextShareVideo.label      "Share Video">
 <!ENTITY contextPlayMedia.label       "Play">