| 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 19245314a796173cead492fcea65d5053cd3eecf..2c4c996cfc65e05ad78094da0018fe23c21ac7f5 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
|
| @@ -183,10 +183,25 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
|
|
| @Override
|
| public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) {
|
| - if (!TextUtils.isEmpty(params.getLinkUrl()) && !params.getLinkUrl().equals(BLANK_URL)) {
|
| - setHeaderText(context, menu, params.getLinkUrl());
|
| + String title = "";
|
| + if (!TextUtils.isEmpty(params.getLinkText())) {
|
| + title += "<b>" + params.getLinkText() + "</b>";
|
| } else if (!TextUtils.isEmpty(params.getTitleText())) {
|
| - setHeaderText(context, menu, params.getTitleText());
|
| + title += "<b>" + params.getTitleText() + "</b>";
|
| + }
|
| + if (!TextUtils.isEmpty(params.getLinkUrl()) && !params.getLinkUrl().equals(BLANK_URL)) {
|
| + if (!TextUtils.isEmpty(title)) {
|
| + title += "<br>";
|
| + }
|
| + title += UrlUtilities.decodeUrl(params.getLinkUrl());
|
| + } else if (!TextUtils.isEmpty(params.getSrcUrl())) {
|
| + if (!TextUtils.isEmpty(title)) {
|
| + title += "<br>";
|
| + }
|
| + title += UrlUtilities.decodeUrl(params.getSrcUrl());
|
| + }
|
| + if (!TextUtils.isEmpty(title)) {
|
| + setHeaderText(context, menu, title);
|
| }
|
|
|
| if (mMenuInflater == null) mMenuInflater = new MenuInflater(context);
|
| @@ -233,6 +248,12 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
| menu.findItem(R.id.contextmenu_save_link_as).setVisible(
|
| UrlUtilities.isDownloadableScheme(params.getLinkUrl()));
|
|
|
| + if (TextUtils.isEmpty(params.getLinkUrl()) || params.getLinkUrl().equals(BLANK_URL)) {
|
| + 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 (params.imageWasFetchedLoFi()
|
| || !DataReductionProxySettings.getInstance().wasLoFiModeActiveOnMainFrame()
|
| || !DataReductionProxySettings.getInstance().canUseDataReductionProxy(
|
|
|