Remove NativeWindow::ActivateContents
This commit is contained in:
parent
eb370ba22a
commit
e41b0d4d2c
5 changed files with 6 additions and 11 deletions
|
@ -267,8 +267,7 @@ void WebContents::CloseContents(content::WebContents* source) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::ActivateContents(content::WebContents* source) {
|
void WebContents::ActivateContents(content::WebContents* source) {
|
||||||
if (type_ == BROWSER_WINDOW)
|
Emit("activate");
|
||||||
owner_window()->CloseContents(source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
|
bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
|
||||||
|
|
|
@ -20,6 +20,11 @@ BrowserWindow::_init = ->
|
||||||
@webContents.on 'move', (event, size) =>
|
@webContents.on 'move', (event, size) =>
|
||||||
@setSize size
|
@setSize size
|
||||||
|
|
||||||
|
# Hide the auto-hide menu when webContents is focused.
|
||||||
|
@webContents.on 'activate', =>
|
||||||
|
if process.platform isnt 'darwin' and @isMenuBarAutoHide() and @isMenuBarVisible()
|
||||||
|
@setMenuBarVisibility false
|
||||||
|
|
||||||
# Redirect focus/blur event to app instance too.
|
# Redirect focus/blur event to app instance too.
|
||||||
@on 'blur', (event) =>
|
@on 'blur', (event) =>
|
||||||
app.emit 'browser-window-blur', event, this
|
app.emit 'browser-window-blur', event, this
|
||||||
|
|
|
@ -178,7 +178,6 @@ class NativeWindow : public content::WebContentsObserver,
|
||||||
virtual void CloseContents(content::WebContents* source);
|
virtual void CloseContents(content::WebContents* source);
|
||||||
virtual void RendererUnresponsive(content::WebContents* source);
|
virtual void RendererUnresponsive(content::WebContents* source);
|
||||||
virtual void RendererResponsive(content::WebContents* source);
|
virtual void RendererResponsive(content::WebContents* source);
|
||||||
virtual void ActivateContents(content::WebContents* contents) {}
|
|
||||||
virtual void HandleKeyboardEvent(
|
virtual void HandleKeyboardEvent(
|
||||||
content::WebContents*,
|
content::WebContents*,
|
||||||
const content::NativeWebKeyboardEvent& event) {}
|
const content::NativeWebKeyboardEvent& event) {}
|
||||||
|
|
|
@ -872,13 +872,6 @@ void NativeWindowViews::GetDevToolsWindowWMClass(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void NativeWindowViews::ActivateContents(content::WebContents* contents) {
|
|
||||||
NativeWindow::ActivateContents(contents);
|
|
||||||
// Hide menu bar when web view is clicked.
|
|
||||||
if (menu_bar_autohide_ && menu_bar_visible_)
|
|
||||||
SetMenuBarVisibility(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NativeWindowViews::HandleKeyboardEvent(
|
void NativeWindowViews::HandleKeyboardEvent(
|
||||||
content::WebContents*,
|
content::WebContents*,
|
||||||
const content::NativeWebKeyboardEvent& event) {
|
const content::NativeWebKeyboardEvent& event) {
|
||||||
|
|
|
@ -128,7 +128,6 @@ class NativeWindowViews : public NativeWindow,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NativeWindow:
|
// NativeWindow:
|
||||||
void ActivateContents(content::WebContents* contents) override;
|
|
||||||
void HandleKeyboardEvent(
|
void HandleKeyboardEvent(
|
||||||
content::WebContents*,
|
content::WebContents*,
|
||||||
const content::NativeWebKeyboardEvent& event) override;
|
const content::NativeWebKeyboardEvent& event) override;
|
||||||
|
|
Loading…
Reference in a new issue