Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: chrome/browser/extensions/chrome_extension_web_contents_observer.cc

Issue 1139643005: Extract ErrorConsole from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ErrorConsole::Get, update year for copyright lines Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/error_console/error_console.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
6 6
7 #include "chrome/browser/extensions/error_console/error_console.h" 7 #include "chrome/browser/extensions/error_console/error_console.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/common/extensions/chrome_extension_messages.h" 9 #include "chrome/common/extensions/chrome_extension_messages.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 int32 severity_level) { 53 int32 severity_level) {
54 if (!IsSourceFromAnExtension(source)) 54 if (!IsSourceFromAnExtension(source))
55 return; 55 return;
56 56
57 content::RenderViewHost* render_view_host = 57 content::RenderViewHost* render_view_host =
58 web_contents()->GetRenderViewHost(); 58 web_contents()->GetRenderViewHost();
59 std::string extension_id = GetExtensionId(render_view_host); 59 std::string extension_id = GetExtensionId(render_view_host);
60 if (extension_id.empty()) 60 if (extension_id.empty())
61 extension_id = GURL(source).host(); 61 extension_id = GURL(source).host();
62 62
63 ExtensionSystem::Get(browser_context())->error_console()->ReportError( 63 ErrorConsole::Get(browser_context())->ReportError(
64 scoped_ptr<ExtensionError>( 64 scoped_ptr<ExtensionError>(
65 new RuntimeError(extension_id, 65 new RuntimeError(extension_id,
66 browser_context()->IsOffTheRecord(), 66 browser_context()->IsOffTheRecord(),
67 source, 67 source,
68 message, 68 message,
69 stack_trace, 69 stack_trace,
70 web_contents()->GetLastCommittedURL(), 70 web_contents()->GetLastCommittedURL(),
71 static_cast<logging::LogSeverity>(severity_level), 71 static_cast<logging::LogSeverity>(severity_level),
72 render_view_host->GetRoutingID(), 72 render_view_host->GetRoutingID(),
73 render_view_host->GetProcess()->GetID()))); 73 render_view_host->GetProcess()->GetID())));
(...skipping 11 matching lines...) Expand all
85 // TODO(yoz): This reload doesn't happen synchronously for unpacked 85 // TODO(yoz): This reload doesn't happen synchronously for unpacked
86 // extensions. It seems to be fast enough, but there is a race. 86 // extensions. It seems to be fast enough, but there is a race.
87 // We should delay loading until the extension has reloaded. 87 // We should delay loading until the extension has reloaded.
88 if (registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED)) { 88 if (registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED)) {
89 ExtensionSystem::Get(browser_context())-> 89 ExtensionSystem::Get(browser_context())->
90 extension_service()->ReloadExtension(extension_id); 90 extension_service()->ReloadExtension(extension_id);
91 } 91 }
92 } 92 }
93 93
94 } // namespace extensions 94 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/error_console/error_console.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698