[BWG] Implement multi active badge state. [chromium/src : main]

0 views
Skip to first unread message

Ibrahim Kanouche (Gerrit)

unread,
Nov 11, 2025, 7:47:56 PM (23 hours ago) Nov 11
to Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Joemer Ramos

Ibrahim Kanouche voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Joemer Ramos
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
Gerrit-Change-Number: 7129978
Gerrit-PatchSet: 6
Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
Gerrit-Attention: Joemer Ramos <joeme...@google.com>
Gerrit-Comment-Date: Wed, 12 Nov 2025 00:47:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Joemer Ramos (Gerrit)

unread,
Nov 11, 2025, 8:52:52 PM (21 hours ago) Nov 11
to Ibrahim Kanouche, Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Ibrahim Kanouche

Joemer Ramos added 6 comments

File ios/chrome/browser/badges/ui_bundled/badge_mediator.mm
Line 17, Patchset 6 (Parent):#import "ios/chrome/browser/badges/ui_bundled/badge_type.h"
Joemer Ramos . unresolved

Don't we need this?

Line 171, Patchset 6 (Latest): if (IsProactiveSuggestionsFrameworkEnabled() && self.webState) {
Joemer Ramos . unresolved

Can we have a TODO over this to migrate to LocationBarBadge? Maybe under this bug: b/458307626

Line 173, Patchset 6 (Latest): if (self.webState->GetStateForPermission(web::PermissionCamera) ==
web::PermissionStateAllowed) {
Joemer Ramos . unresolved

This code is triggered multiple times when `updateBadgesShownForWebState` is called. Did you encounter any issues where we were adding more than one camera badge or more than one microphone badge at all? Just making sure there's no issues.

I ran into a UI bug where if I refreshed after enabling microphone and camera, there would be 2 microphones, or an incorrect icon.

Line 367, Patchset 6 (Latest):
Joemer Ramos . unresolved

remove newline?

File ios/chrome/browser/badges/ui_bundled/badge_view_controller.mm
Line 268, Patchset 6 (Latest): [self.stackView addArrangedSubview:badgeButton];
Joemer Ramos . unresolved

Change to `[self addBadgeToStackView:badgeButton];` so that the view animates in just like the first displayed badge (unless you don't want this behavior)

File ios/chrome/browser/location_bar/ui_bundled/badges_container_view.mm
Line 270, Patchset 6 (Latest): readerModeChipShouldBeVisibleFinal = _readerModeChipShouldBeVisible;
Joemer Ramos . unresolved

Why do we do this?

Open in Gerrit

Related details

Attention is currently required from:
  • Ibrahim Kanouche
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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
    Gerrit-Change-Number: 7129978
    Gerrit-PatchSet: 6
    Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
    Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
    Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
    Gerrit-Attention: Ibrahim Kanouche <kano...@google.com>
    Gerrit-Comment-Date: Wed, 12 Nov 2025 01:52:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ibrahim Kanouche (Gerrit)

    unread,
    6:32 AM (12 hours ago) 6:32 AM
    to Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Joemer Ramos

    Ibrahim Kanouche voted and added 6 comments

    Votes added by Ibrahim Kanouche

    Commit-Queue+1

    6 comments

    File ios/chrome/browser/badges/ui_bundled/badge_mediator.mm
    Line 17, Patchset 6 (Parent):#import "ios/chrome/browser/badges/ui_bundled/badge_type.h"
    Joemer Ramos . resolved

    Don't we need this?

    Ibrahim Kanouche

    Done

    Line 171, Patchset 6: if (IsProactiveSuggestionsFrameworkEnabled() && self.webState) {
    Joemer Ramos . resolved

    Can we have a TODO over this to migrate to LocationBarBadge? Maybe under this bug: b/458307626

    Ibrahim Kanouche

    Done

    Line 173, Patchset 6: if (self.webState->GetStateForPermission(web::PermissionCamera) ==
    web::PermissionStateAllowed) {
    Joemer Ramos . unresolved

    This code is triggered multiple times when `updateBadgesShownForWebState` is called. Did you encounter any issues where we were adding more than one camera badge or more than one microphone badge at all? Just making sure there's no issues.

    I ran into a UI bug where if I refreshed after enabling microphone and camera, there would be 2 microphones, or an incorrect icon.

    Ibrahim Kanouche

    I am not sure how you get to a state where you add more than one camera badge, it should either be one camera badge or zero camera badges (unless you are referring to adding a camera badge and a microphone badge).

    As for refreshing, this should automatically revoke the camera or microphone permission and all the badges should disappear. I am not able to reproduce the bug you are describing. Can you share more info and/or reproduction steps?

    The only issue I have been running into is adding a second permission badge after the first infobar is dismissed. The issue is that both camera and microphone permissions share the same underlying infobar type (InfobarType::kInfobarTypePermissions), but we are trying to create separate badges for each permission. I updated updateBadgesShownForWebState to fix this issue by making separate calls to updateDisplayedBadge for each badge.

    Line 367, Patchset 6:
    Joemer Ramos . resolved

    remove newline?

    Ibrahim Kanouche

    Done

    File ios/chrome/browser/badges/ui_bundled/badge_view_controller.mm
    Line 268, Patchset 6: [self.stackView addArrangedSubview:badgeButton];
    Joemer Ramos . resolved

    Change to `[self addBadgeToStackView:badgeButton];` so that the view animates in just like the first displayed badge (unless you don't want this behavior)

    Ibrahim Kanouche

    Done

    File ios/chrome/browser/location_bar/ui_bundled/badges_container_view.mm
    Line 270, Patchset 6: readerModeChipShouldBeVisibleFinal = _readerModeChipShouldBeVisible;
    Joemer Ramos . resolved

    Why do we do this?

    Ibrahim Kanouche

    This line directly assigns the reader mode chip's desired visibility state to the final visibility variable without applying any additional conditions. Because when ProactiveSuggestionsFramework is enabled, we simplify Reader Mode visibility by removing the legacy conflict logic that prevented it from showing during contextual panel animations.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joemer Ramos
    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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
    Gerrit-Change-Number: 7129978
    Gerrit-PatchSet: 7
    Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
    Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
    Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
    Gerrit-Attention: Joemer Ramos <joeme...@google.com>
    Gerrit-Comment-Date: Wed, 12 Nov 2025 11:32:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Joemer Ramos <joeme...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joemer Ramos (Gerrit)

    unread,
    10:37 AM (8 hours ago) 10:37 AM
    to Ibrahim Kanouche, Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Ibrahim Kanouche

    Joemer Ramos voted and added 2 comments

    Votes added by Joemer Ramos

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 7 (Latest):
    Joemer Ramos . resolved

    LGTM if UI looks good

    File ios/chrome/browser/badges/ui_bundled/badge_mediator.mm
    Line 173, Patchset 6: if (self.webState->GetStateForPermission(web::PermissionCamera) ==
    web::PermissionStateAllowed) {
    Joemer Ramos . resolved

    This code is triggered multiple times when `updateBadgesShownForWebState` is called. Did you encounter any issues where we were adding more than one camera badge or more than one microphone badge at all? Just making sure there's no issues.

    I ran into a UI bug where if I refreshed after enabling microphone and camera, there would be 2 microphones, or an incorrect icon.

    Ibrahim Kanouche

    I am not sure how you get to a state where you add more than one camera badge, it should either be one camera badge or zero camera badges (unless you are referring to adding a camera badge and a microphone badge).

    As for refreshing, this should automatically revoke the camera or microphone permission and all the badges should disappear. I am not able to reproduce the bug you are describing. Can you share more info and/or reproduction steps?

    The only issue I have been running into is adding a second permission badge after the first infobar is dismissed. The issue is that both camera and microphone permissions share the same underlying infobar type (InfobarType::kInfobarTypePermissions), but we are trying to create separate badges for each permission. I updated updateBadgesShownForWebState to fix this issue by making separate calls to updateDisplayedBadge for each badge.

    Joemer Ramos

    Ok sounds good, it was just an old problem I found which was probably resolved with this cleaner CL. So I'm ok with not digging into this if you can't repro

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ibrahim Kanouche
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
      Gerrit-Change-Number: 7129978
      Gerrit-PatchSet: 7
      Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
      Gerrit-Attention: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Comment-Date: Wed, 12 Nov 2025 15:37:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Joemer Ramos <joeme...@google.com>
      Comment-In-Reply-To: Ibrahim Kanouche <kano...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joemer Ramos (Gerrit)

      unread,
      10:41 AM (8 hours ago) 10:41 AM
      to Ibrahim Kanouche, Gauthier Ambard, Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Gauthier Ambard and Ibrahim Kanouche

      Joemer Ramos added 1 comment

      Patchset-level comments
      Joemer Ramos . resolved

      Can you PTAL?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Gauthier Ambard
      • Ibrahim Kanouche
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
      Gerrit-Change-Number: 7129978
      Gerrit-PatchSet: 7
      Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Gauthier Ambard <gam...@chromium.org>
      Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
      Gerrit-Attention: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Attention: Gauthier Ambard <gam...@chromium.org>
      Gerrit-Comment-Date: Wed, 12 Nov 2025 15:41:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joemer Ramos (Gerrit)

      unread,
      11:28 AM (7 hours ago) 11:28 AM
      to Ibrahim Kanouche, Sergio Collazos, Joemer Ramos, Chromium LUCI CQ, chromium...@chromium.org, christia...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Ibrahim Kanouche and Sergio Collazos

      Joemer Ramos added 1 comment

      Patchset-level comments
      Joemer Ramos . resolved

      Giving to sergio instead

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ibrahim Kanouche
      • Sergio Collazos
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: Iee64018bfd7a4dea87edddbf9f17b40d9c35a80b
      Gerrit-Change-Number: 7129978
      Gerrit-PatchSet: 7
      Gerrit-Owner: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
      Gerrit-Reviewer: Sergio Collazos <sc...@chromium.org>
      Gerrit-Attention: Ibrahim Kanouche <kano...@google.com>
      Gerrit-Attention: Sergio Collazos <sc...@chromium.org>
      Gerrit-Comment-Date: Wed, 12 Nov 2025 16:28:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages