diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 18c755328d2f..4938b355db9c 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -336,6 +336,17 @@ void InspectableWebContentsImpl::WebContentsDestroyed() { frontend_host_.reset(); } +bool InspectableWebContentsImpl::AddMessageToConsole( + content::WebContents* source, + int32 level, + const base::string16& message, + int32 line_no, + const base::string16& source_id) { + logging::LogMessage("CONSOLE", line_no, level).stream() << "\"" << + message << "\", source: " << source_id << " (" << line_no << ")"; + return true; +} + void InspectableWebContentsImpl::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 73ba40d7e4ab..8bbf70273b28 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -107,6 +107,11 @@ class InspectableWebContentsImpl : // content::WebContentsDelegate + virtual bool AddMessageToConsole(content::WebContents* source, + int32 level, + const base::string16& message, + int32 line_no, + const base::string16& source_id) OVERRIDE; virtual void HandleKeyboardEvent( content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE; virtual void CloseContents(content::WebContents* source) OVERRIDE;