Add a CefHandler::HandleSetFocus() callback that gets called when the browser control or a child widget requests focus. This callback gives the client an opportunity to cancel the focus change. (Issue #34, initial patch by tux316).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@29 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-06-16 13:52:35 +00:00
parent ff7e8379fb
commit d953faf7f8
8 changed files with 74 additions and 15 deletions

View File

@@ -317,7 +317,7 @@ CefHandler::RetVal CefHandlerCToCpp::HandleTakeFocus(
reverse);
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSBinding(
CefHandler::RetVal CefHandlerCToCpp::HandleJSBinding(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object)
{
@@ -328,6 +328,16 @@ CefHandler::RetVal CefHandlerCToCpp::HandleJSBinding(
CefFrameCppToC::Wrap(frame), CefV8ValueCppToC::Wrap(object));
}
CefHandler::RetVal CefHandlerCToCpp::HandleSetFocus(
CefRefPtr<CefBrowser> browser, bool isWidget)
{
if(CEF_MEMBER_MISSING(struct_, handle_set_focus))
return RV_CONTINUE;
return struct_->handle_set_focus(struct_, CefBrowserCppToC::Wrap(browser),
isWidget);
}
#ifdef _DEBUG
long CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>::DebugObjCt = 0;
#endif