[Indigo] Anchor toolbar by tracking image bounds [chromium/src : main]

0 views
Skip to first unread message

Jeremy Roman (Gerrit)

unread,
May 25, 2026, 6:25:22 PM (7 days ago) May 25
to Jeremy Roman, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Adithya Srinivasan

Jeremy Roman added 1 comment

Patchset-level comments
File-level comment, Patchset 18 (Latest):
Jeremy Roman . resolved

This doesn't deal with headers that occlude the content (the next CL in the chain does -- it needs additional cleanup but I've ran the basic idea by Khushal). But it does do most of the indigo toolbar changes to make it start to track the element.

Open in Gerrit

Related details

Attention is currently required from:
  • Adithya Srinivasan
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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
Gerrit-Change-Number: 7871317
Gerrit-PatchSet: 18
Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
Gerrit-Comment-Date: Mon, 25 May 2026 22:25:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Adithya Srinivasan (Gerrit)

unread,
May 26, 2026, 12:37:56 PM (6 days ago) May 26
to Jeremy Roman, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Jeremy Roman

Adithya Srinivasan voted and added 10 comments

Votes added by Adithya Srinivasan

Code-Review+1

10 comments

Patchset-level comments
File-level comment, Patchset 19 (Latest):
Adithya Srinivasan . resolved

Just have some requests for test cases, and questions about resetting

File chrome/browser/indigo/indigo_browsertest.cc
Line 417, Patchset 19 (Latest):}
Adithya Srinivasan . unresolved

Could we update this test/add a new test to scroll the page (well make the page scrollable first) and check that the toolbar bounds are updated?

File chrome/browser/indigo/indigo_image_replacement.h
Line 38, Patchset 19 (Latest): const std::optional<base::Token>& tracked_element_id);
Adithya Srinivasan . unresolved

nit: this can just be `const base::Token&` right?

File chrome/browser/indigo/indigo_page_action_controller.h
Line 19, Patchset 19 (Latest):#include "components/viz/common/surfaces/tracked_element_rects.h"
Adithya Srinivasan . unresolved

nit: is this include still needed or can it just be forward declared?

File chrome/browser/indigo/indigo_page_action_controller.cc
Line 288, Patchset 19 (Latest): }
Adithya Srinivasan . unresolved

should we also be resetting tracked_bounds_ here?

