@@ -6,6 +6,7 @@ import '../../ui/legacy/legacy.js';
66
77import type * as Common from '../../core/common/common.js' ;
88import * as i18n from '../../core/i18n/i18n.js' ;
9+ import type * as Platform from '../../core/platform/platform.js' ;
910import * as SDK from '../../core/sdk/sdk.js' ;
1011import type * as Protocol from '../../generated/protocol.js' ;
1112import * as UI from '../../ui/legacy/legacy.js' ;
@@ -18,21 +19,29 @@ import webAudioStyles from './webAudio.css.js';
1819import { Events as ModelEvents , WebAudioModel } from './WebAudioModel.js' ;
1920
2021const UIStrings = {
22+ /**
23+ *@description Text in Web Audio View if there is nothing to show.
24+ * Web Audio API is an API for controlling audio on the web.
25+ */
26+ noWebAudio : 'No web audio API usage detected' ,
2127 /**
2228 *@description Text in Web Audio View
2329 */
24- openAPageThatUsesWebAudioApiTo : 'Open a page that uses Web Audio API to start monitoring.' ,
30+ openAPageThatUsesWebAudioApiTo : 'Open a page that uses web audio API to start monitoring.' ,
2531} ;
2632const str_ = i18n . i18n . registerUIStrings ( 'panels/web_audio/WebAudioView.ts' , UIStrings ) ;
2733const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
2834
35+ const WEBAUDIO_EXPLANATION_URL =
36+ 'https://developer.chrome.com/docs/devtools/webaudio' as Platform . DevToolsPath . UrlString ;
37+
2938export class WebAudioView extends UI . ThrottledWidget . ThrottledWidget implements
3039 SDK . TargetManager . SDKModelObserver < WebAudioModel > {
3140 private readonly contextSelector : AudioContextSelector ;
3241 private readonly contentContainer : HTMLElement ;
3342 private readonly detailViewContainer : HTMLElement ;
3443 private graphManager : GraphVisualizer . GraphManager . GraphManager ;
35- private readonly landingPage : UI . Widget . VBox ;
44+ private readonly landingPage : UI . EmptyWidget . EmptyWidget ;
3645 private readonly summaryBarContainer : HTMLElement ;
3746 constructor ( ) {
3847 super ( true , 1000 ) ;
@@ -60,13 +69,9 @@ export class WebAudioView extends UI.ThrottledWidget.ThrottledWidget implements
6069 this . graphManager = new GraphVisualizer . GraphManager . GraphManager ( ) ;
6170
6271 // Creates the landing page.
63- this . landingPage = new UI . Widget . VBox ( ) ;
64- this . landingPage . contentElement . classList . add ( 'web-audio-landing-page' , 'fill' ) ;
65- this . landingPage . contentElement . appendChild ( UI . Fragment . html `
66- < div >
67- < p > ${ i18nString ( UIStrings . openAPageThatUsesWebAudioApiTo ) } </ p >
68- </ div >
69- ` ) ;
72+ this . landingPage = new UI . EmptyWidget . EmptyWidget (
73+ i18nString ( UIStrings . noWebAudio ) , i18nString ( UIStrings . openAPageThatUsesWebAudioApiTo ) ) ;
74+ this . landingPage . appendLink ( WEBAUDIO_EXPLANATION_URL ) ;
7075 this . landingPage . show ( this . detailViewContainer ) ;
7176
7277 // Creates the summary bar.
0 commit comments