document menu closed event and fix styling issue
This commit is contained in:
parent
c586806609
commit
bcef6eb3df
2 changed files with 12 additions and 4 deletions
|
@ -653,10 +653,9 @@ void WebContents::RendererResponsive(content::WebContents* source) {
|
||||||
|
|
||||||
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
|
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
|
||||||
if (params.custom_context.is_pepper_menu) {
|
if (params.custom_context.is_pepper_menu) {
|
||||||
Emit("pepper-context-menu",
|
Emit("pepper-context-menu", std::make_pair(params, web_contents()),
|
||||||
std::make_pair(params, web_contents()),
|
base::Bind(&content::WebContents::NotifyContextMenuClosed,
|
||||||
base::Bind(&content::WebContents::NotifyContextMenuClosed,
|
base::Unretained(web_contents()), params.custom_context));
|
||||||
base::Unretained(web_contents()), params.custom_context));
|
|
||||||
} else {
|
} else {
|
||||||
Emit("context-menu", std::make_pair(params, web_contents()));
|
Emit("context-menu", std::make_pair(params, web_contents()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,15 @@ A `MenuItem[]` array containing the menu's items.
|
||||||
Each `Menu` consists of multiple [`MenuItem`](menu-item.md)s and each `MenuItem`
|
Each `Menu` consists of multiple [`MenuItem`](menu-item.md)s and each `MenuItem`
|
||||||
can have a submenu.
|
can have a submenu.
|
||||||
|
|
||||||
|
### Instance Events
|
||||||
|
|
||||||
|
Objects created with `new Menu` or returned by `Menu.buildFromTemplate` emit
|
||||||
|
the following events:
|
||||||
|
|
||||||
|
#### Event: 'closed'
|
||||||
|
|
||||||
|
Emitted when the menu is closed.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
The `Menu` class is only available in the main process, but you can also use it
|
The `Menu` class is only available in the main process, but you can also use it
|
||||||
|
|
Loading…
Add table
Reference in a new issue