No need to override TitleWasSet in NativeWindow

This commit is contained in:
Cheng Zhao 2015-12-01 17:51:09 +08:00
parent 782af41c7c
commit 8d20dda6d7
6 changed files with 5 additions and 23 deletions

View file

@ -31,6 +31,11 @@ BrowserWindow::_init = ->
@webContents.on 'crashed', =>
@emit 'crashed'
# Change window title to page title.
@webContents.on 'page-title-set', (event, title, explicitSet) =>
@emit 'page-title-updated', event, title
@setTitle title unless event.defaultPrevented
# Sometimes the webContents doesn't get focus when window is shown, so we have
# to force focusing on webContents in this case. The safest way is to focus it
# when we first start to load URL, if we do it earlier it won't have effect,