}
void WebContents::ActivateContents(content::WebContents* source) {
- if (type_ == BROWSER_WINDOW)
- owner_window()->CloseContents(source);
+ Emit("activate");
}
bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
@webContents.on 'move', (event, 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.
@on 'blur', (event) =>
app.emit 'browser-window-blur', event, this
virtual void CloseContents(content::WebContents* source);
virtual void RendererUnresponsive(content::WebContents* source);
virtual void RendererResponsive(content::WebContents* source);
- virtual void ActivateContents(content::WebContents* contents) {}
virtual void HandleKeyboardEvent(
content::WebContents*,
const content::NativeWebKeyboardEvent& event) {}
}
#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(
content::WebContents*,
const content::NativeWebKeyboardEvent& event) {
#endif
// NativeWindow:
- void ActivateContents(content::WebContents* contents) override;
void HandleKeyboardEvent(
content::WebContents*,
const content::NativeWebKeyboardEvent& event) override;