Add RenderFrameHost as parameter to WebContentsDelegate::HandleContextMenu

To be able to do anything more complicated than block all context
menu handling in HandleContextMenu you need the associated WebContents
object. Current implementation that do something more currently handles
that by either being a WebContentsObserver or keeping the WebContents
object some other way.

After WebContents checks WebContentsDelegate::HandleContextMenu the
next delegate to get a chance is WebContentsViewDelegate::ShowContextMenu
which takes a RenderFrameHost as additional parameter. This is all
you need to get the WebContents object and other related information.

So, to simplify writing WebContentsDelegate:s and override the
context menu handling by actually showing something, include
RenderFrameHost also in the HandleContextMenu call.

I selected RenderFrameHost instead of WebContents that many
other delegate methods use because it matches ShowContextMenu
signature and there are already other delegate methods that
also uses RenderFrameHost instead.

WebContentsDelegate is a very popular interface, so this
modifies a lot of files in different components but the
changes are mechanical.

Change-Id: I612202730f9a3badd38062e8284f1d50979e9377
Bug: 932520
Reviewed-by: Elly Fong-Jones <>
Reviewed-by: Jochen Eisinger <>
Commit-Queue: Joel Klinghed <>
Cr-Commit-Position: refs/heads/master@{#633300}
41 files changed