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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Components.DataSaverInfobar = class extends UI.Infobar { | 7 Main.DataSaverInfobar = class extends UI.Infobar { |
8 constructor() { | 8 constructor() { |
9 super( | 9 super( |
10 UI.Infobar.Type.Warning, Common.UIString('Consider disabling Chrome Data
Saver while debugging.'), | 10 UI.Infobar.Type.Warning, Common.UIString('Consider disabling Chrome Data
Saver while debugging.'), |
11 Common.settings.moduleSetting('disableDataSaverInfobar')); | 11 Common.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(UI.createExternalLink( | 14 message.appendChild(UI.createExternalLink( |
15 'https://support.google.com/chrome/answer/2392284?hl=en', Common.UIStrin
g('Chrome Data Saver'))); | 15 'https://support.google.com/chrome/answer/2392284?hl=en', Common.UIStrin
g('Chrome Data Saver'))); |
16 message.createTextChild('.'); | 16 message.createTextChild('.'); |
17 } | 17 } |
18 | 18 |
19 /** | 19 /** |
20 * @param {!UI.Panel} panel | 20 * @param {!UI.Panel} panel |
21 */ | 21 */ |
22 static maybeShowInPanel(panel) { | 22 static maybeShowInPanel(panel) { |
23 if (Runtime.queryParam('remoteFrontend')) { | 23 if (Runtime.queryParam('remoteFrontend')) { |
24 var infobar = new Components.DataSaverInfobar(); | 24 var infobar = new Main.DataSaverInfobar(); |
25 Components.DataSaverInfobar._infobars.push(infobar); | 25 Main.DataSaverInfobar._infobars.push(infobar); |
26 panel.showInfobar(infobar); | 26 panel.showInfobar(infobar); |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 /** | 30 /** |
31 * @override | 31 * @override |
32 */ | 32 */ |
33 dispose() { | 33 dispose() { |
34 for (var infobar of Components.DataSaverInfobar._infobars) | 34 for (var infobar of Main.DataSaverInfobar._infobars) |
35 infobar.dispose(); | 35 infobar.dispose(); |
36 } | 36 } |
37 }; | 37 }; |
38 | 38 |
39 Components.DataSaverInfobar._infobars = []; | 39 Main.DataSaverInfobar._infobars = []; |
OLD | NEW |