diff --git a/native/atom_cef_client.h b/native/atom_cef_client.h index 3fabf3e74..820b447bd 100644 --- a/native/atom_cef_client.h +++ b/native/atom_cef_client.h @@ -66,6 +66,8 @@ class AtomCefClient : public CefClient, const CefString& source, int line) OVERRIDE; + virtual void OnTitleChange(CefRefPtr browser, + const CefString& title) OVERRIDE; // CefJsDialogHandlerMethods virtual bool OnBeforeUnloadDialog(CefRefPtr browser, diff --git a/native/atom_cef_client_mac.mm b/native/atom_cef_client_mac.mm index 704e2cbf2..e532c5270 100644 --- a/native/atom_cef_client_mac.mm +++ b/native/atom_cef_client_mac.mm @@ -47,6 +47,13 @@ void AtomCefClient::Confirm(int replyId, browser->SendProcessMessage(PID_RENDERER, replyMessage); } + +void AtomCefClient::OnTitleChange(CefRefPtr browser, const CefString& title) { + NSLog(@"TITLE CHANGE %s", title.ToString().c_str()); + NSWindow *window = [browser->GetHost()->GetWindowHandle() window]; + [window setTitle:[NSString stringWithUTF8String:title.ToString().c_str()]]; +} + void AtomCefClient::ToggleDevTools(CefRefPtr browser) { AtomWindowController *windowController = [[browser->GetHost()->GetWindowHandle() window] windowController]; [windowController toggleDevTools];