A hack to get DevTools showing properly

This commit is contained in:
Corey Johnson 2012-09-18 17:15:13 -07:00
parent e9532ff01a
commit 4b8b4ef91c

View File

@ -106,13 +106,19 @@
_devToolsView = [[NSView alloc] initWithFrame:_splitView.bounds];
[_splitView addSubview:_devToolsView];
[_splitView adjustSubviews];
_cefDevToolsClient = new AtomCefClient();
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
[self performSelector:@selector(attachDevTools) withObject:nil afterDelay:0];
}
}
// If this is run directly after adding _devToolsView to _splitView, the
// devtools don't resize properly.
// HACK: I hate this and want to place this code directly in showDevTools
- (void)attachDevTools {
_cefDevToolsClient = new AtomCefClient();
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
}
- (void)hideDevTools {
[_devToolsView removeFromSuperview];
[_splitView adjustSubviews];