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

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

Issue 2938503002: DevTools: unify Network & CPU throttling (Closed)
Patch Set: rebaseline Created 3 years, 5 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox( 180 this._panelToolbar.appendToolbarItem(new UI.ToolbarSettingCheckbox(
181 this._preserveLogSetting, Common.UIString('Do not clear log on page relo ad / navigation'), 181 this._preserveLogSetting, Common.UIString('Do not clear log on page relo ad / navigation'),
182 Common.UIString('Preserve log'))); 182 Common.UIString('Preserve log')));
183 183
184 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox( 184 this._disableCacheCheckbox = new UI.ToolbarSettingCheckbox(
185 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w hile DevTools is open)'), 185 Common.moduleSetting('cacheDisabled'), Common.UIString('Disable cache (w hile DevTools is open)'),
186 Common.UIString('Disable cache')); 186 Common.UIString('Disable cache'));
187 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); 187 this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox);
188 188
189 this._panelToolbar.appendSeparator(); 189 this._panelToolbar.appendSeparator();
190 this._panelToolbar.appendToolbarItem(MobileThrottling.NetworkConditionsSelec tor.createOfflineToolbarCheckbox()); 190 this._offlineCheckboxRefForTest = MobileThrottling.NetworkThrottlingSelector .createOfflineToolbarCheckbox();
dgozman 2017/06/28 22:33:09 drop RefForTest
chenwilliam 2017/06/29 20:34:02 Done.
191 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); 191 this._panelToolbar.appendToolbarItem(this._offlineCheckboxRefForTest);
192 this._throttlingRefForTest = this._createThrottlingConditionsSelect();
193 this._panelToolbar.appendToolbarItem(this._throttlingRefForTest);
192 194
193 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon tainer)); 195 this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarCon tainer));
194 } 196 }
195 197
196 /** 198 /**
197 * @return {!UI.ToolbarComboBox} 199 * @return {!UI.ToolbarComboBox}
198 */ 200 */
199 _createNetworkConditionsSelect() { 201 _createThrottlingConditionsSelect() {
200 var toolbarItem = new UI.ToolbarComboBox(null); 202 var toolbarItem = new UI.ToolbarComboBox(null);
201 toolbarItem.setMaxWidth(140); 203 toolbarItem.setMaxWidth(160);
202 MobileThrottling.NetworkConditionsSelector.decorateSelect(toolbarItem.select Element()); 204 MobileThrottling.NetworkThrottlingSelector.decorateSelect(toolbarItem.select Element());
203 return toolbarItem; 205 return toolbarItem;
204 } 206 }
205 207
206 _toggleRecording() { 208 _toggleRecording() {
207 if (!this._preserveLogSetting.get() && !this._toggleRecordAction.toggled()) 209 if (!this._preserveLogSetting.get() && !this._toggleRecordAction.toggled())
208 NetworkLog.networkLog.reset(); 210 NetworkLog.networkLog.reset();
209 this._toggleRecord(!this._toggleRecordAction.toggled()); 211 this._toggleRecord(!this._toggleRecordAction.toggled());
210 } 212 }
211 213
212 /** 214 /**
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 * @param {string} actionId 711 * @param {string} actionId
710 * @return {boolean} 712 * @return {boolean}
711 */ 713 */
712 handleAction(context, actionId) { 714 handleAction(context, actionId) {
713 var panel = UI.context.flavor(Network.NetworkPanel); 715 var panel = UI.context.flavor(Network.NetworkPanel);
714 console.assert(panel && panel instanceof Network.NetworkPanel); 716 console.assert(panel && panel instanceof Network.NetworkPanel);
715 panel._toggleRecording(); 717 panel._toggleRecording();
716 return true; 718 return true;
717 } 719 }
718 }; 720 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698