- Add developer tools support (issue #127).

- Send title change notifications generated after page content is done loading.
- Restore windows and bring to the front in BrowserWebViewDelegate::show().

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@168 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-01-25 18:37:27 +00:00
parent c9b8e88dd9
commit ca3a392c33
24 changed files with 667 additions and 30 deletions

View File

@ -112,7 +112,10 @@ void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
// Set window user data to this object for future reference from the window
// procedure
app::win::SetWindowUserData(window_info_.m_hWnd, this);
if (!settings_.developer_tools_disabled)
dev_tools_agent_.reset(new BrowserDevToolsAgent());
// Add a reference that will be released in UIT_DestroyBrowser().
AddRef();
@ -125,7 +128,10 @@ void CefBrowserImpl::UIT_CreateBrowser(const CefString& url)
// Create the webview host object
webviewhost_.reset(
WebViewHost::Create(window_info_.m_hWnd, gfx::Rect(), delegate_.get(),
NULL, prefs));
dev_tools_agent_.get(), prefs));
if (!settings_.developer_tools_disabled)
dev_tools_agent_->SetWebView(webviewhost_->webview());
if (!settings_.drag_drop_disabled)
delegate_->RegisterDragDrop();
@ -481,3 +487,15 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame)
return page_count;
}
void CefBrowserImpl::UIT_CloseDevTools()
{
REQUIRE_UIT();
if(!dev_tools_agent_.get())
return;
BrowserDevToolsClient* client = dev_tools_agent_->client();
if (client)
PostMessage(client->browser()->GetMainWndHandle(), WM_CLOSE, 0, 0);
}