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

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

Issue 2927063003: Revert of [DevTools] Show icon in top toolbar when Node target is available (patchset #3 id:40001 o… (Closed)
Patch Set: Created 3 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
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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 continue; 722 continue;
723 moreTools.appendItem(extension.title(), UI.viewManager.showView.bind(UI.vi ewManager, descriptor['id'])); 723 moreTools.appendItem(extension.title(), UI.viewManager.showView.bind(UI.vi ewManager, descriptor['id']));
724 } 724 }
725 725
726 var helpSubMenu = contextMenu.namedSubMenu('mainMenuHelp'); 726 var helpSubMenu = contextMenu.namedSubMenu('mainMenuHelp');
727 helpSubMenu.appendAction('settings.documentation'); 727 helpSubMenu.appendAction('settings.documentation');
728 helpSubMenu.appendItem('Release Notes', () => InspectorFrontendHost.openInNe wTab(Help.latestReleaseNote().link)); 728 helpSubMenu.appendItem('Release Notes', () => InspectorFrontendHost.openInNe wTab(Help.latestReleaseNote().link));
729 } 729 }
730 }; 730 };
731 731
732 /**
733 * @implements {UI.ToolbarItem.Provider}
734 */
735 Main.Main.NodeIndicator = class {
736 constructor() {
737 var element = createElement('div');
738 var shadowRoot = UI.createShadowRootWithCoreStyles(element, 'main/nodeIcon.c ss');
739 this._element = shadowRoot.createChild('div', 'node-icon');
740 element.addEventListener('click', () => InspectorFrontendHost.openNodeFronte nd(), false);
741 this._button = new UI.ToolbarItem(element);
742 this._button.setTitle(Common.UIString('Open dedicated DevTools for Node.js') );
743 SDK.targetManager.addEventListener(SDK.TargetManager.Events.AvailableNodeTar getsChanged, this._update, this);
744 this._button.setVisible(false);
745 this._update();
746 }
747
748 _update() {
749 this._element.classList.toggle('inactive', !SDK.targetManager.availableNodeT argetsCount());
750 if (SDK.targetManager.availableNodeTargetsCount())
751 this._button.setVisible(true);
752 }
753
754 /**
755 * @override
756 * @return {?UI.ToolbarItem}
757 */
758 item() {
759 return this._button;
760 }
761 };
762
763 Main.NetworkPanelIndicator = class { 732 Main.NetworkPanelIndicator = class {
764 constructor() { 733 constructor() {
765 // TODO: we should not access network from other modules. 734 // TODO: we should not access network from other modules.
766 if (!UI.inspectorView.hasPanel('network')) 735 if (!UI.inspectorView.hasPanel('network'))
767 return; 736 return;
768 var manager = SDK.multitargetNetworkManager; 737 var manager = SDK.multitargetNetworkManager;
769 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility); 738 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility);
770 manager.addEventListener(SDK.MultitargetNetworkManager.Events.BlockedPattern sChanged, updateVisibility); 739 manager.addEventListener(SDK.MultitargetNetworkManager.Events.BlockedPattern sChanged, updateVisibility);
771 updateVisibility(); 740 updateVisibility();
772 741
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 * @override 953 * @override
985 * @return {?Element} 954 * @return {?Element}
986 */ 955 */
987 settingElement() { 956 settingElement() {
988 return UI.SettingsUI.createSettingCheckbox( 957 return UI.SettingsUI.createSettingCheckbox(
989 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 958 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
990 } 959 }
991 }; 960 };
992 961
993 new Main.Main(); 962 new Main.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698