Fix focus on navigation when no CefFocusHandler is provided.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@253 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-06-06 15:38:19 +00:00
parent ffec7e754a
commit c3fd7e5aed
1 changed files with 2 additions and 1 deletions

View File

@ -928,7 +928,8 @@ bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry,
if (client_.get()) { if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler(); CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get() && !handler->OnSetFocus(this, false)) { if (!handler.get() ||
(handler.get() && !handler->OnSetFocus(this, false))) {
// Restore focus to the main frame prior to loading new request. // Restore focus to the main frame prior to loading new request.
// This makes sure that we don't have a focused iframe. Otherwise, that // This makes sure that we don't have a focused iframe. Otherwise, that
// iframe would keep focus when the SetFocus called immediately after // iframe would keep focus when the SetFocus called immediately after