OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 this._panelToolbar.appendSeparator(); | 181 this._panelToolbar.appendSeparator(); |
182 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele
ctor.createOfflineToolbarCheckbox()); | 182 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele
ctor.createOfflineToolbarCheckbox()); |
183 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); | 183 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); |
184 | 184 |
185 this._setupGroupingCombo(); | 185 this._setupGroupingCombo(); |
186 | 186 |
187 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon
tainer)); | 187 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon
tainer)); |
188 } | 188 } |
189 | 189 |
190 _setupGroupingCombo() { | 190 _setupGroupingCombo() { |
191 var extensions = self.runtime.extensions(Network.NetworkGroupLookupInterface
); | 191 var extensions = self.runtime.extensions(Network.GroupLookupInterface); |
192 if (!extensions.length) | 192 if (!extensions.length) |
193 return; | 193 return; |
194 | 194 |
195 var setting = Common.settings.createSetting('networkGrouping', ''); | 195 var setting = Common.settings.createSetting('networkGrouping', ''); |
196 /** @type {!Array<!{value: string, label: string, title: string}>} */ | 196 /** @type {!Array<!{value: string, label: string, title: string}>} */ |
197 var options = [{value: '', label: Common.UIString('No grouping'), title: Com
mon.UIString('No grouping')}]; | 197 var options = [{value: '', label: Common.UIString('No grouping'), title: Com
mon.UIString('No grouping')}]; |
198 | 198 |
199 extensions.forEach(extension => { | 199 extensions.forEach(extension => { |
200 var identifier = extension.descriptor()['id']; | 200 var identifier = extension.descriptor()['id']; |
201 this._groupingExtensions.set(identifier, extension); | 201 this._groupingExtensions.set(identifier, extension); |
202 options.push({value: identifier, label: extension.title(), title: extensio
n.title()}); | 202 options.push({value: identifier, label: extension.title(), title: extensio
n.title()}); |
203 }); | 203 }); |
204 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingComboBox(options,
setting, Common.UIString('Group by'))); | 204 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingComboBox(options,
setting, Common.UIString('Group by'))); |
205 setting.addChangeListener(event => this._groupingChanged(/** @type {string}
*/ (event.data))); | 205 setting.addChangeListener(event => this._groupingChanged(/** @type {string}
*/ (event.data))); |
206 this._groupingChanged(setting.get()); | 206 this._groupingChanged(setting.get()); |
207 } | 207 } |
208 | 208 |
209 /** | 209 /** |
210 * @param {string} identifier | 210 * @param {string} identifier |
211 */ | 211 */ |
212 _groupingChanged(identifier) { | 212 _groupingChanged(identifier) { |
213 var extension = this._groupingExtensions.get(identifier); | 213 var extension = this._groupingExtensions.get(identifier); |
214 if (extension) { | 214 if (extension) { |
215 extension.instance().then( | 215 extension.instance().then( |
216 grouping => this._networkLogView.setGrouping(/** @type {?Network.Netwo
rkGroupLookupInterface} */ (grouping))); | 216 grouping => this._networkLogView.setGrouping(/** @type {?Network.Group
LookupInterface} */ (grouping))); |
217 } else { | 217 } else { |
218 this._networkLogView.setGrouping(null); | 218 this._networkLogView.setGrouping(null); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 /** | 222 /** |
223 * @return {!UI.ToolbarComboBox} | 223 * @return {!UI.ToolbarComboBox} |
224 */ | 224 */ |
225 _createNetworkConditionsSelect() { | 225 _createNetworkConditionsSelect() { |
226 var toolbarItem = new UI.ToolbarComboBox(null); | 226 var toolbarItem = new UI.ToolbarComboBox(null); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 * @param {string} actionId | 747 * @param {string} actionId |
748 * @return {boolean} | 748 * @return {boolean} |
749 */ | 749 */ |
750 handleAction(context, actionId) { | 750 handleAction(context, actionId) { |
751 var panel = UI.context.flavor(Network.NetworkPanel); | 751 var panel = UI.context.flavor(Network.NetworkPanel); |
752 console.assert(panel && panel instanceof Network.NetworkPanel); | 752 console.assert(panel && panel instanceof Network.NetworkPanel); |
753 panel._toggleRecording(); | 753 panel._toggleRecording(); |
754 return true; | 754 return true; |
755 } | 755 } |
756 }; | 756 }; |
OLD | NEW |