Mac: Fix compile error (issue #508).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@681 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-11 16:51:51 +00:00
parent d8caf27e3b
commit f79d18d510
2 changed files with 25 additions and 23 deletions

View File

@ -790,6 +790,29 @@ GURL CefBrowserHostImpl::GetLoadingURL() {
return loading_url_;
}
void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
CEF_REQUIRE_UIT();
// SetFocus() might be called while inside the OnSetFocus() callback. If so,
// don't re-enter the callback.
if (!is_in_onsetfocus_) {
if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get()) {
is_in_onsetfocus_ = true;
bool handled = handler->OnSetFocus(this, source);
is_in_onsetfocus_ = false;
if (handled)
return;
}
}
}
if (web_contents_.get())
web_contents_->Focus();
}
// content::WebContentsDelegate methods.
// -----------------------------------------------------------------------------
@ -1404,25 +1427,3 @@ void CefBrowserHostImpl::OnLoadEnd(CefRefPtr<CefFrame> frame,
}
}
void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
CEF_REQUIRE_UIT();
// SetFocus() might be called while inside the OnSetFocus() callback. If so,
// don't re-enter the callback.
if (!is_in_onsetfocus_) {
if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get()) {
is_in_onsetfocus_ = true;
bool handled = handler->OnSetFocus(this, source);
is_in_onsetfocus_ = false;
if (handled)
return;
}
}
}
if (web_contents_.get())
web_contents_->Focus();
}

View File

@ -191,6 +191,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
static void RegisterWindowClass();
#endif
void OnSetFocus(cef_focus_source_t source);
private:
// content::WebContentsDelegate methods.
virtual content::WebContents* OpenURLFromTab(
@ -322,7 +324,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
const string16& error_description);
void OnLoadEnd(CefRefPtr<CefFrame> frame,
const GURL& url);
void OnSetFocus(cef_focus_source_t source);
CefWindowInfo window_info_;
CefBrowserSettings settings_;