Context menu should not shows data: in heading

In some senario image source url has full image data starts with
"data:" so context menu in that case returns source url starts with
"data:" and full contents.In those senario we should show only link url
instead of source url.

BUG=395511

Review URL: https://codereview.chromium.org/398893006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285880 0039d316-1c4b-4281-b951-d872f2087c98
parent 5b48ea6b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment