Merge revision 776 changes:

- Fix DCHECK failure when calling OnSetFocus from LoadRequest (issue #685).

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1180@777 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-10 19:48:47 +00:00
parent 12362a83e2
commit b15a5ac9ac

View File

@@ -313,12 +313,7 @@ void CefBrowserHostImpl::SetFocus(bool enable) {
if (!enable)
return;
if (CEF_CURRENTLY_ON_UIT()) {
OnSetFocus(FOCUS_SOURCE_SYSTEM);
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::SetFocus, this, enable));
}
}
CefWindowHandle CefBrowserHostImpl::GetWindowHandle() {
@@ -839,8 +834,7 @@ GURL CefBrowserHostImpl::GetLoadingURL() {
}
void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
CEF_REQUIRE_UIT();
if (CEF_CURRENTLY_ON_UIT()) {
// SetFocus() might be called while inside the OnSetFocus() callback. If so,
// don't re-enter the callback.
if (!is_in_onsetfocus_) {
@@ -859,6 +853,10 @@ void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
if (web_contents_.get())
web_contents_->Focus();
} else {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::OnSetFocus, this, source));
}
}