Chromium Code Reviews| 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..432a8ee3f3191a587bf2d6023876f0fe15d085db 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/constants.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)) { |
|
Yoyo Zhou
2013/08/23 22:54:54
Do we still want this test here? I'm thinking abou
Devlin
2013/08/23 23:44:30
While that's true, the bigger problem is that they
Yoyo Zhou
2013/08/23 23:55:04
Ok. I was thinking we'd only get extension errors
|
| + 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 || |