Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1055)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java

Issue 2048353004: Don't show navigation menu items when URI isnt accepted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
index a8eb2a94d8ac6e6453328f73258619b009401edd..e1e41fbf0aa4f6661ece85fca890188ac1fcbd74 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -192,6 +192,12 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
menu.findItem(R.id.contextmenu_copy_link_text).setVisible(false);
}
+ if (params.isAnchor() && !UrlUtilities.isAcceptedScheme(params.getLinkUrl())) {
+ menu.findItem(R.id.contextmenu_open_in_other_window).setVisible(false);
+ menu.findItem(R.id.contextmenu_open_in_new_tab).setVisible(false);
+ menu.findItem(R.id.contextmenu_open_in_incognito_tab).setVisible(false);
+ }
+
if (MailTo.isMailTo(params.getLinkUrl())) {
menu.findItem(R.id.contextmenu_copy_link_address).setVisible(false);
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698