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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js

Issue 2932703002: Revert 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
index eeb0e03da41697b3cc3dd9eea3f5e9cd4f63ddb0..cc8ee55fe6c41e307f9cc4fe36bcab75148ae69c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -328,9 +328,9 @@
_connectAndCreateMainTarget() {
if (Runtime.queryParam('nodeFrontend')) {
var target = new SDK.Target(
- this, 'main', Common.UIString('Node.js'), SDK.Target.Capability.Target, this._createMainConnection.bind(this),
+ this, 'main', Common.UIString('Node'), SDK.Target.Capability.Target, this._createMainConnection.bind(this),
null);
- target.setInspectedURL('Node.js');
+ target.setInspectedURL('Node');
this._childTargetManagers.set(target, new SDK.ChildTargetManager(this, target));
Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSFromFrontend);
return;
@@ -410,15 +410,13 @@
if (Runtime.experiments.isEnabled('autoAttachToCrossProcessSubframes'))
this._targetAgent.setAttachToFrames(true);
- if (!parentTarget.parentTarget()) {
+ if (!parentTarget.parentTarget())
this._targetAgent.setDiscoverTargets(true);
- if (Runtime.queryParam('nodeFrontend')) {
- InspectorFrontendHost.setDevicesUpdatesEnabled(true);
- InspectorFrontendHost.events.addEventListener(
- InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this._devicesDiscoveryConfigChanged, this);
- } else {
- this._targetAgent.setRemoteLocations([{host: 'localhost', port: 9229}]);
- }
+
+ if (Runtime.queryParam('nodeFrontend') && !this._parentTarget.parentTarget()) {
+ InspectorFrontendHost.setDevicesUpdatesEnabled(true);
+ InspectorFrontendHost.events.addEventListener(
+ InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this._devicesDiscoveryConfigChanged, this);
}
}
@@ -431,8 +429,7 @@
for (var address of config.networkDiscoveryConfig) {
var parts = address.split(':');
var port = parseInt(parts[1], 10);
- if (parts[0] && port)
- locations.push({host: parts[0], port: port});
+ locations.push({host: parts[0] || 'localhost', port: port || 9229});
}
this._targetAgent.setRemoteLocations(locations);
}
@@ -516,7 +513,7 @@
attachedToTarget(targetInfo, waitingForDebugger) {
var targetName = '';
if (targetInfo.type === 'node') {
- targetName = Common.UIString('Node.js: %s', targetInfo.url);
+ targetName = Common.UIString('Node: %s', targetInfo.url);
} else if (targetInfo.type !== 'iframe') {
var parsedURL = targetInfo.url.asParsedURL();
targetName =

Powered by Google App Engine
This is Rietveld 408576698