From f79d18d51065e47da6e4489515b6587ecdc2f269 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 11 Jun 2012 16:51:51 +0000 Subject: [PATCH] Mac: Fix compile error (issue #508). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@681 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_host_impl.cc | 45 +++++++++++++++-------------- libcef/browser/browser_host_impl.h | 3 +- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 1936f1d92..0b78d6302 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -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 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 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 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(); -} diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index fd0628b4a..0c8465abb 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -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 frame, const GURL& url); - void OnSetFocus(cef_focus_source_t source); CefWindowInfo window_info_; CefBrowserSettings settings_;