| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Infobar} | 7 * @extends {WebInspector.Infobar} |
| 8 */ | 8 */ |
| 9 WebInspector.DataSaverInfobar = function() | 9 WebInspector.DataSaverInfobar = function() |
| 10 { | 10 { |
| 11 WebInspector.Infobar.call(this, WebInspector.Infobar.Type.Warning, WebInspec
tor.UIString("Consider disabling Chrome Data Saver while debugging."), WebInspec
tor.settings.moduleSetting("disableDataSaverInfobar")); | 11 WebInspector.Infobar.call(this, WebInspector.Infobar.Type.Warning, WebInspec
tor.UIString("Consider disabling Chrome Data Saver while debugging."), WebInspec
tor.settings.moduleSetting("disableDataSaverInfobar")); |
| 12 var message = this.createDetailsRowMessage(); | 12 var message = this.createDetailsRowMessage(); |
| 13 message.createTextChild("More information about "); | 13 message.createTextChild("More information about "); |
| 14 message.appendChild(WebInspector.linkifyURLAsNode("https://support.google.co
m/chrome/answer/2392284?hl=en", "Chrome Data Saver", undefined, true)); | 14 message.appendChild(WebInspector.linkifyURLAsNode("https://support.google.co
m/chrome/answer/2392284?hl=en", "Chrome Data Saver", undefined, true)); |
| 15 message.createTextChild("."); | 15 message.createTextChild("."); |
| 16 } | 16 }; |
| 17 | 17 |
| 18 WebInspector.DataSaverInfobar._infobars = []; | 18 WebInspector.DataSaverInfobar._infobars = []; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * @param {!WebInspector.Panel} panel | 21 * @param {!WebInspector.Panel} panel |
| 22 */ | 22 */ |
| 23 WebInspector.DataSaverInfobar.maybeShowInPanel = function(panel) | 23 WebInspector.DataSaverInfobar.maybeShowInPanel = function(panel) |
| 24 { | 24 { |
| 25 if (Runtime.queryParam("remoteFrontend")) { | 25 if (Runtime.queryParam("remoteFrontend")) { |
| 26 var infobar = new WebInspector.DataSaverInfobar(); | 26 var infobar = new WebInspector.DataSaverInfobar(); |
| 27 WebInspector.DataSaverInfobar._infobars.push(infobar); | 27 WebInspector.DataSaverInfobar._infobars.push(infobar); |
| 28 panel.showInfobar(infobar); | 28 panel.showInfobar(infobar); |
| 29 } | 29 } |
| 30 } | 30 }; |
| 31 | 31 |
| 32 WebInspector.DataSaverInfobar.prototype = { | 32 WebInspector.DataSaverInfobar.prototype = { |
| 33 /** | 33 /** |
| 34 * @override | 34 * @override |
| 35 */ | 35 */ |
| 36 dispose: function() | 36 dispose: function() |
| 37 { | 37 { |
| 38 for (var infobar of WebInspector.DataSaverInfobar._infobars) | 38 for (var infobar of WebInspector.DataSaverInfobar._infobars) |
| 39 WebInspector.Infobar.prototype.dispose.call(infobar); | 39 WebInspector.Infobar.prototype.dispose.call(infobar); |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 __proto__: WebInspector.Infobar.prototype | 42 __proto__: WebInspector.Infobar.prototype |
| 43 } | 43 }; |
| OLD | NEW |