Merge pull request #5379 from danhp/context-menu

Expose the 'context-menu' event.
This commit is contained in:
Cheng Zhao 2016-05-05 11:12:58 +09:00
commit 0901a70166
7 changed files with 223 additions and 4 deletions

View file

@ -440,11 +440,13 @@ void WebContents::RendererResponsive(content::WebContents* source) {
}
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
if (!params.custom_context.is_pepper_menu)
return false;
if (params.custom_context.is_pepper_menu) {
Emit("pepper-context-menu", std::make_pair(params, web_contents()));
web_contents()->NotifyContextMenuClosed(params.custom_context);
} else {
Emit("context-menu", std::make_pair(params, web_contents()));
}
Emit("pepper-context-menu", std::make_pair(params, web_contents()));
web_contents()->NotifyContextMenuClosed(params.custom_context);
return true;
}