[ALPC Extensions]: Add new dialog for final extension installation step [chromium/src : main]

0 views
Skip to first unread message

Richard Chui (Gerrit)

unread,
Jan 30, 2026, 5:44:57 PM (7 hours ago) Jan 30
to Emilia Paz, AyeAye, Chromium LUCI CQ, chromium-a...@chromium.org, srahim...@chromium.org, extension...@chromium.org
Attention needed from Emilia Paz

Richard Chui added 1 comment

File chrome/browser/extensions/extension_install_prompt.h
Line 74, Patchset 2 (Latest): EXTENSION_PARENT_APPROVAL_PROMPT = 15,
Richard Chui . unresolved

@emiliapaz: I am not sure if this is the correct approach. Basically, the dialog should function exactly like a normal install prompt, but just with custom text. I considered just using `INSTALL_PROMPT` and overriding it for all the new strings, but not sure if that will interfere with some of the existing functionality (i.e. like in `GetAcceptButtonLabel()` where it may expect a certain UI already.

Open in Gerrit

Related details

Attention is currently required from:
  • Emilia Paz
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: Ied1fe62229ac50732b079283c3fcc711cde45d4d
Gerrit-Change-Number: 7524490
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Chui <ric...@google.com>
Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
Gerrit-Reviewer: Richard Chui <ric...@google.com>
Gerrit-Attention: Emilia Paz <emil...@chromium.org>
Gerrit-Comment-Date: Fri, 30 Jan 2026 22:44:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Emilia Paz (Gerrit)

unread,
Jan 30, 2026, 9:57:13 PM (3 hours ago) Jan 30
to Richard Chui, AyeAye, Chromium LUCI CQ, chromium-a...@chromium.org, srahim...@chromium.org, extension...@chromium.org
Attention needed from Richard Chui

Emilia Paz added 9 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Emilia Paz . unresolved

Thanks Richard! Direction is good. Left some comments. We are also going to need some test coverage, specially:
(1) when OnParentApprovalDone receives SupervisedExtensionApprovalResult::kApproved, it correctly initializes an
ExtensionInstallPrompt with the new EXTENSION_PARENT_APPROVAL_PROMPT type and displays it.
(2) when OnParentApprovalDone receives kCanceled or kFailed, it immediately runs the done_callback_ with the result and does not proceed to show the second dialog.

File chrome/browser/extensions/extension_install_prompt.h
Line 74, Patchset 2 (Latest): EXTENSION_PARENT_APPROVAL_PROMPT = 15,
Richard Chui . resolved

@emiliapaz: I am not sure if this is the correct approach. Basically, the dialog should function exactly like a normal install prompt, but just with custom text. I considered just using `INSTALL_PROMPT` and overriding it for all the new strings, but not sure if that will interfere with some of the existing functionality (i.e. like in `GetAcceptButtonLabel()` where it may expect a certain UI already.

Emilia Paz

I think a new type is okay to avoid overriding information

File chrome/browser/supervised_user/supervised_user_extensions_delegate_impl.h
Line 106, Patchset 2 (Latest): // Called when the parent access flow on Android desktop completes to show the
// browser parent approval permission dialog.
void OnParentApprovalDone(const Extension& extension,
base::WeakPtr<content::WebContents> contents,
const gfx::ImageSkia& icon,
SupervisedExtensionApprovalResult result);
Emilia Paz . unresolved

If this is only for android lets wrap it around a BUILDFLAG

File chrome/browser/supervised_user/supervised_user_extensions_delegate_impl.cc
Line 183, Patchset 2 (Latest): std::optional<base::WeakPtr<content::WebContents>> contents,
Emilia Paz . unresolved

note - not for this cl: `contents` can only be nullopt for ChromeOS, as other platforms check for `contents.value()`. Is this intended? can a dialog be shown without web contents?

Line 219, Patchset 2 (Latest): base::Unretained(this), std::cref(extension), contents.value(), icon);
Emilia Paz . unresolved

This may be a potential use-after-free. This callback is passed to
ExtensionParentApproval, which triggers an asynchronous Android UI flow. If this SupervisedUserExtensionsDelegateImpl instance is destroyed before the parent completes the approval, executing this callback will crash. I believe we want top use a `WeakPtr` here

Line 219, Patchset 2 (Latest): base::Unretained(this), std::cref(extension), contents.value(), icon);
Emilia Paz . unresolved

The extension could get uninstalled while the dialog is opened, and the reference here would no longer be valid. We should use a `scoped_refptr` or pass the extension id, and retrieve the extension in the callback

Line 218, Patchset 2 (Latest): &SupervisedUserExtensionsDelegateImpl::OnParentApprovalDone,
base::Unretained(this), std::cref(extension), contents.value(), icon);
Emilia Paz . unresolved

What if we pass `done_callback_` to `OnParentApprovalDone`? This could prevent issues where `done_callback_` is called twice, and also follows the same pattern of passing `done_callback` to the dialog callback on other platforms (previous lines)

Line 231, Patchset 2 (Latest): if (result != SupervisedExtensionApprovalResult::kApproved) {
std::move(done_callback_).Run(result);
return;
}
Emilia Paz . unresolved

nit - optional: lets explain that the next dialog is only shown if the parental approval dialog was accepted
And with that.. are both dialogs names "parent approval"? It's a bit confusing. It would be better if they had clear different names

Line 253, Patchset 2 (Latest): case ExtensionInstallPrompt::Result::
ACCEPTED_WITH_WITHHELD_PERMISSIONS:
Emilia Paz . unresolved
Open in Gerrit

Related details

Attention is currently required from:
  • Richard Chui
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: Ied1fe62229ac50732b079283c3fcc711cde45d4d
Gerrit-Change-Number: 7524490
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Chui <ric...@google.com>
Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
Gerrit-Reviewer: Richard Chui <ric...@google.com>
Gerrit-Attention: Richard Chui <ric...@google.com>
Gerrit-Comment-Date: Sat, 31 Jan 2026 02:57:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Richard Chui <ric...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Emilia Paz (Gerrit)

unread,
Jan 30, 2026, 9:59:13 PM (3 hours ago) Jan 30
to Richard Chui, AyeAye, Chromium LUCI CQ, chromium-a...@chromium.org, srahim...@chromium.org, extension...@chromium.org
Attention needed from Richard Chui

Emilia Paz added 1 comment

Commit Message
Line 15, Patchset 2 (Latest):
Emilia Paz . unresolved

nit: if possible, lets add a screenshot of the dialog. Helps whem looking back on the CL from codesearch :)

Open in Gerrit

Related details

Attention is currently required from:
  • Richard Chui
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: Ied1fe62229ac50732b079283c3fcc711cde45d4d
Gerrit-Change-Number: 7524490
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Chui <ric...@google.com>
Gerrit-Reviewer: Emilia Paz <emil...@chromium.org>
Gerrit-Reviewer: Richard Chui <ric...@google.com>
Gerrit-Attention: Richard Chui <ric...@google.com>
Gerrit-Comment-Date: Sat, 31 Jan 2026 02:58:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages