Index: chrome/browser/extensions/tab_helper.cc |
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc |
index ac7620c4440e913eda0cd8664c35a0196566ac0f..361771852d48ab6a2aea4ac08eb6dbbe0e6f47d2 100644 |
--- a/chrome/browser/extensions/tab_helper.cc |
+++ b/chrome/browser/extensions/tab_helper.cc |
@@ -4,11 +4,13 @@ |
#include "chrome/browser/extensions/tab_helper.h" |
+#include "base/logging.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/activity_log/activity_log.h" |
#include "chrome/browser/extensions/api/declarative/rules_registry_service.h" |
#include "chrome/browser/extensions/api/declarative_content/content_rules_registry.h" |
#include "chrome/browser/extensions/crx_installer.h" |
+#include "chrome/browser/extensions/error_console/error_console.h" |
#include "chrome/browser/extensions/extension_action.h" |
#include "chrome/browser/extensions/extension_action_manager.h" |
#include "chrome/browser/extensions/extension_service.h" |
@@ -33,6 +35,7 @@ |
#include "chrome/common/extensions/feature_switch.h" |
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
#include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
+#include "chrome/common/render_messages.h" |
#include "content/public/browser/invalidate_type.h" |
#include "content/public/browser/navigation_controller.h" |
#include "content/public/browser/navigation_details.h" |
@@ -45,7 +48,9 @@ |
#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_view.h" |
+#include "extensions/browser/extension_error.h" |
#include "extensions/common/extension_resource.h" |
+#include "extensions/common/extension_urls.h" |
#include "ui/gfx/image/image.h" |
using content::NavigationController; |
@@ -237,6 +242,8 @@ bool TabHelper::OnMessageReceived(const IPC::Message& message) { |
OnContentScriptsExecuting) |
IPC_MESSAGE_HANDLER(ExtensionHostMsg_OnWatchedPageChange, |
OnWatchedPageChange) |
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DetailedConsoleMessageAdded, |
+ OnDetailedConsoleMessageAdded) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -253,7 +260,6 @@ void TabHelper::DidCloneToNewWebContents(WebContents* old_web_contents, |
new_helper->extension_app_icon_ = extension_app_icon_; |
} |
- |
void TabHelper::OnDidGetApplicationInfo(int32 page_id, |
const WebApplicationInfo& info) { |
// Android does not implement BrowserWindow. |
@@ -350,6 +356,24 @@ void TabHelper::OnWatchedPageChange( |
#endif // defined(ENABLE_EXTENSIONS) |
} |
+void TabHelper::OnDetailedConsoleMessageAdded( |
+ const base::string16& message, |
+ const base::string16& source, |
+ const StackTrace& stack_trace, |
+ int32 severity_level) { |
+ if (IsSourceFromAnExtension(source)) { |
+ ErrorConsole::Get(profile_)->ReportError( |
+ scoped_ptr<ExtensionError>(new RuntimeError( |
+ profile_->IsOffTheRecord(), |
+ source, |
+ message, |
+ stack_trace, |
+ web_contents() ? |
+ web_contents()->GetLastCommittedURL() : GURL::EmptyGURL(), |
+ static_cast<logging::LogSeverity>(severity_level)))); |
+ } |
+} |
+ |
const Extension* TabHelper::GetExtension(const std::string& extension_app_id) { |
if (extension_app_id.empty()) |
return NULL; |