- Add the CefBrowser::CreateBrowserSync() method for synchronously creating a browser instance. (Issue #13, Suggested implementation by: vridosh)
- Add CefBrowser::SetFocus() and CefHandler::HandleTakeFocus() methods to deal with keyboard focus changes. (Issue #13, Suggested implementation by: vridosh)
- Add CefHandler::HandleBeforeWindowClose() to perform actions immediately before the browser window is destroyed. (Issue #13, Suggested implementation by: vridosh)
- Replace windows-specific address resolution code with GURL() in CefBrowserImpl::UIT_LoadURLForRequest(), CefBrowserImpl::UIT_LoadHTML() and CefBrowserImpl::UIT_LoadHTMLForStreamRef(), and move the methods from browser_impl_win.cc to browser_impl.cc. (Issue #13, Suggested implementation by: vridosh)
- Fix reference counting bugs, class definition problems and CefContext::Shutdown() bug resulting in Cef object leaks. (Issue #15)
- Add WebKit dependancy to libcef project.
- Add basic object count debugging for CefCToCpp and CefCppToC classes.

cefclient:
- Initialize the strPtr parameter to avoid URLs suffixed with garbage. (Issue #13, Fix by: vridosh)

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@19 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-03-08 02:26:16 +00:00
parent 3aa0d4c0fa
commit 08a19d5384
37 changed files with 628 additions and 195 deletions

View File

@ -8,7 +8,10 @@
#include "cef_nplugin.h"
#include "cef_nplugin_capi.h"
#include "../cpptoc/handler_cpptoc.h"
#include "../cpptoc/jshandler_cpptoc.h"
#include "../ctocpp/browser_ctocpp.h"
#include "../ctocpp/request_ctocpp.h"
#include "../ctocpp/variant_ctocpp.h"
#include "../ctocpp/stream_ctocpp.h"
@ -21,6 +24,17 @@ bool CefInitialize(bool multi_threaded_message_loop,
void CefShutdown()
{
cef_shutdown();
// Check that all wrapper objects have been destroyed
DCHECK(CefHandlerCppToC::DebugObjCt == 0);
DCHECK(CefJSHandlerCppToC::DebugObjCt == 0);
DCHECK(CefBrowserCToCpp::DebugObjCt == 0);
DCHECK(CefRequestCToCpp::DebugObjCt == 0);
DCHECK(CefPostDataCToCpp::DebugObjCt == 0);
DCHECK(CefPostDataElementCToCpp::DebugObjCt == 0);
DCHECK(CefStreamReaderCToCpp::DebugObjCt == 0);
DCHECK(CefStreamWriterCToCpp::DebugObjCt == 0);
DCHECK(CefVariantCToCpp::DebugObjCt == 0);
}
void CefDoMessageLoopWork()
@ -37,6 +51,26 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, bool popup,
return cef_create_browser(&windowInfo, popup, hp->GetStruct(), url.c_str());
}
CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
bool popup,
CefRefPtr<CefHandler> handler,
const std::wstring& url)
{
CefHandlerCppToC* hp = new CefHandlerCppToC(handler);
hp->AddRef();
cef_browser_t* browserStruct = cef_create_browser_sync(&windowInfo, popup,
hp->GetStruct(), url.c_str());
if(!browserStruct)
return NULL;
CefBrowserCToCpp* bp = new CefBrowserCToCpp(browserStruct);
CefRefPtr<CefBrowser> browserPtr(bp);
bp->UnderlyingRelease();
return browserPtr;
}
CefRefPtr<CefRequest> CreateRequest()
{
cef_request_t* impl = cef_create_request();