I guess the toolbar is being hidden so it doesn't strictly matter; but I'm not sure what happens when we call ShowToolbar the next time (will a new value already be sent before that or will it be anchored to the previous primary's last known bounds?)

Line 518, Patchset 19 (Latest): current_host_ = host;
Adithya Srinivasan . unresolved

should we reset tracked_bounds_ here? (might not need to if we do so in Reset())

File chrome/browser/ui/views/indigo/indigo_toolbar.cc
Line 123, Patchset 19 (Latest): gfx::Point toolbar_top_right = top_right + *corner_offset;
Adithya Srinivasan . unresolved

checking my understanding for some edge cases here:

if the image is partially in the viewport (lets say the top half is not in the viewport), the toolbar will be offset from the top right of visible half?

if we scroll down partially from the previous case (so more of the image is out of the viewport, but not all of it), the toolbar will not move?

if we scroll down all the way and the image is completely out of the viewport, the toolbar will disappear?

(would be nice to have tests for these cases too 😊)

Line 457, Patchset 19 (Latest): view->SetVisible(!rect.IsEmpty());
Adithya Srinivasan . unresolved

do we also need to initialize the toolbar with `SetVisible(false)`?

edit: I saw that your test checks that we still see the toolbar (using initial bounds), so maybe this is WAI

File chrome/browser/ui/views/indigo/indigo_toolbar_unittest.cc
Line 164, Patchset 19 (Latest):TEST_F(IndigoToolbarTest, ToolbarBounds) {
Adithya Srinivasan . unresolved

Could we also test that the toolbar is hidden when the (updated) tracked position is empty?

File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
Line 26, Patchset 19 (Latest): int32 tracked_element_feature_id);
Adithya Srinivasan . unresolved

Should we make this field optional (as a way of indicating that if we want to track the bounds)? We don't really need to track non-primary images right now.

Open in Gerrit

Related details

Attention is currently required from:
  • Jeremy Roman
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
    Gerrit-Change-Number: 7871317
    Gerrit-PatchSet: 19
    Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Comment-Date: Tue, 26 May 2026 16:37:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jeremy Roman (Gerrit)

    unread,
    May 26, 2026, 5:25:11 PM (6 days ago) May 26
    to Jeremy Roman, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
    Attention needed from Adithya Srinivasan

    Jeremy Roman added 10 comments

    File chrome/browser/indigo/indigo_browsertest.cc
    Line 417, Patchset 19:}
    Adithya Srinivasan . resolved

    Could we update this test/add a new test to scroll the page (well make the page scrollable first) and check that the toolbar bounds are updated?

    Jeremy Roman

    Added such a test, including partially and completely off screen.

    File chrome/browser/indigo/indigo_image_replacement.h
    Line 38, Patchset 19: const std::optional<base::Token>& tracked_element_id);
    Adithya Srinivasan . resolved

    nit: this can just be `const base::Token&` right?

    Jeremy Roman

    not anymore now that (as you suggested elsewhere) non-primary replacements don't track

    File chrome/browser/indigo/indigo_page_action_controller.h
    Line 19, Patchset 19:#include "components/viz/common/surfaces/tracked_element_rects.h"
    Adithya Srinivasan . resolved

    nit: is this include still needed or can it just be forward declared?

    Jeremy Roman

    Can't be forward-declared, as it's a type alias. (We could forward-declare the underlying type and then declare the type alias as well, but then it would be harder to change.)

    File chrome/browser/indigo/indigo_page_action_controller.cc
    Line 288, Patchset 19: }
    Adithya Srinivasan . resolved

    should we also be resetting tracked_bounds_ here?

    I guess the toolbar is being hidden so it doesn't strictly matter; but I'm not sure what happens when we call ShowToolbar the next time (will a new value already be sent before that or will it be anchored to the previous primary's last known bounds?)

    Jeremy Roman

    Done, it's now reset.

    Line 518, Patchset 19: current_host_ = host;
    Adithya Srinivasan . resolved

    should we reset tracked_bounds_ here? (might not need to if we do so in Reset())

    Jeremy Roman

    ClearTrackedBoundsAndHideToolbar is now called when we might have lost track of the tracked element.

    Line 518, Patchset 19: current_host_ = host;
    Adithya Srinivasan . resolved

    should we reset tracked_bounds_ here? (might not need to if we do so in Reset())

    Jeremy Roman

    Done, we now call ClearTrackedBoundsAndHideToolbar when we stop being able to track the element.

    File chrome/browser/ui/views/indigo/indigo_toolbar.cc
    Line 123, Patchset 19: gfx::Point toolbar_top_right = top_right + *corner_offset;
    Adithya Srinivasan . resolved

    checking my understanding for some edge cases here:

    if the image is partially in the viewport (lets say the top half is not in the viewport), the toolbar will be offset from the top right of visible half?

    if we scroll down partially from the previous case (so more of the image is out of the viewport, but not all of it), the toolbar will not move?

    if we scroll down all the way and the image is completely out of the viewport, the toolbar will disappear?

    (would be nice to have tests for these cases too 😊)

    Jeremy Roman

    Yeah, it is offset from the visible half. This wasn't what was obvious but it was easiest with the way tracked elements already work, and feels pretty reasonable. So your understanding is correct on all of those, and there are now tests as well.

    Line 457, Patchset 19: view->SetVisible(!rect.IsEmpty());
    Adithya Srinivasan . resolved

    do we also need to initialize the toolbar with `SetVisible(false)`?

    edit: I saw that your test checks that we still see the toolbar (using initial bounds), so maybe this is WAI

    Jeremy Roman

    Changed to eliminate --force-indigo-toolbar which keeps this a bit simpler, we now only show it in response to tracked element rects. With that change, we can indeed make it initially invisible.

    File chrome/browser/ui/views/indigo/indigo_toolbar_unittest.cc
    Line 164, Patchset 19:TEST_F(IndigoToolbarTest, ToolbarBounds) {
    Adithya Srinivasan . resolved

    Could we also test that the toolbar is hidden when the (updated) tracked position is empty?

    Jeremy Roman

    Done

    File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
    Line 26, Patchset 19: int32 tracked_element_feature_id);
    Adithya Srinivasan . resolved

    Should we make this field optional (as a way of indicating that if we want to track the bounds)? We don't really need to track non-primary images right now.

    Jeremy Roman

    Fair enough, done.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adithya Srinivasan
    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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
      Gerrit-Change-Number: 7871317
      Gerrit-PatchSet: 22
      Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Tue, 26 May 2026 21:25:03 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Adithya Srinivasan <adit...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jeremy Roman (Gerrit)

      unread,
      May 26, 2026, 10:06:19 PM (6 days ago) May 26
      to Jeremy Roman, Chromium IPC Reviews, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan, Chromium IPC Reviews and Vladimir Levin

      Jeremy Roman added 1 comment

      Patchset-level comments
      File-level comment, Patchset 23 (Latest):
      Jeremy Roman . resolved

      vmpstr for components/page_content_annotations/ and components/viz/
      chrome-ipc-reviews for *.mojom

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • Chromium IPC Reviews
      • Vladimir Levin
      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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
      Gerrit-Change-Number: 7871317
      Gerrit-PatchSet: 23
      Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 May 2026 02:06:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jeremy Roman (Gerrit)

      unread,
      May 26, 2026, 10:07:35 PM (6 days ago) May 26
      to Jeremy Roman, Andrew Verge, Chromium IPC Reviews, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan, Andrew Verge, Chromium IPC Reviews and Vladimir Levin

      Jeremy Roman added 1 comment

      Patchset-level comments
      Jeremy Roman . resolved

      arg, vmpstr doesn't own components/page_content_annotations/

      +averge for components/page_content_annotations/

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • Andrew Verge
      • Chromium IPC Reviews
      • Vladimir Levin
      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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
      Gerrit-Change-Number: 7871317
      Gerrit-PatchSet: 23
      Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Andrew Verge <ave...@chromium.org>
      Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 May 2026 02:07:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      gwsq (Gerrit)

      unread,
      May 26, 2026, 10:09:39 PM (6 days ago) May 26
      to Jeremy Roman, Chromium IPC Reviews, Ari Chivukula, Andrew Verge, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan, Andrew Verge, Ari Chivukula, Joe Mason and Vladimir Levin

      Message from gwsq

      From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
      Shadow: ari...@chromium.org; IPC: joenot...@google.com

      📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

      Shadow IPC reviewer(s): ari...@chromium.org. Please conduct an IPC review and CR+1 when satisfied. Remember to add the main reviewers to the attention set if needed.

      Main IPC reviewer(s): joenot...@google.com. Please wait for the shadowed IPC reviewer to CR+1 before reviewing.

      Shadowed: ari...@chromium.org

      Reviewer source(s):
      ari...@chromium.org, joenot...@google.com is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • Andrew Verge
      • Ari Chivukula
      • Joe Mason
      • Vladimir Levin
      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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
      Gerrit-Change-Number: 7871317
      Gerrit-PatchSet: 23
      Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Ari Chivukula <ari...@chromium.org>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Joe Mason <joenot...@google.com>
      Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Andrew Verge <ave...@chromium.org>
      Gerrit-Attention: Ari Chivukula <ari...@chromium.org>
      Gerrit-Attention: Joe Mason <joenot...@google.com>
      Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 May 2026 02:09:10 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ari Chivukula (Gerrit)

      unread,
      May 26, 2026, 11:15:45 PM (6 days ago) May 26
      to Jeremy Roman, Chromium IPC Reviews, Andrew Verge, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan, Andrew Verge, Jeremy Roman, Joe Mason and Vladimir Levin

      Ari Chivukula added 3 comments

      Patchset-level comments
      Ari Chivukula . resolved

      (shadow) IPC LGTM

      File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
      Line 24, Patchset 23 (Latest): // `tracked_element_feature_id`: The ID of the tracked element feature to use
      Ari Chivukula . unresolved

      `The ID of the tracked element feature to use for tracking.` feels redundant, maybe but the first 'tracked'?

      Line 51, Patchset 23 (Latest): // `tracked_element_id`: The ID of the tracked element associated with the
      Ari Chivukula . unresolved

      same here

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • Andrew Verge
      • Jeremy Roman
      • Joe Mason
      • Vladimir Levin
      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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
        Gerrit-Change-Number: 7871317
        Gerrit-PatchSet: 23
        Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Ari Chivukula <ari...@chromium.org>
        Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Reviewer: Joe Mason <joenot...@google.com>
        Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Andrew Verge <ave...@chromium.org>
        Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Attention: Joe Mason <joenot...@google.com>
        Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
        Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
        Gerrit-Comment-Date: Wed, 27 May 2026 03:15:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ari Chivukula (Gerrit)

        unread,
        May 26, 2026, 11:15:50 PM (6 days ago) May 26
        to Jeremy Roman, Chromium IPC Reviews, Andrew Verge, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Adithya Srinivasan, Andrew Verge, Jeremy Roman, Joe Mason and Vladimir Levin

        Ari Chivukula voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Adithya Srinivasan
        • Andrew Verge
        • Jeremy Roman
        • Joe Mason
        • Vladimir Levin
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Gerrit-Comment-Date: Wed, 27 May 2026 03:15:42 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Andrew Verge (Gerrit)

          unread,
          May 27, 2026, 10:17:16 AM (5 days ago) May 27
          to Jeremy Roman, Ari Chivukula, Chromium IPC Reviews, Vladimir Levin, Adithya Srinivasan, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Adithya Srinivasan, Jeremy Roman, Joe Mason and Vladimir Levin

          Andrew Verge voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Adithya Srinivasan
          Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Attention: Joe Mason <joenot...@google.com>
          Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
          Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
          Gerrit-Comment-Date: Wed, 27 May 2026 14:17:09 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Adithya Srinivasan (Gerrit)

          unread,
          May 27, 2026, 11:21:03 AM (5 days ago) May 27
          to Jeremy Roman, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman, Joe Mason and Vladimir Levin

          Adithya Srinivasan voted and added 3 comments

          Votes added by Adithya Srinivasan

          Code-Review+1

          3 comments

          File chrome/browser/indigo/indigo_image_replacement_manager.cc
          Line 74, Patchset 23 (Latest): remote->StartReplacement(std::move(host_remote), feature_id);
          Adithya Srinivasan . unresolved

          Shouldn't this be std::nullopt if !is_primary?

          File chrome/browser/indigo/indigo_page_action_controller.cc
          Line 566, Patchset 23 (Latest): if (!found) {
          Adithya Srinivasan . unresolved

          Is it guaranteed that every notification will have an entry for all tracked elements? I'm wondering if it just sends an update for an unrelated tracked element, and the element we care about hasn't moved (and is still visible).

          Line 571, Patchset 23 (Latest):void IndigoPageActionController::ClearTrackedBoundsAndHideToolbar() {
          Adithya Srinivasan . unresolved

          nit: might be worth renaming the pre-existing HideToolbar method to ResetToolbar or DestroyToolbar

          Open in Gerrit

          Related details

          Attention is currently required from:
          Gerrit-Comment-Date: Wed, 27 May 2026 15:20:52 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ari Chivukula (Gerrit)

          unread,
          May 27, 2026, 2:57:53 PM (5 days ago) May 27
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman, Joe Mason and Vladimir Levin

          Ari Chivukula voted and added 1 comment

          Votes added by Ari Chivukula

          Code-Review+0

          1 comment

          File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
          Line 55, Patchset 23 (Latest): mojo_base.mojom.Token? tracked_element_id);
          Ari Chivukula . unresolved

          this should be using mojo_base.mojom.UnguessableToken to ensure future callsites aren't forgetting the required randomness (this blocks deterministic token constructors outside of tests).

          Gerrit-Comment-Date: Wed, 27 May 2026 18:57:46 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Joe Mason (Gerrit)

          unread,
          May 27, 2026, 3:57:35 PM (5 days ago) May 27
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman and Vladimir Levin

          Joe Mason voted and added 1 comment

          Votes added by Joe Mason

          Code-Review+1

          1 comment

          File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
          Line 55, Patchset 23 (Latest): mojo_base.mojom.Token? tracked_element_id);
          Ari Chivukula . unresolved

          this should be using mojo_base.mojom.UnguessableToken to ensure future callsites aren't forgetting the required randomness (this blocks deterministic token constructors outside of tests).

          Joe Mason

          I agree, but the same `tracked_element_id` is also used with viz structs in services/viz/public/mojom/compositing/tracked_element_rects.mojom, so I think switching to UnguessableToken is out of scope for this patch. I think it's safe as-is, for now, but the TrackedElementRects system should be improved as a followup:

          1. Use UnguessableToken, not Token, to make sure no user of the system can accidentally create tokens that can be spoofed by another renderer.

          2. viz::TrackedElementRect should contain a renderer id (which is set on the browser side based on the renderer the token's received from), and comparisons should always include both the `tracked_element_id` token and the renderer id. That way even if a renderer gets ahold of another renderer's token, and presents it to the browser, the browser won't consider it the "same" token. (TrackedElementRect already contains an optional LocalFrameToken field - keying by tracked_element_id & LocalFrame is also possible, since it would be even stricter than tracked_element_id and renderer id, but possibly too strict. It would require LocalFrame to be non-optional.)

          The security issue this is preventing is for a renderer to spoof some UI by associating its data with another renderer's element rect. For instance in this patch, if a compromised renderer sent `ReplacementFrameAttached(..., some_other_renderers_tracked_element_id)`, them when `IndigoPageActionController::OnTrackedElementRectsChanged` is called the toolbar would be moved to the other renderer's element.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jeremy Roman
          • Vladimir Levin
          Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
          Gerrit-Comment-Date: Wed, 27 May 2026 19:57:27 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Ari Chivukula <ari...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Joe Mason (Gerrit)

          unread,
          May 27, 2026, 4:04:25 PM (5 days ago) May 27
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman and Vladimir Levin

          Joe Mason added 1 comment

          File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
          Line 55, Patchset 23 (Latest): mojo_base.mojom.Token? tracked_element_id);
          Ari Chivukula . unresolved

          this should be using mojo_base.mojom.UnguessableToken to ensure future callsites aren't forgetting the required randomness (this blocks deterministic token constructors outside of tests).

          Joe Mason

          I agree, but the same `tracked_element_id` is also used with viz structs in services/viz/public/mojom/compositing/tracked_element_rects.mojom, so I think switching to UnguessableToken is out of scope for this patch. I think it's safe as-is, for now, but the TrackedElementRects system should be improved as a followup:

          1. Use UnguessableToken, not Token, to make sure no user of the system can accidentally create tokens that can be spoofed by another renderer.

          2. viz::TrackedElementRect should contain a renderer id (which is set on the browser side based on the renderer the token's received from), and comparisons should always include both the `tracked_element_id` token and the renderer id. That way even if a renderer gets ahold of another renderer's token, and presents it to the browser, the browser won't consider it the "same" token. (TrackedElementRect already contains an optional LocalFrameToken field - keying by tracked_element_id & LocalFrame is also possible, since it would be even stricter than tracked_element_id and renderer id, but possibly too strict. It would require LocalFrame to be non-optional.)

          The security issue this is preventing is for a renderer to spoof some UI by associating its data with another renderer's element rect. For instance in this patch, if a compromised renderer sent `ReplacementFrameAttached(..., some_other_renderers_tracked_element_id)`, them when `IndigoPageActionController::OnTrackedElementRectsChanged` is called the toolbar would be moved to the other renderer's element.

          Joe Mason

          Actually I think the best way to implement #2 is for `viz::TrackedElementId` to be a `pair<UnguessableToken, GlobalRenderFrameHostToken>`. In mojo the `tracked_element_id` will only be an UnguessableToken, and the code that reads it in the browser fills in the RenderFrameHost token when assigning it to a TrackedElementId. That way any code that compares two `TrackedElementId` values automatically includes the originating renderer.

          Gerrit-Comment-Date: Wed, 27 May 2026 20:04:18 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Ari Chivukula <ari...@chromium.org>
          Comment-In-Reply-To: Joe Mason <joenot...@google.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Jeremy Roman (Gerrit)

          unread,
          May 28, 2026, 12:49:36 PM (4 days ago) May 28
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Ari Chivukula, Joe Mason and Vladimir Levin

          Jeremy Roman added 6 comments

          File chrome/browser/indigo/indigo_image_replacement_manager.cc
          Line 74, Patchset 23 (Latest): remote->StartReplacement(std::move(host_remote), feature_id);
          Adithya Srinivasan . resolved

          Shouldn't this be std::nullopt if !is_primary?

          Jeremy Roman

          Done

          File chrome/browser/indigo/indigo_page_action_controller.cc
          Adithya Srinivasan . resolved

          Is it guaranteed that every notification will have an entry for all tracked elements? I'm wondering if it just sends an update for an unrelated tracked element, and the element we care about hasn't moved (and is still visible).

          Jeremy Roman

          Yes, it's my understanding that we get a complete update with every RenderFrameMetadata.

          Line 571, Patchset 23 (Latest):void IndigoPageActionController::ClearTrackedBoundsAndHideToolbar() {
          Adithya Srinivasan . resolved

          nit: might be worth renaming the pre-existing HideToolbar method to ResetToolbar or DestroyToolbar

          Jeremy Roman

          Done (DestroyToolbar).

          File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
          Line 24, Patchset 23 (Latest): // `tracked_element_feature_id`: The ID of the tracked element feature to use
          Ari Chivukula . unresolved

          `The ID of the tracked element feature to use for tracking.` feels redundant, maybe but the first 'tracked'?

          Jeremy Roman

          Tried to clear it up.

          Line 51, Patchset 23 (Latest): // `tracked_element_id`: The ID of the tracked element associated with the
          Ari Chivukula . unresolved

          same here

          Jeremy Roman

          Similarly added some clarification.

          Line 55, Patchset 23 (Latest): mojo_base.mojom.Token? tracked_element_id);
          Ari Chivukula . unresolved

          this should be using mojo_base.mojom.UnguessableToken to ensure future callsites aren't forgetting the required randomness (this blocks deterministic token constructors outside of tests).

          Joe Mason

          I agree, but the same `tracked_element_id` is also used with viz structs in services/viz/public/mojom/compositing/tracked_element_rects.mojom, so I think switching to UnguessableToken is out of scope for this patch. I think it's safe as-is, for now, but the TrackedElementRects system should be improved as a followup:

          1. Use UnguessableToken, not Token, to make sure no user of the system can accidentally create tokens that can be spoofed by another renderer.

          2. viz::TrackedElementRect should contain a renderer id (which is set on the browser side based on the renderer the token's received from), and comparisons should always include both the `tracked_element_id` token and the renderer id. That way even if a renderer gets ahold of another renderer's token, and presents it to the browser, the browser won't consider it the "same" token. (TrackedElementRect already contains an optional LocalFrameToken field - keying by tracked_element_id & LocalFrame is also possible, since it would be even stricter than tracked_element_id and renderer id, but possibly too strict. It would require LocalFrame to be non-optional.)

          The security issue this is preventing is for a renderer to spoof some UI by associating its data with another renderer's element rect. For instance in this patch, if a compromised renderer sent `ReplacementFrameAttached(..., some_other_renderers_tracked_element_id)`, them when `IndigoPageActionController::OnTrackedElementRectsChanged` is called the toolbar would be moved to the other renderer's element.

          Joe Mason

          Actually I think the best way to implement #2 is for `viz::TrackedElementId` to be a `pair<UnguessableToken, GlobalRenderFrameHostToken>`. In mojo the `tracked_element_id` will only be an UnguessableToken, and the code that reads it in the browser fills in the RenderFrameHost token when assigning it to a TrackedElementId. That way any code that compares two `TrackedElementId` values automatically includes the originating renderer.

          Jeremy Roman

          I don't think the risk here is huge, as the browser has to choose to look for these tokens. In the case of this particular feature, the objects which receive these IDs don't even exist unless the user has activated the feature on the tab, and the possibility for a malicious renderer to lie about the generated image's position on the page is pretty unavoidable and consistent with the threat model that a main page renderer controls its own content.

          If you'd like to explore improvements to use UnguessableToken or something else, would you mind filing that as a separate bug against viz/cc, as I wasn't involved in the original choice to use base::Token and don't know what other factors might have motivated the current choice.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ari Chivukula
          • Joe Mason
          • Vladimir Levin
          Gerrit-Attention: Ari Chivukula <ari...@chromium.org>
          Gerrit-Attention: Joe Mason <joenot...@google.com>
          Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
          Gerrit-Comment-Date: Thu, 28 May 2026 16:49:21 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Ari Chivukula <ari...@chromium.org>
          Comment-In-Reply-To: Joe Mason <joenot...@google.com>
          Comment-In-Reply-To: Adithya Srinivasan <adit...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ari Chivukula (Gerrit)

          unread,
          May 28, 2026, 12:50:47 PM (4 days ago) May 28
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Chromium IPC Reviews, Vladimir Levin, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman, Joe Mason and Vladimir Levin

          Ari Chivukula voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jeremy Roman
          • Joe Mason
          • Vladimir Levin
          Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Attention: Joe Mason <joenot...@google.com>
          Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
          Gerrit-Comment-Date: Thu, 28 May 2026 16:50:32 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Vladimir Levin (Gerrit)

          unread,
          May 28, 2026, 11:41:58 PM (4 days ago) May 28
          to Jeremy Roman, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Jeremy Roman and Joe Mason

          Vladimir Levin voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jeremy Roman
          • Joe Mason
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • 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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
          Gerrit-Change-Number: 7871317
          Gerrit-PatchSet: 25
          Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
          Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
          Gerrit-Reviewer: Ari Chivukula <ari...@chromium.org>
          Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Reviewer: Joe Mason <joenot...@google.com>
          Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Attention: Joe Mason <joenot...@google.com>
          Gerrit-Comment-Date: Fri, 29 May 2026 03:41:49 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Jeremy Roman (Gerrit)

          unread,
          May 29, 2026, 1:11:06 PM (3 days ago) May 29
          to Jeremy Roman, Vladimir Levin, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Joe Mason

          Jeremy Roman voted and added 3 comments

          Votes added by Jeremy Roman

          Commit-Queue+2

          3 comments

          File third_party/blink/public/mojom/image_replacement/image_replacement.mojom
          Line 24, Patchset 23: // `tracked_element_feature_id`: The ID of the tracked element feature to use
          Ari Chivukula . resolved

          `The ID of the tracked element feature to use for tracking.` feels redundant, maybe but the first 'tracked'?

          Jeremy Roman

          Tried to clear it up.

          Jeremy Roman

          Resolving.

          Line 51, Patchset 23: // `tracked_element_id`: The ID of the tracked element associated with the
          Ari Chivukula . resolved

          same here

          Jeremy Roman

          Similarly added some clarification.

          Jeremy Roman

          Resolving.

          Line 55, Patchset 23: mojo_base.mojom.Token? tracked_element_id);
          Ari Chivukula . resolved

          this should be using mojo_base.mojom.UnguessableToken to ensure future callsites aren't forgetting the required randomness (this blocks deterministic token constructors outside of tests).

          Joe Mason

          I agree, but the same `tracked_element_id` is also used with viz structs in services/viz/public/mojom/compositing/tracked_element_rects.mojom, so I think switching to UnguessableToken is out of scope for this patch. I think it's safe as-is, for now, but the TrackedElementRects system should be improved as a followup:

          1. Use UnguessableToken, not Token, to make sure no user of the system can accidentally create tokens that can be spoofed by another renderer.

          2. viz::TrackedElementRect should contain a renderer id (which is set on the browser side based on the renderer the token's received from), and comparisons should always include both the `tracked_element_id` token and the renderer id. That way even if a renderer gets ahold of another renderer's token, and presents it to the browser, the browser won't consider it the "same" token. (TrackedElementRect already contains an optional LocalFrameToken field - keying by tracked_element_id & LocalFrame is also possible, since it would be even stricter than tracked_element_id and renderer id, but possibly too strict. It would require LocalFrame to be non-optional.)

          The security issue this is preventing is for a renderer to spoof some UI by associating its data with another renderer's element rect. For instance in this patch, if a compromised renderer sent `ReplacementFrameAttached(..., some_other_renderers_tracked_element_id)`, them when `IndigoPageActionController::OnTrackedElementRectsChanged` is called the toolbar would be moved to the other renderer's element.

          Joe Mason

          Actually I think the best way to implement #2 is for `viz::TrackedElementId` to be a `pair<UnguessableToken, GlobalRenderFrameHostToken>`. In mojo the `tracked_element_id` will only be an UnguessableToken, and the code that reads it in the browser fills in the RenderFrameHost token when assigning it to a TrackedElementId. That way any code that compares two `TrackedElementId` values automatically includes the originating renderer.

          Jeremy Roman

          I don't think the risk here is huge, as the browser has to choose to look for these tokens. In the case of this particular feature, the objects which receive these IDs don't even exist unless the user has activated the feature on the tab, and the possibility for a malicious renderer to lie about the generated image's position on the page is pretty unavoidable and consistent with the threat model that a main page renderer controls its own content.

          If you'd like to explore improvements to use UnguessableToken or something else, would you mind filing that as a separate bug against viz/cc, as I wasn't involved in the original choice to use base::Token and don't know what other factors might have motivated the current choice.

          Jeremy Roman

          Resolving.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Joe Mason
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement 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: I568a710e329d54949ab7be5b7e1fcd314eac9b24
            Gerrit-Change-Number: 7871317
            Gerrit-PatchSet: 25
            Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
            Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
            Gerrit-Reviewer: Ari Chivukula <ari...@chromium.org>
            Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Reviewer: Joe Mason <joenot...@google.com>
            Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
            Gerrit-CC: Stephen Chenney <sche...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Joe Mason <joenot...@google.com>
            Gerrit-Comment-Date: Fri, 29 May 2026 17:10:50 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Ari Chivukula <ari...@chromium.org>
            Comment-In-Reply-To: Jeremy Roman <jbr...@chromium.org>
            Comment-In-Reply-To: Joe Mason <joenot...@google.com>
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            May 29, 2026, 1:15:44 PM (3 days ago) May 29
            to Jeremy Roman, Vladimir Levin, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            [Indigo] Anchor toolbar by tracking image bounds

            This implements relative positioning for the Indigo page action toolbar,
            anchoring it to the top-right corner of the tracked image element.

            Detailed changes:
            - Blink: Register the replaced image element with the compositor as a
            tracked element, and pass the tracking token.
            - Browser UI: Update IndigoToolbar's layout manager to position the
            toolbar relative to the tracked rect bounds.
            - Page Action: Observe tracked element bounds updates from the widget
            host, scale them to DIPs, and forward them to the toolbar.
            - FakeApi: Add StartAcceptingConnectionsAutomatic() to automatically
            answer API requests in tests, keeping UI tests clean.
            - Tests: Add integration tests verifying relative positioning.

            All changes are fully gated by the Indigo feature flag.

            TAG=agy
            CONV=63829320-975e-444d-bc37-e8f15924464c
            Bug: b:513370913
            Change-Id: I568a710e329d54949ab7be5b7e1fcd314eac9b24
            Reviewed-by: Joe Mason <joenot...@google.com>
            Reviewed-by: Ari Chivukula <ari...@chromium.org>
            Commit-Queue: Jeremy Roman <jbr...@chromium.org>
            Reviewed-by: Andrew Verge <ave...@chromium.org>
            Reviewed-by: Adithya Srinivasan <adit...@chromium.org>
            Reviewed-by: Vladimir Levin <vmp...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1638564}
            Files:
            • M chrome/browser/indigo/fake_api.cc
            • M chrome/browser/indigo/fake_api.h
            • M chrome/browser/indigo/indigo_browsertest.cc
            • M chrome/browser/indigo/indigo_image_replacement.cc
            • M chrome/browser/indigo/indigo_image_replacement.h
            • M chrome/browser/indigo/indigo_image_replacement_manager.cc
            • M chrome/browser/indigo/indigo_image_replacement_manager.h
            • M chrome/browser/indigo/indigo_image_replacement_manager_browsertest.cc
            • M chrome/browser/indigo/indigo_page_action_controller.cc
            • M chrome/browser/indigo/indigo_page_action_controller.h
            • M chrome/browser/indigo/indigo_page_action_controller_unittest.cc
            • M chrome/browser/ui/views/indigo/indigo_toolbar.cc
            • M chrome/browser/ui/views/indigo/indigo_toolbar.h
            • M chrome/browser/ui/views/indigo/indigo_toolbar_unittest.cc
            • M components/page_content_annotations/core/tracked_element_feature.h
            • M components/viz/common/surfaces/tracked_element_rects.h
            • M third_party/blink/public/mojom/image_replacement/image_replacement.mojom
            • M third_party/blink/renderer/core/image_replacement/image_replacement.cc
            • M third_party/blink/renderer/core/image_replacement/image_replacement.h
            • M third_party/blink/renderer/core/image_replacement/image_replacement_test.cc
            Change size: L
            Delta: 20 files changed, 527 insertions(+), 235 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Andrew Verge, +1 by Vladimir Levin, +1 by Adithya Srinivasan, +1 by Ari Chivukula, +1 by Joe Mason
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I568a710e329d54949ab7be5b7e1fcd314eac9b24
            Gerrit-Change-Number: 7871317
            Gerrit-PatchSet: 26
            Gerrit-Owner: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
            Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
            Gerrit-Reviewer: Ari Chivukula <ari...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Reviewer: Joe Mason <joenot...@google.com>
            Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            open
            diffy
            satisfied_requirement

            Yuzu Saijo (Gerrit)

            unread,
            2:12 AM (13 hours ago) 2:12 AM
            to Chromium LUCI CQ, Jeremy Roman, Vladimir Levin, Adithya Srinivasan, Andrew Verge, Ari Chivukula, Chromium IPC Reviews, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-re...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

            Yuzu Saijo has created a revert of this change

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement 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: revert
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages