diff --git a/include/capi/cef_display_handler_capi.h b/include/capi/cef_display_handler_capi.h index 6c4ad694b..f2b68017a 100644 --- a/include/capi/cef_display_handler_capi.h +++ b/include/capi/cef_display_handler_capi.h @@ -91,8 +91,7 @@ typedef struct _cef_display_handler_t { // status message type. /// void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self, - struct _cef_browser_t* browser, const cef_string_t* value, - enum cef_handler_statustype_t type); + struct _cef_browser_t* browser, const cef_string_t* value); /// // Called to display a console message. Return true (1) to stop the message diff --git a/include/cef_display_handler.h b/include/cef_display_handler.h index 7a1c270d4..f54a650ea 100644 --- a/include/cef_display_handler.h +++ b/include/cef_display_handler.h @@ -49,8 +49,6 @@ /*--cef(source=client)--*/ class CefDisplayHandler : public virtual CefBase { public: - typedef cef_handler_statustype_t StatusType; - /// // Called when the loading state has changed. /// @@ -92,8 +90,7 @@ class CefDisplayHandler : public virtual CefBase { /// /*--cef(optional_param=value)--*/ virtual void OnStatusMessage(CefRefPtr browser, - const CefString& value, - StatusType type) {} + const CefString& value) {} /// // Called to display a console message. Return true to stop the message from diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 11e4a85d9..28b20e32a 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -1199,15 +1199,6 @@ enum cef_xml_node_type_t { XML_NODE_COMMENT, }; -/// -// Status message types. -/// -enum cef_handler_statustype_t { - STATUSTYPE_TEXT = 0, - STATUSTYPE_MOUSEOVER_URL, - STATUSTYPE_KEYBOARD_FOCUS_URL, -}; - /// // Popup window features. /// diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index ae7417071..2e28353b5 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -908,6 +908,30 @@ void CefBrowserHostImpl::CloseContents(content::WebContents* source) { PlatformCloseWindow(); } +void CefBrowserHostImpl::UpdateTargetURL(content::WebContents* source, + int32 page_id, + const GURL& url) { + if (client_.get()) { + CefRefPtr handler = client_->GetDisplayHandler(); + if (handler.get()) + handler->OnStatusMessage(this, url.spec()); + } +} + +bool CefBrowserHostImpl::AddMessageToConsole(content::WebContents* source, + int32 level, + const string16& message, + int32 line_no, + const string16& source_id) { + if (client_.get()) { + CefRefPtr handler = client_->GetDisplayHandler(); + if (handler.get()) + return handler->OnConsoleMessage(this, message, source_id, line_no); + } + + return false; +} + bool CefBrowserHostImpl::TakeFocus(content::WebContents* source, bool reverse) { if (client_.get()) { @@ -1567,4 +1591,3 @@ void CefBrowserHostImpl::OnLoadEnd(CefRefPtr frame, } } } - diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 1a36c0c9a..4571cf040 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -205,6 +205,14 @@ class CefBrowserHostImpl : public CefBrowserHost, const content::OpenURLParams& params) OVERRIDE; virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; virtual void CloseContents(content::WebContents* source) OVERRIDE; + virtual void UpdateTargetURL(content::WebContents* source, + int32 page_id, + const GURL& url) OVERRIDE; + virtual bool AddMessageToConsole(content::WebContents* source, + int32 level, + const string16& message, + int32 line_no, + const string16& source_id) OVERRIDE; virtual bool TakeFocus(content::WebContents* source, bool reverse) OVERRIDE; virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE; diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index 36a21e4e9..68b675964 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -113,7 +113,7 @@ int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, void CEF_CALLBACK display_handler_on_status_message( struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* value, enum cef_handler_statustype_t type) { + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,8 +128,7 @@ void CEF_CALLBACK display_handler_on_status_message( // Execute CefDisplayHandlerCppToC::Get(self)->OnStatusMessage( CefBrowserCToCpp::Wrap(browser), - CefString(value), - type); + CefString(value)); } int CEF_CALLBACK display_handler_on_console_message( diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index 3066b6714..d8b786017 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -107,7 +107,7 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, } void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, - const CefString& value, StatusType type) { + const CefString& value) { if (CEF_MEMBER_MISSING(struct_, on_status_message)) return; @@ -122,8 +122,7 @@ void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, // Execute struct_->on_status_message(struct_, CefBrowserCppToC::Wrap(browser), - value.GetStruct(), - type); + value.GetStruct()); } bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index 830d4b5b0..5b10305a1 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -43,7 +43,7 @@ class CefDisplayHandlerCToCpp virtual bool OnTooltip(CefRefPtr browser, CefString& text) OVERRIDE; virtual void OnStatusMessage(CefRefPtr browser, - const CefString& value, StatusType type) OVERRIDE; + const CefString& value) OVERRIDE; virtual bool OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, int line) OVERRIDE; };