@@ -375,8 +375,10 @@ class DevHandler {
375375
376376 appServices.connectedInstanceId = appConnection.request.instanceId;
377377 dwdsStats.devToolsStart = DateTime .now ();
378- await _launchDevTools (appServices.chromeProxyService.remoteDebugger,
379- _constructDevToolsUri (appServices.debugService.uri));
378+ await _launchDevTools (
379+ appServices.chromeProxyService.remoteDebugger,
380+ _constructDevToolsUri (appServices.debugService.uri,
381+ ideQueryParam: 'Dwds' ));
380382 }
381383
382384 Future <AppConnection > _handleConnectRequest (
@@ -523,16 +525,24 @@ class DevHandler {
523525 extensionDebugConnections.add (DebugConnection (appServices));
524526 _servicesByAppId[appId] = appServices;
525527 }
526- final devToolsUri = _constructDevToolsUri (
527- await _servicesByAppId[appId].debugService.encodedUri);
528+ final encodedUri = await _servicesByAppId[appId].debugService.encodedUri;
528529 dwdsStats.devToolsStart = DateTime .now ();
529530
530- // If we only want the URI, then return early.
531+ // If we only want the URI, this means we are embedding Dart DevTools in
532+ // Chrome DevTools. Therefore return early.
531533 if (devToolsRequest.uriOnly != null && devToolsRequest.uriOnly) {
534+ final devToolsUri = _constructDevToolsUri (
535+ encodedUri,
536+ ideQueryParam: 'ChromeDevTools' ,
537+ );
532538 extensionDebugger.sendEvent ('dwds.devtoolsUri' , devToolsUri);
533539 return ;
534540 }
535541
542+ final devToolsUri = _constructDevToolsUri (
543+ encodedUri,
544+ ideQueryParam: 'DebugExtension' ,
545+ );
536546 await _launchDevTools (extensionDebugger, devToolsUri);
537547 });
538548 }
@@ -549,12 +559,18 @@ class DevHandler {
549559 });
550560 }
551561
552- String _constructDevToolsUri (String debugServiceUri) {
562+ String _constructDevToolsUri (
563+ String debugServiceUri, {
564+ String ideQueryParam = '' ,
565+ }) {
553566 return Uri (
554567 scheme: 'http' ,
555568 host: _devTools.hostname,
556569 port: _devTools.port,
557- queryParameters: {'uri' : debugServiceUri}).toString ();
570+ queryParameters: {
571+ 'uri' : debugServiceUri,
572+ if (ideQueryParam.isNotEmpty) 'ide' : ideQueryParam,
573+ }).toString ();
558574 }
559575}
560576
0 commit comments