Bug 711595 - Request desktop site should be disabled for the same URIs as share. r=mfinkle

This commit is contained in:
Margaret Leibovic 2011-12-21 08:05:38 -08:00
parent af477c6f5e
commit 09668436d1

View File

@ -464,6 +464,7 @@ abstract public class GeckoApp
forward.setEnabled(false);
share.setEnabled(false);
saveAsPDF.setEnabled(false);
agentMode.setEnabled(false);
return true;
}
@ -482,9 +483,12 @@ abstract public class GeckoApp
forward.setEnabled(tab.canDoForward());
// Don't share about:, chrome: and file: URIs
// Disable share and agentMode menuitems for about:, chrome: and file: URIs
String scheme = Uri.parse(tab.getURL()).getScheme();
share.setEnabled(!(scheme.equals("about") || scheme.equals("chrome") || scheme.equals("file")));
boolean enabled = !(scheme.equals("about") || scheme.equals("chrome") ||
scheme.equals("file"));
share.setEnabled(enabled);
agentMode.setEnabled(enabled);
// Disable save as PDF for about:home and xul pages
saveAsPDF.setEnabled(!(tab.getURL().equals("about:home") ||