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

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

Issue 398893006: Context menu should not shows data: in heading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review comments Created 6 years, 5 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 6ef4fcdda74e24240866b4ff7f80b046ff20765b..32f318bcdd63bd9b306c6431da4a8a5eee66005b 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
@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.search_engines.TemplateUrlService;
public class ChromeContextMenuPopulator implements ContextMenuPopulator {
private final ChromeContextMenuItemDelegate mDelegate;
private MenuInflater mMenuInflater;
+ private final String BLANK_URL = "about:blank";
/**
* Builds a {@link ChromeContextMenuPopulator}.
@@ -38,10 +39,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
@Override
public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) {
- if (params.isImage() && !TextUtils.isEmpty(params.getSrcUrl()))
- menu.setHeaderTitle(params.getSrcUrl());
- else if (!TextUtils.isEmpty(params.getLinkUrl()) )
- menu.setHeaderTitle(params.getLinkUrl());
+ if (!TextUtils.isEmpty(params.getLinkUrl()) && !params.getLinkUrl().equals(BLANK_URL))
+ menu.setHeaderTitle(params.getLinkUrl());
if (mMenuInflater == null) mMenuInflater = new MenuInflater(context);
« 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