Focus atom window when dev tools are removed

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-07-31 09:42:34 -07:00
parent 63d016785b
commit a7f4abdff9

View File

@@ -76,6 +76,7 @@
[_devToolsView removeFromSuperview];
[_devToolsView release];
_devToolsView = nil;
[self focusWindow];
}
else if (_clientHandler && _clientHandler->GetBrowser()) {
NSRect frame = NSMakeRect(0, 0, _splitView.frame.size.height, _splitView.frame.size.height);
@@ -88,6 +89,18 @@
}
#pragma mark BrowserDelegate
- (void)focusWindow {
CefRefPtr<CefV8Context> context = _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();
CefRefPtr<CefV8Value> global = context->GetGlobal();
context->Enter();
CefRefPtr<CefV8Value> retval;
CefRefPtr<CefV8Exception> exception;
CefV8ValueList arguments;
global->GetValue("focus")->ExecuteFunction(global, arguments, retval, exception, true);
context->Exit();
}
- (void)loadStart {
CefRefPtr<CefV8Context> context = _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();
CefRefPtr<CefV8Value> global = context->GetGlobal();