Add BrowserWindow.showDefinitionForSelection()
This API shows the system-provided pop-up dictionary. Some Mac apps including Chrome have "Look Up in in Dictionary" context menu item. This API can be used to implement it.
This commit is contained in:
parent
47d7a355f2
commit
dc9329ff43
7 changed files with 38 additions and 0 deletions
|
@ -642,6 +642,14 @@ void NativeWindowMac::SetProgressBar(double progress) {
|
|||
[dock_tile display];
|
||||
}
|
||||
|
||||
void NativeWindowMac::ShowDefinitionForSelection() {
|
||||
content::WebContents* web_contents = GetWebContents();
|
||||
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
||||
if (!rwhv)
|
||||
return;
|
||||
rwhv->ShowDefinitionForSelection();
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
|
||||
if (!draggable_region_)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue