mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef:
- 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:
@@ -53,7 +53,7 @@ enum cef_retval_t CEF_CALLBACK handler_handle_before_created(
|
||||
|
||||
transfer_string_contents(urlStr, url);
|
||||
|
||||
if(handlerPtr.get() != structPtr->class_->GetClass().get())
|
||||
if(handlerPtr.get() != structPtr->class_->GetClass())
|
||||
{
|
||||
// The handler has been changed.
|
||||
CefHandlerCppToC* hobj = new CefHandlerCppToC(handlerPtr);
|
||||
@@ -501,8 +501,45 @@ enum cef_retval_t CEF_CALLBACK handler_handle_jsprompt(
|
||||
return rv;
|
||||
}
|
||||
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_before_window_close(
|
||||
struct _cef_handler_t* handler, cef_browser_t* browser)
|
||||
{
|
||||
DCHECK(handler);
|
||||
DCHECK(browser);
|
||||
if(!handler || !browser)
|
||||
return RV_CONTINUE;
|
||||
|
||||
CefHandlerCppToC::Struct* impl =
|
||||
reinterpret_cast<CefHandlerCppToC::Struct*>(handler);
|
||||
|
||||
CefBrowserCToCpp* bp = new CefBrowserCToCpp(browser);
|
||||
CefRefPtr<CefBrowser> browserPtr(bp);
|
||||
bp->UnderlyingRelease();
|
||||
|
||||
return impl->class_->GetClass()->HandleBeforeWindowClose(browserPtr);
|
||||
}
|
||||
|
||||
CefHandlerCppToC::CefHandlerCppToC(CefRefPtr<CefHandler> cls)
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_take_focus(
|
||||
struct _cef_handler_t* handler, cef_browser_t* browser, int reverse)
|
||||
{
|
||||
DCHECK(handler);
|
||||
DCHECK(browser);
|
||||
if(!handler || !browser)
|
||||
return RV_CONTINUE;
|
||||
|
||||
CefHandlerCppToC::Struct* impl =
|
||||
reinterpret_cast<CefHandlerCppToC::Struct*>(handler);
|
||||
|
||||
CefBrowserCToCpp* bp = new CefBrowserCToCpp(browser);
|
||||
CefRefPtr<CefBrowser> browserPtr(bp);
|
||||
bp->UnderlyingRelease();
|
||||
|
||||
return impl->class_->GetClass()->
|
||||
HandleTakeFocus(browserPtr, (reverse ? true : false));
|
||||
}
|
||||
|
||||
|
||||
CefHandlerCppToC::CefHandlerCppToC(CefHandler* cls)
|
||||
: CefCppToC<CefHandler, cef_handler_t>(cls)
|
||||
{
|
||||
struct_.struct_.handle_before_created = handler_handle_before_created;
|
||||
@@ -523,4 +560,11 @@ CefHandlerCppToC::CefHandlerCppToC(CefRefPtr<CefHandler> cls)
|
||||
struct_.struct_.handle_jsalert = handler_handle_jsalert;
|
||||
struct_.struct_.handle_jsconfirm = handler_handle_jsconfirm;
|
||||
struct_.struct_.handle_jsprompt = handler_handle_jsprompt;
|
||||
struct_.struct_.handle_before_window_close =
|
||||
handler_handle_before_window_close;
|
||||
struct_.struct_.handle_take_focus = handler_handle_take_focus;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCppToC<CefHandler, cef_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user