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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2587293002: DevTools: teach TabbedPane.setTabIcon to accept UI.Icon instances (Closed)
Patch Set: formatting Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 // TODO: we should not access network from other modules. 760 // TODO: we should not access network from other modules.
761 if (!UI.inspectorView.hasPanel('network')) 761 if (!UI.inspectorView.hasPanel('network'))
762 return; 762 return;
763 var manager = SDK.multitargetNetworkManager; 763 var manager = SDK.multitargetNetworkManager;
764 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility); 764 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility);
765 var blockedURLsSetting = Common.moduleSetting('blockedURLs'); 765 var blockedURLsSetting = Common.moduleSetting('blockedURLs');
766 blockedURLsSetting.addChangeListener(updateVisibility); 766 blockedURLsSetting.addChangeListener(updateVisibility);
767 updateVisibility(); 767 updateVisibility();
768 768
769 function updateVisibility() { 769 function updateVisibility() {
770 if (manager.isThrottling()) 770 var icon = null;
771 UI.inspectorView.setPanelIcon('network', 'smallicon-warning', Common.UIS tring('Network throttling is enabled')); 771 if (manager.isThrottling()) {
772 else if (blockedURLsSetting.get().length) 772 icon = UI.Icon.create('smallicon-warning');
773 UI.inspectorView.setPanelIcon('network', 'smallicon-warning', Common.UIS tring('Requests may be blocked')); 773 icon.title = Common.UIString('Network throttling is enabled');
774 else 774 } else if (blockedURLsSetting.get().length) {
775 UI.inspectorView.setPanelIcon('network', '', ''); 775 icon = UI.Icon.create('smallicon-warning');
776 icon.title = Common.UIString('Requests may be blocked');
777 }
778 UI.inspectorView.setPanelIcon('network', icon);
776 } 779 }
777 } 780 }
778 }; 781 };
779 782
780 /** 783 /**
781 * @unrestricted 784 * @unrestricted
782 */ 785 */
783 Main.SourcesPanelIndicator = class { 786 Main.SourcesPanelIndicator = class {
784 constructor() { 787 constructor() {
785 Common.moduleSetting('javaScriptDisabled').addChangeListener(javaScriptDisab ledChanged); 788 Common.moduleSetting('javaScriptDisabled').addChangeListener(javaScriptDisab ledChanged);
786 javaScriptDisabledChanged(); 789 javaScriptDisabledChanged();
787 790
788 function javaScriptDisabledChanged() { 791 function javaScriptDisabledChanged() {
792 var icon = null;
789 var javaScriptDisabled = Common.moduleSetting('javaScriptDisabled').get(); 793 var javaScriptDisabled = Common.moduleSetting('javaScriptDisabled').get();
790 if (javaScriptDisabled) 794 if (javaScriptDisabled) {
791 UI.inspectorView.setPanelIcon('sources', 'smallicon-warning', Common.UIS tring('JavaScript is disabled')); 795 icon = UI.Icon.create('smallicon-warning');
792 else 796 icon.title = Common.UIString('JavaScript is disabled');
793 UI.inspectorView.setPanelIcon('sources', '', ''); 797 }
798 UI.inspectorView.setPanelIcon('sources', icon);
794 } 799 }
795 } 800 }
796 }; 801 };
797 802
798 /** 803 /**
799 * @unrestricted 804 * @unrestricted
800 */ 805 */
801 Main.Main.PauseListener = class { 806 Main.Main.PauseListener = class {
802 constructor() { 807 constructor() {
803 SDK.targetManager.addModelListener( 808 SDK.targetManager.addModelListener(
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 * @override 983 * @override
979 * @return {?Element} 984 * @return {?Element}
980 */ 985 */
981 settingElement() { 986 settingElement() {
982 return UI.SettingsUI.createSettingCheckbox( 987 return UI.SettingsUI.createSettingCheckbox(
983 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 988 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
984 } 989 }
985 }; 990 };
986 991
987 new Main.Main(); 992 new Main.Main();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698