Index: chrome/browser/extensions/extension_host.cc |
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc |
index 7388727c046ae64fe26258ecb2618520be1f00e3..e01038d202be598659726d1467c4cdc29eaa8246 100644 |
--- a/chrome/browser/extensions/extension_host.cc |
+++ b/chrome/browser/extensions/extension_host.cc |
@@ -15,6 +15,7 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/browser_shutdown.h" |
#include "chrome/browser/chrome_notification_types.h" |
+#include "chrome/browser/extensions/error_console/error_console.h" |
#include "chrome/browser/extensions/event_router.h" |
#include "chrome/browser/extensions/extension_process_manager.h" |
#include "chrome/browser/extensions/extension_service.h" |
@@ -47,7 +48,9 @@ |
#include "content/public/browser/site_instance.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_view.h" |
+#include "extensions/browser/extension_error.h" |
#include "extensions/browser/view_type_utils.h" |
+#include "extensions/common/extension_urls.h" |
#include "grit/browser_resources.h" |
#include "grit/chromium_strings.h" |
#include "grit/generated_resources.h" |
@@ -423,6 +426,26 @@ void ExtensionHost::DocumentAvailableInMainFrame() { |
} |
} |
+void ExtensionHost::OnMessageAddedToConsole(const base::string16& source, |
+ const base::string16& message, |
+ const base::string16& stack_trace, |
+ int32 line_number, |
+ logging::LogSeverity level) { |
+ if (IsSourceFromAnExtension(source)) { |
+ ErrorConsole::Get(profile_)->ReportError( |
+ scoped_ptr<const ExtensionError>(new JavascriptRuntimeError( |
+ profile_->IsOffTheRecord(), |
+ source, |
+ message, |
+ stack_trace, |
+ line_number, |
+ associated_web_contents_ ? |
+ associated_web_contents_->GetLastCommittedURL() : |
+ GURL::EmptyGURL(), |
+ level))); |
+ } |
+} |
+ |
void ExtensionHost::CloseContents(WebContents* contents) { |
// TODO(mpcomplete): is this check really necessary? |
if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP || |