Skip to content

Commit a697895

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update MessageDialog
Screenshot: https://imgur.com/a/ZjGYPIz Bug: 325442935 Change-Id: I39da47aea2e8bbd07113a9249f4fc630756f4397 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6257993 Reviewed-by: Kim-Anh Tran <[email protected]> Commit-Queue: Kateryna Prokopenko <[email protected]> Auto-Submit: Kateryna Prokopenko <[email protected]>
1 parent e8cddcb commit a697895

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

front_end/panels/profiler/ProfilesPanel.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,15 @@ const UIStrings = {
6161
*@description Text in Profiles Panel of a profiler tool
6262
*/
6363
cantLoadProfileWhileAnother: 'Can’t load profile while another profile is being recorded.',
64+
/**
65+
*@description Text in Profiles Panel of a profiler tool
66+
*/
67+
profileLoadingFailed: 'Profile loading failed',
6468
/**
6569
*@description Text in Profiles Panel of a profiler tool
6670
*@example {cannot open file} PH1
6771
*/
68-
profileLoadingFailedS: 'Profile loading failed: {PH1}.',
72+
failReason: 'Reason: {PH1}.',
6973
/**
7074
*@description Text in Profiles Panel of a profiler tool
7175
*@example {2} PH1
@@ -230,7 +234,8 @@ export class ProfilesPanel extends UI.Panel.PanelWithSidebar implements DataDisp
230234
const error = await profileType.loadFromFile(file);
231235
if (error && 'message' in error) {
232236
void UI.UIUtils.MessageDialog.show(
233-
i18nString(UIStrings.profileLoadingFailedS, {PH1: error.message}), undefined, 'profile-loading-failed');
237+
i18nString(UIStrings.profileLoadingFailed), i18nString(UIStrings.failReason, {PH1: error.message}), undefined,
238+
'profile-loading-failed');
234239
}
235240
}
236241

front_end/ui/legacy/UIUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ export function createFileSelectorElement(callback: (arg0: File) => void, accept
16191619
export const MaxLengthForDisplayedURLs = 150;
16201620

16211621
export class MessageDialog {
1622-
static async show(message: string, where?: Element|Document, jslogContext?: string): Promise<void> {
1622+
static async show(header: string, message: string, where?: Element|Document, jslogContext?: string): Promise<void> {
16231623
const dialog = new Dialog(jslogContext);
16241624
dialog.setSizeBehavior(SizeBehavior.MEASURE_CONTENT);
16251625
dialog.setDimmed(true);
@@ -1628,6 +1628,7 @@ export class MessageDialog {
16281628
await new Promise(resolve => {
16291629
const okButton = createTextButton(
16301630
i18nString(UIStrings.ok), resolve, {jslogContext: 'confirm', variant: Buttons.Button.Variant.PRIMARY});
1631+
content.createChild('span', 'header').textContent = header;
16311632
content.createChild('div', 'message').createChild('span').textContent = message;
16321633
content.createChild('div', 'button').appendChild(okButton);
16331634
dialog.setOutsideClickCallback(event => {

0 commit comments

Comments
 (0)