Enable load-time data support for component extensions [chromium/src : main]

0 views
Skip to first unread message

Moe Ahmadi (Gerrit)

unread,
Jul 8, 2026, 8:56:18 PM (22 hours ago) Jul 8
to Demetrios Papadopoulos, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
Attention needed from Demetrios Papadopoulos and Devlin Cronin

Moe Ahmadi voted and added 3 comments

Votes added by Moe Ahmadi

Commit-Queue+1

3 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Moe Ahmadi . resolved

rdevlin.cronin: //c/b/extensions and extensions/browser
dpapad: //c/b/resources/omnibox and //c/b/ui/webui/omnibox

File-level comment, Patchset 2 (Latest):
Demetrios Papadopoulos . unresolved

Overall this approach is addressing my previous concern from https://chromium-review.googlesource.com/c/chromium/src/+/8027188/comment/e2862f6a_199652fe/, as it no longer involves WebUIDataSource to serve strings.m.js to component extensions.

Since most of the changes now reside within c/b/extensions/ I'll let Devlin comment on the rest.

(See one open question below)

Moe Ahmadi

thanks Demetrios. responded to your comment. Do you mind reviewing the aim_eligibility WebUI and resources so Devlin can focus on the extensions?

Commit Message
Line 14, Patchset 2 (Latest):- Introduce dynamic /strings.m.js module loading and dynamic $i18n{key}
template replacements for component extensions.
Demetrios Papadopoulos . unresolved

I am a bit confused about this part. AFAICT $i18n{} template replacements already work in component extensions, or to be precise they are already used in the PDF Viewer component extension. What exactly is being added here that is not already supported with regards to `$i18n{}` template replacements?

Moe Ahmadi

You're right that $i18n{} replacements already work for the PDF Viewer. However, the existing mechanism only supports global data computed once at startup. What this CL adds that is not currently supported is (1) profile-scoped data (e.g., account eligibility or enterprise policy) and (2) clean layering that doesn't need direct dependency on feature-specific utilities (e.g., pdf_extension_util::) in //c/b/extensions.

let me know if that makes sense and if you prefer I clarify that in the CL description.

Open in Gerrit

Related details

Attention is currently required from:
  • Demetrios Papadopoulos
  • Devlin Cronin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia526dc79747d57fe9b24aa7541347039fa5f5d28
Gerrit-Change-Number: 8067138
Gerrit-PatchSet: 2
Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Jul 2026 00:56:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Demetrios Papadopoulos <dpa...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Demetrios Papadopoulos (Gerrit)

unread,
2:36 PM (4 hours ago) 2:36 PM
to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
Attention needed from Devlin Cronin and Moe Ahmadi

Demetrios Papadopoulos added 3 comments

File chrome/browser/ui/webui/omnibox/aim_eligibility/extension/aim_eligibility_extension_bridge.cc
Line 41, Patchset 2 (Latest): dict.Set("showFooter", true);
Demetrios Papadopoulos . unresolved

Add a comment about this being done for illustration purposes only and not actually needed?

File chrome/browser/ui/webui/omnibox/aim_eligibility/extension/aim_eligibility_extension_browsertest.cc
Line 231, Patchset 2 (Latest): "(() => {"
" const app = document.querySelector('aim-eligibility-app');"
" if (!app) return null;"
" if (typeof app.showFooter_ === 'undefined') return null;"
" return app.showFooter_;"
"})()");
Demetrios Papadopoulos . unresolved

Injecting JS code from C++ is not the recommended way of writing tests, definitely not for WebUI, but also not for the PDF Viewer component extension. Could these tests be migrated to tests similar to https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/data/pdf/, which even though they don't use Mocha like WebUI tests yet, they at least use TypeScript for all the test code?

File chrome/browser/ui/webui/omnibox/omnibox_ui.cc
Line 63, Patchset 2 (Latest): source->AddBoolean("showFooter", true);
Demetrios Papadopoulos . unresolved

Either add a comment here as well about this not being needed, or remove it from here, and change the UI code to also call loadTimeData.valueExists(...) first? Having this here is not very helpful (we already know loadTimeData works in WebUI contexts).

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Moe Ahmadi
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia526dc79747d57fe9b24aa7541347039fa5f5d28
Gerrit-Change-Number: 8067138
Gerrit-PatchSet: 2
Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Jul 2026 18:36:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Demetrios Papadopoulos (Gerrit)

unread,
2:44 PM (4 hours ago) 2:44 PM
to Rebekah Potter, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, jdonnel...@chromium.org, omnibox-...@chromium.org
Attention needed from Devlin Cronin and Moe Ahmadi

Demetrios Papadopoulos added 1 comment

Commit Message
Line 14, Patchset 2 (Latest):- Introduce dynamic /strings.m.js module loading and dynamic $i18n{key}
template replacements for component extensions.
Demetrios Papadopoulos . unresolved

I am a bit confused about this part. AFAICT $i18n{} template replacements already work in component extensions, or to be precise they are already used in the PDF Viewer component extension. What exactly is being added here that is not already supported with regards to `$i18n{}` template replacements?

Moe Ahmadi

You're right that $i18n{} replacements already work for the PDF Viewer. However, the existing mechanism only supports global data computed once at startup. What this CL adds that is not currently supported is (1) profile-scoped data (e.g., account eligibility or enterprise policy) and (2) clean layering that doesn't need direct dependency on feature-specific utilities (e.g., pdf_extension_util::) in //c/b/extensions.

let me know if that makes sense and if you prefer I clarify that in the CL description.

Demetrios Papadopoulos

let me know if that makes sense and if you prefer I clarify that in the CL description.

Thank for the details. Yes clarifying a bit more in the CL description would help.

Just to make sure I uderstand the essence, you are saying that the way $i18n{...} worked previously was not scaleable to be used across multiple component extensions and was very specific to making it work just for PDF Viewer, whereas with the changes here it more scaleable. Is that accurate?
Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Moe Ahmadi
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia526dc79747d57fe9b24aa7541347039fa5f5d28
Gerrit-Change-Number: 8067138
Gerrit-PatchSet: 2
Gerrit-Owner: Moe Ahmadi <mah...@chromium.org>
Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Moe Ahmadi <mah...@chromium.org>
Gerrit-CC: Rebekah Potter <rbpo...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Moe Ahmadi <mah...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Jul 2026 18:43:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Moe Ahmadi <mah...@chromium.org>
Comment-In-Reply-To: Demetrios Papadopoulos <dpa...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages