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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js

Issue 2903183002: [Devtools] Moved preserve log to a setting (Closed)
Patch Set: [Devtools] Moved preserve log to a setting Created 3 years, 6 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
OLDNEW
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 this._networkLogShowOverviewSetting, 'largeicon-waterfall', Common.UIStr ing('Show overview'), 166 this._networkLogShowOverviewSetting, 'largeicon-waterfall', Common.UIStr ing('Show overview'),
167 Common.UIString('Hide overview')); 167 Common.UIString('Hide overview'));
168 this._panelToolbar.appendToolbarItem(showOverviewButton); 168 this._panelToolbar.appendToolbarItem(showOverviewButton);
169 169
170 if (Runtime.experiments.isEnabled('networkGroupingRequests')) { 170 if (Runtime.experiments.isEnabled('networkGroupingRequests')) {
171 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox( 171 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox(
172 Common.moduleSetting('network.group-by-frame'), '', Common.UIString('G roup by frame'))); 172 Common.moduleSetting('network.group-by-frame'), '', Common.UIString('G roup by frame')));
173 } 173 }
174 174
175 this._panelToolbar.appendSeparator(); 175 this._panelToolbar.appendSeparator();
176 176 this._preserveLogSetting = Common.moduleSetting('network.preserve-log');
177 this._preserveLogCheckbox = new UI.ToolbarCheckbox( 177 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox(
178 Common.UIString('Preserve log'), Common.UIString('Do not clear log on pa ge reload / navigation')); 178 this._preserveLogSetting, Common.UIString('Do not clear log on page relo ad / navigation'),
179 this._preserveLogCheckbox.inputElement.addEventListener( 179 Common.UIString('Preserve log')));
180 'change', this._onPreserveLogCheckboxChanged.bind(this), false);
181 this._panelToolbar.appendToolbarItem(this._preserveLogCheckbox);
182 180
183 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox( 181 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox(
184 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w hile DevTools is open)'), 182 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w hile DevTools is open)'),
185 Common.UIString('Disable cache')); 183 Common.UIString('Disable cache'));
186 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); 184 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox);
187 185
188 this._panelToolbar.appendSeparator(); 186 this._panelToolbar.appendSeparator();
189 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele ctor.createOfflineToolbarCheckbox()); 187 this._panelToolbar.appendToolbarItem(NetworkConditions.NetworkConditionsSele ctor.createOfflineToolbarCheckbox());
190 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); 188 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect());
191 189
192 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon tainer)); 190 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon tainer));
193 } 191 }
194 192
195 /** 193 /**
196 * @return {!UI.ToolbarComboBox} 194 * @return {!UI.ToolbarComboBox}
197 */ 195 */
198 _createNetworkConditionsSelect() { 196 _createNetworkConditionsSelect() {
199 var toolbarItem = new UI.ToolbarComboBox(null); 197 var toolbarItem = new UI.ToolbarComboBox(null);
200 toolbarItem.setMaxWidth(140); 198 toolbarItem.setMaxWidth(140);
201 NetworkConditions.NetworkConditionsSelector.decorateSelect(toolbarItem.selec tElement()); 199 NetworkConditions.NetworkConditionsSelector.decorateSelect(toolbarItem.selec tElement());
202 return toolbarItem; 200 return toolbarItem;
203 } 201 }
204 202
205 _toggleRecording() { 203 _toggleRecording() {
206 if (!this._preserveLogCheckbox.checked() && !this._toggleRecordAction.toggle d()) 204 if (!this._preserveLogSetting.get() && !this._toggleRecordAction.toggled())
207 this._reset(); 205 this._reset();
208 this._toggleRecord(!this._toggleRecordAction.toggled()); 206 this._toggleRecord(!this._toggleRecordAction.toggled());
209 } 207 }
210 208
211 /** 209 /**
212 * @param {boolean} toggled 210 * @param {boolean} toggled
213 */ 211 */
214 _toggleRecord(toggled) { 212 _toggleRecord(toggled) {
215 this._toggleRecordAction.setToggled(toggled); 213 this._toggleRecordAction.setToggled(toggled);
216 this._networkLogView.setRecording(toggled); 214 this._networkLogView.setRecording(toggled);
(...skipping 17 matching lines...) Expand all
234 * @return {number} 232 * @return {number}
235 */ 233 */
236 function mapTimestamp(frame) { 234 function mapTimestamp(frame) {
237 return frame.timestamp / 1000; 235 return frame.timestamp / 1000;
238 } 236 }
239 237
240 this._networkLogView.addFilmStripFrames(timestamps); 238 this._networkLogView.addFilmStripFrames(timestamps);
241 } 239 }
242 240
243 /** 241 /**
244 * @param {!Event} event
245 */
246 _onPreserveLogCheckboxChanged(event) {
247 this._networkLogView.setPreserveLog(this._preserveLogCheckbox.checked());
248 }
249
250 /**
251 * @param {!Common.Event} event 242 * @param {!Common.Event} event
252 */ 243 */
253 _onClearButtonClicked(event) { 244 _onClearButtonClicked(event) {
254 this._reset(); 245 this._reset();
255 } 246 }
256 247
257 _reset() { 248 _reset() {
258 this._calculator.reset(); 249 this._calculator.reset();
259 this._overviewPane.reset(); 250 this._overviewPane.reset();
260 this._networkLogView.reset(); 251 this._networkLogView.reset();
261 Network.BlockedURLsPane.reset(); 252 Network.BlockedURLsPane.reset();
262 if (this._filmStripView) 253 if (this._filmStripView)
263 this._resetFilmStripView(); 254 this._resetFilmStripView();
264 } 255 }
265 256
266 /** 257 /**
267 * @param {!Common.Event} event 258 * @param {!Common.Event} event
268 */ 259 */
269 _willReloadPage(event) { 260 _willReloadPage(event) {
270 if (!this._preserveLogCheckbox.checked()) 261 if (!this._preserveLogSetting.get())
271 this._reset(); 262 this._reset();
272 this._toggleRecord(true); 263 this._toggleRecord(true);
273 if (this._pendingStopTimer) { 264 if (this._pendingStopTimer) {
274 clearTimeout(this._pendingStopTimer); 265 clearTimeout(this._pendingStopTimer);
275 delete this._pendingStopTimer; 266 delete this._pendingStopTimer;
276 } 267 }
277 if (this.isShowing() && this._filmStripRecorder) 268 if (this.isShowing() && this._filmStripRecorder)
278 this._filmStripRecorder.startRecording(); 269 this._filmStripRecorder.startRecording();
279 } 270 }
280 271
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 * @param {string} actionId 711 * @param {string} actionId
721 * @return {boolean} 712 * @return {boolean}
722 */ 713 */
723 handleAction(context, actionId) { 714 handleAction(context, actionId) {
724 var panel = UI.context.flavor(Network.NetworkPanel); 715 var panel = UI.context.flavor(Network.NetworkPanel);
725 console.assert(panel && panel instanceof Network.NetworkPanel); 716 console.assert(panel && panel instanceof Network.NetworkPanel);
726 panel._toggleRecording(); 717 panel._toggleRecording();
727 return true; 718 return true;
728 } 719 }
729 }; 720 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698