New issue
Advanced search Search tips

Issue 707789 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

It is a bit confusing to have default value of true for hasImageContents(WebContextMenuData.h) and has_image_contents(context_menu_params.cc)

Project Member Reported by sriram...@samsung.com, Apr 3 2017

Issue description

Chrome Version: (copy from chrome://version)
OS: (e.g. Win7, OSX 10.9.5, etc...)
All
What steps will reproduce the problem?
(1) Add logs in context_menu_params_builder.cc to observe the values for has_image_contents and hasImageContents
(2) Load google.com
(3) Long press on links and observe the logs

What is the expected result?
value of has_image_contents and hasImageContents should be false

What happens instead?
value of has_image_contents and hasImageContents is true

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Ideally the implementations should depend on media_type parameter but having true for has_image_contents for all types(link, audio, video ...) is a bit confusing. The value hasImageContents is being filled properly in ContextMenuClientImpl::showContextMenu for image and canvas element. So isn't it nice to have default value as false?
Cc: foolip@chromium.org
I'm not familiar with this code, but that does sound like an odd default. Maybe prepare a CL and see what the reviewer says?
ok, i will do that
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d68c1beaad7929dddc6e6e1278dd03fedcd348eb

commit d68c1beaad7929dddc6e6e1278dd03fedcd348eb
Author: srirama.m <srirama.m@samsung.com>
Date: Fri Apr 14 12:04:28 2017

Change default value of has_image_contents

The default value of has_image_contents(in context_menu_params.cc, WebContextMenuData.h) is true by default.
These values mean there is an image content for the long pressed node.

Changed default value to false to make it less confusing for
elements(Link, video) other than image, canvas.
This value is being set properly incase of canvas and image elements
in ContextMenuClientImpl::ShowContextMenu and it is being used only
incase of media_type kMediaTypeImage in render_view_context_menu.cc.
So this change will not cause any difference to the existing code flow.

BUG= 707789 

Review-Url: https://codereview.chromium.org/2803233002
Cr-Commit-Position: refs/heads/master@{#464717}

[modify] https://crrev.com/d68c1beaad7929dddc6e6e1278dd03fedcd348eb/content/public/common/context_menu_params.cc
[modify] https://crrev.com/d68c1beaad7929dddc6e6e1278dd03fedcd348eb/third_party/WebKit/public/web/WebContextMenuData.h

Owner: sriram...@samsung.com
Status: Fixed (was: Untriaged)

Sign in to add a comment