Handle title change. But there's a bug in CEF that makes this only work once.

This commit is contained in:
Corey Johnson & Nathan Sobo 2012-08-30 17:42:53 -06:00
parent 44db540528
commit 20dd59194b
2 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,8 @@ class AtomCefClient : public CefClient,
const CefString& source,
int line) OVERRIDE;
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) OVERRIDE;
// CefJsDialogHandlerMethods
virtual bool OnBeforeUnloadDialog(CefRefPtr<CefBrowser> browser,

View File

@ -47,6 +47,13 @@ void AtomCefClient::Confirm(int replyId,
browser->SendProcessMessage(PID_RENDERER, replyMessage);
}
void AtomCefClient::OnTitleChange(CefRefPtr<CefBrowser> 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<CefBrowser> browser) {
AtomWindowController *windowController = [[browser->GetHost()->GetWindowHandle() window] windowController];
[windowController toggleDevTools];