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

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 298333003: DevTools: Implement console message logging through an extension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove duplicate logging Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/inspector.html ('k') | Source/devtools/front_end/profiler/CPUProfileView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index 11f3e64dc3694ccafeef047e2e8bdb0f805e05be..49c7588214c519dbb9a2160ba1dda5a26ab717c0 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -370,6 +370,7 @@ WebInspector.Main.prototype = {
WebInspector.actionRegistry = new WebInspector.ActionRegistry();
WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebInspector.actionRegistry);
this._registerForwardedShortcuts();
+ this._registerMessageSinkListener();
WebInspector.inspectorView = new WebInspector.InspectorView();
@@ -431,6 +432,21 @@ WebInspector.Main.prototype = {
InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys));
},
+ _registerMessageSinkListener: function()
+ {
+ WebInspector.messageSink.addEventListener(WebInspector.MessageSink.Events.MessageAdded, messageAdded);
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ function messageAdded(event)
+ {
+ var message = /** @type {!WebInspector.MessageSink.Message} */ (event.data);
+ if (message.show)
+ WebInspector.actionRegistry.execute("console.show");
+ }
+ },
+
_documentClick: function(event)
{
var anchor = event.target.enclosingNodeOrSelfWithNodeName("a");
« no previous file with comments | « Source/devtools/front_end/inspector.html ('k') | Source/devtools/front_end/profiler/CPUProfileView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698