| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 var largerRequestsButton = new UI.ToolbarSettingToggle( | 156 var largerRequestsButton = new UI.ToolbarSettingToggle( |
| 157 this._networkLogLargeRowsSetting, 'largeicon-large-list', Common.UIStrin
g('Use large request rows'), | 157 this._networkLogLargeRowsSetting, 'largeicon-large-list', Common.UIStrin
g('Use large request rows'), |
| 158 Common.UIString('Use small request rows')); | 158 Common.UIString('Use small request rows')); |
| 159 this._panelToolbar.appendToolbarItem(largerRequestsButton); | 159 this._panelToolbar.appendToolbarItem(largerRequestsButton); |
| 160 | 160 |
| 161 var showOverviewButton = new UI.ToolbarSettingToggle( | 161 var showOverviewButton = new UI.ToolbarSettingToggle( |
| 162 this._networkLogShowOverviewSetting, 'largeicon-waterfall', Common.UIStr
ing('Show overview'), | 162 this._networkLogShowOverviewSetting, 'largeicon-waterfall', Common.UIStr
ing('Show overview'), |
| 163 Common.UIString('Hide overview')); | 163 Common.UIString('Hide overview')); |
| 164 this._panelToolbar.appendToolbarItem(showOverviewButton); | 164 this._panelToolbar.appendToolbarItem(showOverviewButton); |
| 165 |
| 166 if (Runtime.experiments.isEnabled('networkGroupingRequests')) { |
| 167 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox( |
| 168 Common.moduleSetting('network.group-by-frame'), '', Common.UIString('G
roup by frame'))); |
| 169 } |
| 170 |
| 165 this._panelToolbar.appendSeparator(); | 171 this._panelToolbar.appendSeparator(); |
| 166 | 172 |
| 167 this._preserveLogCheckbox = new UI.ToolbarCheckbox( | 173 this._preserveLogCheckbox = new UI.ToolbarCheckbox( |
| 168 Common.UIString('Preserve log'), Common.UIString('Do not clear log on pa
ge reload / navigation')); | 174 Common.UIString('Preserve log'), Common.UIString('Do not clear log on pa
ge reload / navigation')); |
| 169 this._preserveLogCheckbox.inputElement.addEventListener( | 175 this._preserveLogCheckbox.inputElement.addEventListener( |
| 170 'change', this._onPreserveLogCheckboxChanged.bind(this), false); | 176 'change', this._onPreserveLogCheckboxChanged.bind(this), false); |
| 171 this._panelToolbar.appendToolbarItem(this._preserveLogCheckbox); | 177 this._panelToolbar.appendToolbarItem(this._preserveLogCheckbox); |
| 172 | 178 |
| 173 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox( | 179 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox( |
| 174 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w
hile DevTools is open)'), | 180 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w
hile DevTools is open)'), |
| 175 Common.UIString('Disable cache')); | 181 Common.UIString('Disable cache')); |
| 176 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); | 182 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); |
| 177 | 183 |
| 178 this._panelToolbar.appendSeparator(); | 184 this._panelToolbar.appendSeparator(); |
| 179 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele
ctor.createOfflineToolbarCheckbox()); | 185 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele
ctor.createOfflineToolbarCheckbox()); |
| 180 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); | 186 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); |
| 181 | 187 |
| 182 this._setupGroupingCombo(); | |
| 183 | |
| 184 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon
tainer)); | 188 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon
tainer)); |
| 185 } | 189 } |
| 186 | 190 |
| 187 _setupGroupingCombo() { | |
| 188 if (!Runtime.experiments.isEnabled('networkGroupingRequests')) | |
| 189 return; | |
| 190 /** @type {!Array<!{value: string, label: string, title: string}>} */ | |
| 191 var options = [{value: '', label: Common.UIString('No grouping'), title: Com
mon.UIString('No grouping')}]; | |
| 192 for (var name of this._networkLogView.groupLookups().keys()) | |
| 193 options.push({value: name, label: Common.UIString(name), title: Common.UIS
tring(name)}); | |
| 194 | |
| 195 var setting = Common.settings.createSetting('networkGrouping', ''); | |
| 196 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingComboBox(options,
setting, Common.UIString('Group by'))); | |
| 197 setting.addChangeListener(event => this._networkLogView.setGrouping(/** @typ
e {string} */ (event.data))); | |
| 198 this._networkLogView.setGrouping(/** @type {string} */ (setting.get())); | |
| 199 } | |
| 200 | |
| 201 /** | 191 /** |
| 202 * @return {!UI.ToolbarComboBox} | 192 * @return {!UI.ToolbarComboBox} |
| 203 */ | 193 */ |
| 204 _createNetworkConditionsSelect() { | 194 _createNetworkConditionsSelect() { |
| 205 var toolbarItem = new UI.ToolbarComboBox(null); | 195 var toolbarItem = new UI.ToolbarComboBox(null); |
| 206 toolbarItem.setMaxWidth(140); | 196 toolbarItem.setMaxWidth(140); |
| 207 NetworkConditions.NetworkConditionsSelector.decorateSelect(toolbarItem.selec
tElement()); | 197 NetworkConditions.NetworkConditionsSelector.decorateSelect(toolbarItem.selec
tElement()); |
| 208 return toolbarItem; | 198 return toolbarItem; |
| 209 } | 199 } |
| 210 | 200 |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 * @param {string} actionId | 716 * @param {string} actionId |
| 727 * @return {boolean} | 717 * @return {boolean} |
| 728 */ | 718 */ |
| 729 handleAction(context, actionId) { | 719 handleAction(context, actionId) { |
| 730 var panel = UI.context.flavor(Network.NetworkPanel); | 720 var panel = UI.context.flavor(Network.NetworkPanel); |
| 731 console.assert(panel && panel instanceof Network.NetworkPanel); | 721 console.assert(panel && panel instanceof Network.NetworkPanel); |
| 732 panel._toggleRecording(); | 722 panel._toggleRecording(); |
| 733 return true; | 723 return true; |
| 734 } | 724 } |
| 735 }; | 725 }; |
| OLD | NEW |