| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 /** | 748 /** |
| 749 * @unrestricted | 749 * @unrestricted |
| 750 */ | 750 */ |
| 751 Main.NetworkPanelIndicator = class { | 751 Main.NetworkPanelIndicator = class { |
| 752 constructor() { | 752 constructor() { |
| 753 // TODO: we should not access network from other modules. | 753 // TODO: we should not access network from other modules. |
| 754 if (!UI.inspectorView.hasPanel('network')) | 754 if (!UI.inspectorView.hasPanel('network')) |
| 755 return; | 755 return; |
| 756 var manager = SDK.multitargetNetworkManager; | 756 var manager = SDK.multitargetNetworkManager; |
| 757 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan
ged, updateVisibility); | 757 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan
ged, updateVisibility); |
| 758 var blockedURLsSetting = Common.moduleSetting('blockedURLs'); | 758 var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs'); |
| 759 blockedURLsSetting.addChangeListener(updateVisibility); | 759 blockedURLsSetting.addChangeListener(updateVisibility); |
| 760 updateVisibility(); | 760 updateVisibility(); |
| 761 | 761 |
| 762 function updateVisibility() { | 762 function updateVisibility() { |
| 763 var icon = null; | 763 var icon = null; |
| 764 if (manager.isThrottling()) { | 764 if (manager.isThrottling()) { |
| 765 icon = UI.Icon.create('smallicon-warning'); | 765 icon = UI.Icon.create('smallicon-warning'); |
| 766 icon.title = Common.UIString('Network throttling is enabled'); | 766 icon.title = Common.UIString('Network throttling is enabled'); |
| 767 } else if (blockedURLsSetting.get().length) { | 767 } else if (blockedURLsSetting.get().length) { |
| 768 icon = UI.Icon.create('smallicon-warning'); | 768 icon = UI.Icon.create('smallicon-warning'); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 * @override | 976 * @override |
| 977 * @return {?Element} | 977 * @return {?Element} |
| 978 */ | 978 */ |
| 979 settingElement() { | 979 settingElement() { |
| 980 return UI.SettingsUI.createSettingCheckbox( | 980 return UI.SettingsUI.createSettingCheckbox( |
| 981 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); | 981 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); |
| 982 } | 982 } |
| 983 }; | 983 }; |
| 984 | 984 |
| 985 new Main.Main(); | 985 new Main.Main(); |
| OLD | NEW |