Index: Source/devtools/front_end/network/NetworkPanel.js |
diff --git a/Source/devtools/front_end/network/NetworkPanel.js b/Source/devtools/front_end/network/NetworkPanel.js |
index 61e8da516ba3d17df1f24ebf762cd80f8355d471..0e7746bcd1bd22fd698c0608554a565a2d0cf3b9 100644 |
--- a/Source/devtools/front_end/network/NetworkPanel.js |
+++ b/Source/devtools/front_end/network/NetworkPanel.js |
@@ -130,8 +130,7 @@ WebInspector.NetworkPanel.prototype = { |
_createToolbarButtons: function() |
{ |
- this._recordButton = new WebInspector.ToolbarButton("", "record-toolbar-item"); |
- this._recordButton.addEventListener("click", this._onRecordButtonClicked, this); |
+ this._recordButton = WebInspector.ToolbarButton.createActionButton("network.toggle-recording"); |
this._panelToolbar.appendToolbarItem(this._recordButton); |
this._clearButton = new WebInspector.ToolbarButton(WebInspector.UIString("Clear"), "clear-toolbar-item"); |
@@ -179,10 +178,7 @@ WebInspector.NetworkPanel.prototype = { |
return toolbarItem; |
}, |
- /** |
- * @param {!WebInspector.Event} event |
- */ |
- _onRecordButtonClicked: function(event) |
+ _toggleRecording: function() |
{ |
if (!this._preserveLogCheckbox.checked() && !this._recordButton.toggled()) |
this._reset(); |
@@ -349,7 +345,12 @@ WebInspector.NetworkPanel.prototype = { |
wasShown: function() |
{ |
- WebInspector.Panel.prototype.wasShown.call(this); |
+ WebInspector.context.setFlavor(WebInspector.NetworkPanel, this); |
+ }, |
+ |
+ willHide: function() |
+ { |
+ WebInspector.context.setFlavor(WebInspector.NetworkPanel, null); |
}, |
/** |
@@ -803,3 +804,24 @@ WebInspector.BlockedURLsBar.prototype = { |
return this._toolbarButton; |
} |
} |
+ |
+/** |
+ * @constructor |
+ * @implements {WebInspector.ActionDelegate} |
+ */ |
+WebInspector.NetworkPanel.RecordActionDelegate = function() |
+{ |
+} |
+WebInspector.NetworkPanel.RecordActionDelegate.prototype = { |
+ /** |
+ * @override |
+ * @param {!WebInspector.Context} context |
+ * @param {string} actionId |
+ */ |
+ handleAction: function(context, actionId) |
+ { |
+ var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); |
+ console.assert(panel && panel instanceof WebInspector.NetworkPanel); |
+ panel._toggleRecording(); |
+ } |
+} |