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

Side by Side Diff: Source/devtools/front_end/emulation/OverridesView.js

Issue 1186083003: [DevTools] Move network throttling to network panel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged in device mode Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 __proto__: WebInspector.OverridesView.Tab.prototype 295 __proto__: WebInspector.OverridesView.Tab.prototype
296 } 296 }
297 297
298 298
299 /** 299 /**
300 * @constructor 300 * @constructor
301 * @extends {WebInspector.OverridesView.Tab} 301 * @extends {WebInspector.OverridesView.Tab}
302 */ 302 */
303 WebInspector.OverridesView.NetworkTab = function() 303 WebInspector.OverridesView.NetworkTab = function()
304 { 304 {
305 WebInspector.OverridesView.Tab.call(this, "network", WebInspector.UIString(" Network"), [], [this._userAgentOverrideEnabled.bind(this), this._networkThroughp utIsLimited.bind(this)]); 305 WebInspector.OverridesView.Tab.call(this, "network", WebInspector.UIString(" Network"), [], [this._userAgentOverrideEnabled.bind(this)]);
306 this.element.classList.add("overrides-network"); 306 this.element.classList.add("overrides-network");
307 this._createNetworkConditionsElement();
308 this._createUserAgentSection(); 307 this._createUserAgentSection();
309 } 308 }
310 309
311 WebInspector.OverridesView.NetworkTab.prototype = { 310 WebInspector.OverridesView.NetworkTab.prototype = {
312 /** 311 /**
313 * @return {boolean} 312 * @return {boolean}
314 */ 313 */
315 _networkThroughputIsLimited: function()
316 {
317 return WebInspector.overridesSupport.networkThroughputIsLimited();
318 },
319
320 _createNetworkConditionsElement: function()
321 {
322 var fieldsetElement = this.element.createChild("fieldset");
323 fieldsetElement.createChild("span").textContent = WebInspector.UIString( "Limit network throughput:");
324 fieldsetElement.createChild("br");
325 fieldsetElement.appendChild(WebInspector.OverridesUI.createNetworkCondit ionsSelect());
326
327 WebInspector.overridesSupport.settings.networkConditions.addChangeListen er(this.updateActiveState, this);
328 },
329
330 /**
331 * @return {boolean}
332 */
333 _userAgentOverrideEnabled: function() 314 _userAgentOverrideEnabled: function()
334 { 315 {
335 return !!WebInspector.overridesSupport.settings.userAgent.get(); 316 return !!WebInspector.overridesSupport.settings.userAgent.get();
336 }, 317 },
337 318
338 _createUserAgentSection: function() 319 _createUserAgentSection: function()
339 { 320 {
340 var fieldsetElement = this.element.createChild("fieldset"); 321 var fieldsetElement = this.element.createChild("fieldset");
341 fieldsetElement.createChild("label").textContent = WebInspector.UIString ("Spoof user agent:"); 322 fieldsetElement.createChild("label").textContent = WebInspector.UIString ("Spoof user agent:");
342 var selectAndInput = WebInspector.OverridesUI.createUserAgentSelectAndIn put(); 323 var selectAndInput = WebInspector.OverridesUI.createUserAgentSelectAndIn put();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 * @override 617 * @override
637 * @param {!Object} overridesSupport 618 * @param {!Object} overridesSupport
638 * @return {!Promise} 619 * @return {!Promise}
639 */ 620 */
640 reveal: function(overridesSupport) 621 reveal: function(overridesSupport)
641 { 622 {
642 WebInspector.inspectorView.showViewInDrawer("emulation"); 623 WebInspector.inspectorView.showViewInDrawer("emulation");
643 return Promise.resolve(); 624 return Promise.resolve();
644 } 625 }
645 } 626 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/emulation/OverridesUI.js ('k') | Source/devtools/front_end/emulation/ResponsiveDesignView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698