@@ -14,6 +14,9 @@ import * as AutofillManager from '../../models/autofill_manager/autofill_manager
1414import * as ComponentHelpers from '../../ui/components/helpers/helpers.js' ;
1515import * as Input from '../../ui/components/input/input.js' ;
1616import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js' ;
17+ // inspectorCommonStyles is imported for the empty state styling that is used for the start view
18+ // eslint-disable-next-line rulesdir/es-modules-import
19+ import inspectorCommonStylesRaw from '../../ui/legacy/inspectorCommon.css.js' ;
1720import * as Lit from '../../ui/lit/lit.js' ;
1821import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
1922
@@ -23,10 +26,18 @@ import autofillViewStylesRaw from './autofillView.css.js';
2326const autofillViewStyles = new CSSStyleSheet ( ) ;
2427autofillViewStyles . replaceSync ( autofillViewStylesRaw . cssContent ) ;
2528
29+ // TODO(crbug.com/391381439): Fully migrate off of constructed style sheets.
30+ const inspectorCommonStyles = new CSSStyleSheet ( ) ;
31+ inspectorCommonStyles . replaceSync ( inspectorCommonStylesRaw . cssContent ) ;
32+
2633const { html, render, Directives : { styleMap} } = Lit ;
2734const { FillingStrategy} = Protocol . Autofill ;
2835
2936const UIStrings = {
37+ /**
38+ * @description Text shown when there is no data on autofill available.
39+ */
40+ noAutofill : 'No autofill detected' ,
3041 /**
3142 * @description Explanation for how to populate the autofill panel with data. Shown when there is
3243 * no data available.
@@ -123,7 +134,7 @@ export class AutofillView extends LegacyWrapper.LegacyWrapper.WrappableComponent
123134 }
124135
125136 connectedCallback ( ) : void {
126- this . #shadow. adoptedStyleSheets = [ Input . checkboxStyles , autofillViewStyles ] ;
137+ this . #shadow. adoptedStyleSheets = [ Input . checkboxStyles , autofillViewStyles , inspectorCommonStyles ] ;
127138 const autofillManager = AutofillManager . AutofillManager . AutofillManager . instance ( ) ;
128139 const formFilledEvent = autofillManager . getLastFilledAddressForm ( ) ;
129140 if ( formFilledEvent ) {
@@ -192,9 +203,12 @@ export class AutofillView extends LegacyWrapper.LegacyWrapper.WrappableComponent
192203 < x-link href =${ AUTOFILL_FEEDBACK_URL } class ="feedback link" jslog=${ VisualLogging . link ( 'feedback' ) . track ( { click : true } ) } > ${ i18nString ( UIStrings . sendFeedback ) } </ x-link >
193204 </ div >
194205 < div class ="placeholder-container " jslog =${ VisualLogging . pane ( 'autofill-empty' ) } >
195- < div class ="placeholder ">
196- < div > ${ i18nString ( UIStrings . toStartDebugging ) } </ div >
197- < x-link href =${ AUTOFILL_INFO_URL } class ="link" jslog=${ VisualLogging . link ( 'learn-more' ) . track ( { click : true } ) } > ${ i18nString ( UIStrings . learnMore ) } </ x-link >
206+ < div class ="empty-state ">
207+ < span class ="empty-state-header "> ${ i18nString ( UIStrings . noAutofill ) } </ span >
208+ < div class ="empty-state-description ">
209+ < span > ${ i18nString ( UIStrings . toStartDebugging ) } </ span >
210+ < x-link href =${ AUTOFILL_INFO_URL } class ="link" jslog=${ VisualLogging . link ( 'learn-more' ) . track ( { click : true } ) } > ${ i18nString ( UIStrings . learnMore ) } </ x-link >
211+ </ div >
198212 </ div >
199213 </ div >
200214 </ main >
0 commit comments