Skip to content

Commit

Permalink
As per the ContextMenuParam structure (context_menu_params.h)
Browse files Browse the repository at this point in the history
mLinkText may be an empty string if the contents of the link are an image.

So here as we are doing long press on image link the mLinkText is coming as empty string from nativeside.
And in buildContextMenu it sets header title as mLinkText so it sets "about:blank"

This patch checks if link are an image then sets title as source URL. 

BUG=385000

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279673 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jitendra.ks@samsung.com committed Jun 25, 2014
1 parent 92cd664 commit c000811
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Jingwei Liu <kingweiliu@gmail.com>
Jingyi Wei <wjywbs@gmail.com>
Jinho Bang <jinho.bang@samsung.com>
Jinwoo Song <jinwoo7.song@samsung.com>
Jitendra Kumar Sahoo <jitendra.ks@samsung.com>
Joe Knoll <joe.knoll@workday.com>
Joe Thomas <mhx348@motorola.com>
Joel Stanley <joel@jms.id.au>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public boolean shouldShowContextMenu(ContextMenuParams params) {

@Override
public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) {
if (!TextUtils.isEmpty(params.getLinkUrl())) menu.setHeaderTitle(params.getLinkUrl());
if (params.isImage() && !TextUtils.isEmpty(params.getSrcUrl()))
menu.setHeaderTitle(params.getSrcUrl());
else if (!TextUtils.isEmpty(params.getLinkUrl()) )
menu.setHeaderTitle(params.getLinkUrl());

if (mMenuInflater == null) mMenuInflater = new MenuInflater(context);

Expand Down

0 comments on commit c000811

Please sign in to comment.