Add showDefinitionForSelection webContents proxy method
This commit is contained in:
parent
6337e93e6d
commit
70996c79ba
7 changed files with 3 additions and 33 deletions
|
@ -623,12 +623,6 @@ void Window::UnhookAllWindowMessages() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void Window::ShowDefinitionForSelection() {
|
||||
window_->ShowDefinitionForSelection();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TOOLKIT_VIEWS)
|
||||
void Window::SetIcon(mate::Handle<NativeImage> icon) {
|
||||
#if defined(OS_WIN)
|
||||
|
@ -760,10 +754,6 @@ void Window::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("unhookWindowMessage", &Window::UnhookWindowMessage)
|
||||
.SetMethod("unhookAllWindowMessages", &Window::UnhookAllWindowMessages)
|
||||
#endif
|
||||
#if defined(OS_MACOSX)
|
||||
.SetMethod("showDefinitionForSelection",
|
||||
&Window::ShowDefinitionForSelection)
|
||||
#endif
|
||||
#if defined(TOOLKIT_VIEWS)
|
||||
.SetMethod("setIcon", &Window::SetIcon)
|
||||
#endif
|
||||
|
|
|
@ -169,10 +169,6 @@ class Window : public mate::TrackableObject<Window>,
|
|||
void UnhookAllWindowMessages();
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
void ShowDefinitionForSelection();
|
||||
#endif
|
||||
|
||||
#if defined(TOOLKIT_VIEWS)
|
||||
void SetIcon(mate::Handle<NativeImage> icon);
|
||||
#endif
|
||||
|
|
|
@ -334,10 +334,6 @@ void NativeWindow::CapturePage(const gfx::Rect& rect,
|
|||
kBGRA_8888_SkColorType);
|
||||
}
|
||||
|
||||
void NativeWindow::ShowDefinitionForSelection() {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void NativeWindow::SetAutoHideMenuBar(bool auto_hide) {
|
||||
}
|
||||
|
||||
|
|
|
@ -179,9 +179,6 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual void CapturePage(const gfx::Rect& rect,
|
||||
const CapturePageCallback& callback);
|
||||
|
||||
// Show popup dictionary.
|
||||
virtual void ShowDefinitionForSelection();
|
||||
|
||||
// Toggle the menu bar.
|
||||
virtual void SetAutoHideMenuBar(bool auto_hide);
|
||||
virtual bool IsMenuBarAutoHide();
|
||||
|
|
|
@ -83,7 +83,6 @@ class NativeWindowMac : public NativeWindow {
|
|||
void SetProgressBar(double progress) override;
|
||||
void SetOverlayIcon(const gfx::Image& overlay,
|
||||
const std::string& description) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
|
||||
void SetVisibleOnAllWorkspaces(bool visible) override;
|
||||
bool IsVisibleOnAllWorkspaces() override;
|
||||
|
|
|
@ -933,17 +933,6 @@ void NativeWindowMac::SetOverlayIcon(const gfx::Image& overlay,
|
|||
const std::string& description) {
|
||||
}
|
||||
|
||||
void NativeWindowMac::ShowDefinitionForSelection() {
|
||||
// TODO(kevinsawicki): Deprecate and remove this method in 2.0 in favor of
|
||||
// calling it directly on webContents.
|
||||
if (!web_contents())
|
||||
return;
|
||||
auto rwhv = web_contents()->GetRenderWidgetHostView();
|
||||
if (!rwhv)
|
||||
return;
|
||||
rwhv->ShowDefinitionForSelection();
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) {
|
||||
SetCollectionBehavior(visible, NSWindowCollectionBehaviorCanJoinAllSpaces);
|
||||
}
|
||||
|
|
|
@ -151,6 +151,9 @@ Object.assign(BrowserWindow.prototype, {
|
|||
},
|
||||
inspectServiceWorker () {
|
||||
return this.webContents.inspectServiceWorker()
|
||||
},
|
||||
showDefinitionForSelection () {
|
||||
return this.webContents.showDefinitionForSelection()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue