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

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

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

Powered by Google App Engine
This is Rietveld 408576698