feat: Adds gemini eligibility within the tab helper [chromium/src : main]

0 views
Skip to first unread message

Adam Arcaro (Gerrit)

unread,
Jan 13, 2026, 3:29:21 PM (8 days ago) Jan 13
to Francis Beauchamp, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Francis Beauchamp and Nicolas MacBeth

Adam Arcaro added 4 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Adam Arcaro . resolved

Thanks! Please see a few comments

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
Line 247, Patchset 2 (Latest): bool is_gemini_eligible_ = false;
Adam Arcaro . unresolved

Let's default to `true` since the great majority of sites are eligible, and Gemini also checks eligibility itself before sending a response. I would rather risk allowing some pages to appear as eligible than preventing eligible pages from being used

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 425, Patchset 2 (Latest): if (IsZeroStateSuggestionsEnabled()) {
Adam Arcaro . unresolved

We don't want to depend on the zero state suggestions flag for this anymore, otherwise we'll never get `OnCanApplyZeroStateSuggestionsDecision` without the feature enabled

Can you extract the shared functionality from this function and just flag guard the code that's specific to zero state suggestions? We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features

Line 730, Patchset 2 (Latest):void BwgTabHelper::OnCanApplyZeroStateSuggestionsDecision(
Adam Arcaro . unresolved

As part of this improvement, we should rename this since it's not just used for zero state suggestions

Open in Gerrit

Related details

Attention is currently required from:
  • Francis Beauchamp
  • Nicolas MacBeth
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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
Gerrit-Change-Number: 7463403
Gerrit-PatchSet: 2
Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
Gerrit-Comment-Date: Tue, 13 Jan 2026 20:29:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Francis Beauchamp (Gerrit)

unread,
Jan 13, 2026, 4:32:02 PM (8 days ago) Jan 13
to Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Adam Arcaro

Francis Beauchamp added 3 comments

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
Line 247, Patchset 2 (Latest): bool is_gemini_eligible_ = false;
Adam Arcaro . unresolved

Let's default to `true` since the great majority of sites are eligible, and Gemini also checks eligibility itself before sending a response. I would rather risk allowing some pages to appear as eligible than preventing eligible pages from being used

Francis Beauchamp

Agreed!

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 425, Patchset 2 (Latest): if (IsZeroStateSuggestionsEnabled()) {
Adam Arcaro . unresolved

We don't want to depend on the zero state suggestions flag for this anymore, otherwise we'll never get `OnCanApplyZeroStateSuggestionsDecision` without the feature enabled

Can you extract the shared functionality from this function and just flag guard the code that's specific to zero state suggestions? We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features

Francis Beauchamp

Just to make sure I get this right, you're suggesting that I move `CanApplyOptimization` outside of `IsZeroStateSuggestionsEnabled` with all of the conditionals that lead to it? In other words, leaving just this code behind the flag:
```
weak_ptr_factory_.InvalidateWeakPtrs();
ClearZeroStateSuggestions();
zero_state_suggestions_->url = current_url;
```

I'm not certain what you mean exactly by "We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features". Would you care to elaborate on that?

Line 730, Patchset 2 (Latest):void BwgTabHelper::OnCanApplyZeroStateSuggestionsDecision(
Adam Arcaro . unresolved

As part of this improvement, we should rename this since it's not just used for zero state suggestions

Francis Beauchamp

It isn't just for zero state suggestions, but it also have a strong relationship to it. What I can do is first gate it's content that is specific to zero state suggestion by the `IsZeroStateSuggestionsEnabled()` flag. Then, we can rename for something more generic like `OnGeminiEligibilityDecision` (really not sure on that one). Additionally, `OnCanApplyZeroStateSuggestionsOnDemandDecision` will have to be renamed for `OnGeminiEligibilityOnDemandDecision`.

Thoughts?

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Arcaro
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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
Gerrit-Change-Number: 7463403
Gerrit-PatchSet: 2
Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Adam Arcaro <ada...@google.com>
Gerrit-Comment-Date: Tue, 13 Jan 2026 21:31:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Arcaro (Gerrit)

unread,
Jan 13, 2026, 4:53:54 PM (8 days ago) Jan 13
to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Francis Beauchamp

Adam Arcaro added 2 comments

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 425, Patchset 2 (Latest): if (IsZeroStateSuggestionsEnabled()) {
Adam Arcaro . unresolved

We don't want to depend on the zero state suggestions flag for this anymore, otherwise we'll never get `OnCanApplyZeroStateSuggestionsDecision` without the feature enabled

Can you extract the shared functionality from this function and just flag guard the code that's specific to zero state suggestions? We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features

Francis Beauchamp

Just to make sure I get this right, you're suggesting that I move `CanApplyOptimization` outside of `IsZeroStateSuggestionsEnabled` with all of the conditionals that lead to it? In other words, leaving just this code behind the flag:
```
weak_ptr_factory_.InvalidateWeakPtrs();
ClearZeroStateSuggestions();
zero_state_suggestions_->url = current_url;
```

I'm not certain what you mean exactly by "We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features". Would you care to elaborate on that?

Adam Arcaro

Yes, moving the following behind the zero state flag sgtm! But maybe we should leave the pointer invalidation

```


ClearZeroStateSuggestions();
zero_state_suggestions_->url = current_url;
```

Right now, we use `zero_state_suggestions_->url` to track the last URL to determine whether we need to perform another optimization guide check. We'll now need to track the URL more generally since the optimization guide check isn't just used for ZSS. Let me know if that's clear and we can chat if you have any questions

Line 730, Patchset 2 (Latest):void BwgTabHelper::OnCanApplyZeroStateSuggestionsDecision(
Adam Arcaro . unresolved

As part of this improvement, we should rename this since it's not just used for zero state suggestions

Francis Beauchamp

It isn't just for zero state suggestions, but it also have a strong relationship to it. What I can do is first gate it's content that is specific to zero state suggestion by the `IsZeroStateSuggestionsEnabled()` flag. Then, we can rename for something more generic like `OnGeminiEligibilityDecision` (really not sure on that one). Additionally, `OnCanApplyZeroStateSuggestionsOnDemandDecision` will have to be renamed for `OnGeminiEligibilityOnDemandDecision`.

Thoughts?

Adam Arcaro

Those new names sgtm, since they do indeed just check eligibility for using the page context

Open in Gerrit

Related details

Attention is currently required from:
  • Francis Beauchamp
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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
Gerrit-Change-Number: 7463403
Gerrit-PatchSet: 2
Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
Gerrit-Comment-Date: Tue, 13 Jan 2026 21:53:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
Comment-In-Reply-To: Francis Beauchamp <fbeau...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Francis Beauchamp (Gerrit)

unread,
Jan 14, 2026, 10:40:13 AM (7 days ago) Jan 14
to Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Adam Arcaro

Francis Beauchamp added 3 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Francis Beauchamp . resolved

I have refactored the `DidStartNavigation` to take your comment into account. The url held within the `ZeroStateSuggestions` has been removed in favor of the `current_url_` which was recently added to the tab helper. As such, we no longer rely on the ZSS for the eligibility checks, and they remain gated by the url having changed. Now, one side effect which I'm not entirely certain and would like feedback on is the difference between a simple `GetUrl()` and one with `GetWithoutRef()` and what implications it may have on the refactored code. Some new code added and flagged by `IsGeminiCopresenceEnabled()` don't use the `GetWithoutRef` and I'm wondering if it was by design or a simple omission with no consequences.

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
Line 247, Patchset 2: bool is_gemini_eligible_ = false;
Adam Arcaro . resolved

Let's default to `true` since the great majority of sites are eligible, and Gemini also checks eligibility itself before sending a response. I would rather risk allowing some pages to appear as eligible than preventing eligible pages from being used

Francis Beauchamp

Agreed!

Francis Beauchamp

Done

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 730, Patchset 2:void BwgTabHelper::OnCanApplyZeroStateSuggestionsDecision(
Adam Arcaro . resolved

As part of this improvement, we should rename this since it's not just used for zero state suggestions

Francis Beauchamp

It isn't just for zero state suggestions, but it also have a strong relationship to it. What I can do is first gate it's content that is specific to zero state suggestion by the `IsZeroStateSuggestionsEnabled()` flag. Then, we can rename for something more generic like `OnGeminiEligibilityDecision` (really not sure on that one). Additionally, `OnCanApplyZeroStateSuggestionsOnDemandDecision` will have to be renamed for `OnGeminiEligibilityOnDemandDecision`.

Thoughts?

Adam Arcaro

Those new names sgtm, since they do indeed just check eligibility for using the page context

Francis Beauchamp

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Arcaro
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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
Gerrit-Change-Number: 7463403
Gerrit-PatchSet: 3
Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Adam Arcaro <ada...@google.com>
Gerrit-Comment-Date: Wed, 14 Jan 2026 15:40:07 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Francis Beauchamp (Gerrit)

unread,
Jan 14, 2026, 10:57:55 AM (7 days ago) Jan 14
to Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Adam Arcaro

Francis Beauchamp added 1 comment

File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
Line 425, Patchset 2: if (IsZeroStateSuggestionsEnabled()) {
Adam Arcaro . resolved

We don't want to depend on the zero state suggestions flag for this anymore, otherwise we'll never get `OnCanApplyZeroStateSuggestionsDecision` without the feature enabled

Can you extract the shared functionality from this function and just flag guard the code that's specific to zero state suggestions? We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features

Francis Beauchamp

Just to make sure I get this right, you're suggesting that I move `CanApplyOptimization` outside of `IsZeroStateSuggestionsEnabled` with all of the conditionals that lead to it? In other words, leaving just this code behind the flag:
```
weak_ptr_factory_.InvalidateWeakPtrs();
ClearZeroStateSuggestions();
zero_state_suggestions_->url = current_url;
```

I'm not certain what you mean exactly by "We probably want to generalize `zero_state_suggestions_->url` to track URL checking for multiple features". Would you care to elaborate on that?

Adam Arcaro

Yes, moving the following behind the zero state flag sgtm! But maybe we should leave the pointer invalidation

```
ClearZeroStateSuggestions();
zero_state_suggestions_->url = current_url;
```

Right now, we use `zero_state_suggestions_->url` to track the last URL to determine whether we need to perform another optimization guide check. We'll now need to track the URL more generally since the optimization guide check isn't just used for ZSS. Let me know if that's clear and we can chat if you have any questions

Francis Beauchamp

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Arcaro
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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
    Gerrit-Change-Number: 7463403
    Gerrit-PatchSet: 3
    Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
    Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
    Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
    Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
    Gerrit-Attention: Adam Arcaro <ada...@google.com>
    Gerrit-Comment-Date: Wed, 14 Jan 2026 15:57:49 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Adam Arcaro (Gerrit)

    unread,
    Jan 14, 2026, 6:25:07 PM (7 days ago) Jan 14
    to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Francis Beauchamp

    Adam Arcaro added 4 comments

    Patchset-level comments
    Adam Arcaro . resolved

    Looking good! Check out a few more comments

    File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
    Line 423, Patchset 3 (Latest): const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
    Adam Arcaro . unresolved

    In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

    Line 427, Patchset 3 (Latest): ClearZeroStateSuggestions();
    Adam Arcaro . unresolved

    This should be behind the `IsZeroStateSuggestionsEnabled` flag

    Line 727, Patchset 3 (Latest): // The URL has changed so the metadata is obsolete.
    Adam Arcaro . unresolved

    When `IsGeminiCopresenceEnabled` is true, we need to inform the BwgBrowserAgent of any changes to the page context, including eligibility updates. Therefore we should add this block here:

    ```
    if (IsGeminiCopresenceEnabled()) {
    for (auto& observer : observers_) {
    observer.OnPageContextUpdated(web_state_);
    }
    }
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Francis Beauchamp
    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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 3
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 23:25:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      Jan 15, 2026, 9:48:27 AM (6 days ago) Jan 15
      to Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro

      Francis Beauchamp added 3 comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 423, Patchset 3 (Latest): const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
      Adam Arcaro . unresolved

      In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

      Francis Beauchamp

      Just to make sure we are on the same page; we are to remove the `GetWithoutRef` which will result in all of the tab helper code relying on the URL to include the `#` parts? I would assume that links within a page that simply lead to an anchor within the same page would result in the equality check to return `false`, thus reloading the ZSS and all that (which might be counter intuitive).

      Line 427, Patchset 3 (Latest): ClearZeroStateSuggestions();
      Adam Arcaro . unresolved

      This should be behind the `IsZeroStateSuggestionsEnabled` flag

      Francis Beauchamp

      Since the function already gates the entirety of its statements (leading to NO-OP), it felt extraneous. Happy to add the double check here if you think it is necessary in case the content of the function changes someday. I personally find that adding checks everywhere is rather verbose and noisy, as opposed to gating the code once within the functions. Do we have a clear preference in our codebase?

      Line 727, Patchset 3 (Latest): // The URL has changed so the metadata is obsolete.
      Adam Arcaro . unresolved

      When `IsGeminiCopresenceEnabled` is true, we need to inform the BwgBrowserAgent of any changes to the page context, including eligibility updates. Therefore we should add this block here:

      ```
      if (IsGeminiCopresenceEnabled()) {
      for (auto& observer : observers_) {
      observer.OnPageContextUpdated(web_state_);
      }
      }
      ```
      Francis Beauchamp

      I see; it seems like that exact behaviour is already what exists in `DidStartNavigation`. I will extract it in a function and call it from here.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 3
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Comment-Date: Thu, 15 Jan 2026 14:48:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 16, 2026, 12:28:25 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp

      Adam Arcaro added 3 comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 423, Patchset 3: const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
      Adam Arcaro . unresolved

      In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

      Francis Beauchamp

      Just to make sure we are on the same page; we are to remove the `GetWithoutRef` which will result in all of the tab helper code relying on the URL to include the `#` parts? I would assume that links within a page that simply lead to an anchor within the same page would result in the equality check to return `false`, thus reloading the ZSS and all that (which might be counter intuitive).

      Adam Arcaro

      For SPAs, the `#` part isn't always simply an anchor within the page. Use gmail.com as an example - the "inbox" URL is https://mail.google.com/mail/u/0/#inbox, and the "sent" URL is https://mail.google.com/mail/u/0/#sent, which have entirely different content and thus different zero-state suggestions

      However, it is true that the Gemini page eligibility check should be consistent for both. We should probably store the full URL, and then add a `GetWithoutRef` check to determine whether to make another eligibility call, but ignore that for the suggestions check

      Does that make sense?

      Line 427, Patchset 3: ClearZeroStateSuggestions();
      Adam Arcaro . unresolved

      This should be behind the `IsZeroStateSuggestionsEnabled` flag

      Francis Beauchamp

      Since the function already gates the entirety of its statements (leading to NO-OP), it felt extraneous. Happy to add the double check here if you think it is necessary in case the content of the function changes someday. I personally find that adding checks everywhere is rather verbose and noisy, as opposed to gating the code once within the functions. Do we have a clear preference in our codebase?

      Adam Arcaro

      For readability, I would suggest either moving the flag check here or just duplicating it. Flag checks are temporary code so I don't feel too strongly, but it's misleading to see an unchecked `ClearZeroStateSuggestions` call on each navigation

      Line 727, Patchset 3: // The URL has changed so the metadata is obsolete.
      Adam Arcaro . resolved

      When `IsGeminiCopresenceEnabled` is true, we need to inform the BwgBrowserAgent of any changes to the page context, including eligibility updates. Therefore we should add this block here:

      ```
      if (IsGeminiCopresenceEnabled()) {
      for (auto& observer : observers_) {
      observer.OnPageContextUpdated(web_state_);
      }
      }
      ```
      Francis Beauchamp

      I see; it seems like that exact behaviour is already what exists in `DidStartNavigation`. I will extract it in a function and call it from here.

      Adam Arcaro

      Perf!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 4
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 17:28:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
      Comment-In-Reply-To: Francis Beauchamp <fbeau...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      Jan 16, 2026, 3:02:07 PM (5 days ago) Jan 16
      to Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro

      Francis Beauchamp added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 423, Patchset 3: const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
      Adam Arcaro . unresolved

      In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

      Francis Beauchamp

      Just to make sure we are on the same page; we are to remove the `GetWithoutRef` which will result in all of the tab helper code relying on the URL to include the `#` parts? I would assume that links within a page that simply lead to an anchor within the same page would result in the equality check to return `false`, thus reloading the ZSS and all that (which might be counter intuitive).

      Adam Arcaro

      For SPAs, the `#` part isn't always simply an anchor within the page. Use gmail.com as an example - the "inbox" URL is https://mail.google.com/mail/u/0/#inbox, and the "sent" URL is https://mail.google.com/mail/u/0/#sent, which have entirely different content and thus different zero-state suggestions

      However, it is true that the Gemini page eligibility check should be consistent for both. We should probably store the full URL, and then add a `GetWithoutRef` check to determine whether to make another eligibility call, but ignore that for the suggestions check

      Does that make sense?

      Francis Beauchamp

      My understanding of this is that you want the rest of the code to ignore the presence of the ref (i.e. use the URL as is), but have the check here as:

      ```
      const GURL& new_url = navigation_context->GetUrl();
      if (new_url.GetWithoutRef() != current_url_.GetWithoutRef()) { ... }
      ```

      Is that what you were trying to say?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 4
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 20:02:00 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 16, 2026, 3:06:27 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp

      Adam Arcaro added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 423, Patchset 3: const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
      Adam Arcaro . unresolved

      In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

      Francis Beauchamp

      Just to make sure we are on the same page; we are to remove the `GetWithoutRef` which will result in all of the tab helper code relying on the URL to include the `#` parts? I would assume that links within a page that simply lead to an anchor within the same page would result in the equality check to return `false`, thus reloading the ZSS and all that (which might be counter intuitive).

      Adam Arcaro

      For SPAs, the `#` part isn't always simply an anchor within the page. Use gmail.com as an example - the "inbox" URL is https://mail.google.com/mail/u/0/#inbox, and the "sent" URL is https://mail.google.com/mail/u/0/#sent, which have entirely different content and thus different zero-state suggestions

      However, it is true that the Gemini page eligibility check should be consistent for both. We should probably store the full URL, and then add a `GetWithoutRef` check to determine whether to make another eligibility call, but ignore that for the suggestions check

      Does that make sense?

      Francis Beauchamp

      My understanding of this is that you want the rest of the code to ignore the presence of the ref (i.e. use the URL as is), but have the check here as:

      ```
      const GURL& new_url = navigation_context->GetUrl();
      if (new_url.GetWithoutRef() != current_url_.GetWithoutRef()) { ... }
      ```

      Is that what you were trying to say?

      Adam Arcaro

      Exactly!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 4
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 20:06:22 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Nicolas MacBeth (Gerrit)

      unread,
      Jan 16, 2026, 3:20:29 PM (5 days ago) Jan 16
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp and Tarek Makkouk

      Nicolas MacBeth added 4 comments

      Patchset-level comments
      File-level comment, Patchset 4 (Latest):
      Nicolas MacBeth . resolved

      thanks Francis! see some comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
      Line 253, Patchset 4 (Latest): //  Whether the content has been deemed eligible for gemini usage.
      Nicolas MacBeth . unresolved

      nit: `Gemini`

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 211, Patchset 4 (Latest): if (web_state_->GetVisibleURL().GetWithoutRef() == current_url_) {
      Nicolas MacBeth . unresolved

      when would this not be true? we set the new URL right when navigations start, so this would presumably always be true, no? I think the URL in the ZeroState suggestions struct is there because the ZS suggestions themselves are tied to a URL, and this helps them not became stale. CC: @tarekm...@google.com for input here

      Line 730, Patchset 4 (Latest): is_gemini_eligible_ =
      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . unresolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      • Tarek Makkouk
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 4
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 20:20:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tarek Makkouk (Gerrit)

      unread,
      Jan 16, 2026, 3:55:10 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp

      Tarek Makkouk added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 211, Patchset 4: if (web_state_->GetVisibleURL().GetWithoutRef() == current_url_) {
      Nicolas MacBeth . unresolved

      when would this not be true? we set the new URL right when navigations start, so this would presumably always be true, no? I think the URL in the ZeroState suggestions struct is there because the ZS suggestions themselves are tied to a URL, and this helps them not became stale. CC: @tarekm...@google.com for input here

      Tarek Makkouk

      Yeah that's exactly it. The plan was to have the ZSSs tightly coupled with their corresponding URL, which ideally would always be the current one, but ```web_state_->GetVisibleURL().GetWithoutRef()``` will always have the current URL, so the check was added to ensure we don't push stale suggestions, even if it means we have to go with the default suggestions. In short, it's to ensure we fail elegantly if the ZSSs are out of sync for any reason.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 5
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 20:55:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tarek Makkouk (Gerrit)

      unread,
      Jan 16, 2026, 4:02:39 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro, Francis Beauchamp and Nicolas MacBeth

      Tarek Makkouk added 1 comment

      Patchset-level comments
      File-level comment, Patchset 5 (Latest):
      Tarek Makkouk . unresolved

      I was wonderring why are we opting to untie the URL from the ZSS? Couldn't we just keep it to ensure that we don't push stale ZSSs and just use the webstate to more accurately get the current URL?

      cc: @ada...@google.com @nicolas...@google.com

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      • Francis Beauchamp
      • Nicolas MacBeth
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 5
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 21:02:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tarek Makkouk (Gerrit)

      unread,
      Jan 16, 2026, 4:38:19 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro, Francis Beauchamp and Nicolas MacBeth

      Tarek Makkouk added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 730, Patchset 4: is_gemini_eligible_ =

      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . unresolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Tarek Makkouk

      I'm not sure if they are equivalent, so I'll defer to @ada...@google.com on that, but if it is the case, that would imply that theoretically we should never see the default suggestions (i.e., summary, FAQ, "What can Gemini do?") as any page eligible for Gemini would also be eligible for ZSSs. I'm not sure if this is the intended functionality and, from what I can recall, I think I experienced the default suggestions in the current state of the app.

      Gerrit-Comment-Date: Fri, 16 Jan 2026 21:38:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 16, 2026, 5:03:18 PM (5 days ago) Jan 16
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp and Nicolas MacBeth

      Adam Arcaro added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 730, Patchset 4: is_gemini_eligible_ =
      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . unresolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Tarek Makkouk

      I'm not sure if they are equivalent, so I'll defer to @ada...@google.com on that, but if it is the case, that would imply that theoretically we should never see the default suggestions (i.e., summary, FAQ, "What can Gemini do?") as any page eligible for Gemini would also be eligible for ZSSs. I'm not sure if this is the intended functionality and, from what I can recall, I think I experienced the default suggestions in the current state of the app.

      Adam Arcaro

      It's correct that any page eligible for Gemini should also be eligible for ZSS.

      The logic for when static chips should be shown is handled within the SDK (e.g. "Summarize" is always shown, "What can Gemini do?" is shown to new users, etc), and the "Create a FAQ" chip is just a fallback.

      Pages without metadata are eligible by default (as per Chrome Intelligence guidance)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      • Nicolas MacBeth
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 5
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Fri, 16 Jan 2026 22:03:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      Comment-In-Reply-To: Tarek Makkouk <tarekm...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tarek Makkouk (Gerrit)

      unread,
      Jan 16, 2026, 5:05:53 PM (5 days ago) Jan 16
      to Francis Beauchamp, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp and Nicolas MacBeth

      Tarek Makkouk added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 730, Patchset 4: is_gemini_eligible_ =
      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . unresolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Tarek Makkouk

      I'm not sure if they are equivalent, so I'll defer to @ada...@google.com on that, but if it is the case, that would imply that theoretically we should never see the default suggestions (i.e., summary, FAQ, "What can Gemini do?") as any page eligible for Gemini would also be eligible for ZSSs. I'm not sure if this is the intended functionality and, from what I can recall, I think I experienced the default suggestions in the current state of the app.

      Adam Arcaro

      It's correct that any page eligible for Gemini should also be eligible for ZSS.

      The logic for when static chips should be shown is handled within the SDK (e.g. "Summarize" is always shown, "What can Gemini do?" is shown to new users, etc), and the "Create a FAQ" chip is just a fallback.

      Pages without metadata are eligible by default (as per Chrome Intelligence guidance)

      Tarek Makkouk

      That's good to know, thank you!

      Gerrit-Comment-Date: Fri, 16 Jan 2026 22:05:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
      Comment-In-Reply-To: Tarek Makkouk <tarekm...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Nicolas MacBeth (Gerrit)

      unread,
      Jan 19, 2026, 11:36:48 AM (2 days ago) Jan 19
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp

      Nicolas MacBeth added 1 comment

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 737, Patchset 5 (Latest): if (!IsZeroStateSuggestionsEnabled() || url != current_url_) {
      Nicolas MacBeth . unresolved

      some of the below code should ideally run regardless of `ZeroStateSuggestionsEnabled()`. if eligibility is *good*, lines 760 to 768 (GeminiImageRemix code) of this patchset should be executed regardless of `IsZeroStateSuggestionsEnabled()`. thanks!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 5
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Mon, 19 Jan 2026 16:36:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      Jan 19, 2026, 1:52:47 PM (2 days ago) Jan 19
      to Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro, Nicolas MacBeth and Tarek Makkouk

      Francis Beauchamp added 4 comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 211, Patchset 4: if (web_state_->GetVisibleURL().GetWithoutRef() == current_url_) {
      Nicolas MacBeth . unresolved

      when would this not be true? we set the new URL right when navigations start, so this would presumably always be true, no? I think the URL in the ZeroState suggestions struct is there because the ZS suggestions themselves are tied to a URL, and this helps them not became stale. CC: @tarekm...@google.com for input here

      Tarek Makkouk

      Yeah that's exactly it. The plan was to have the ZSSs tightly coupled with their corresponding URL, which ideally would always be the current one, but ```web_state_->GetVisibleURL().GetWithoutRef()``` will always have the current URL, so the check was added to ensure we don't push stale suggestions, even if it means we have to go with the default suggestions. In short, it's to ensure we fail elegantly if the ZSSs are out of sync for any reason.

      Francis Beauchamp

      Perhaps @ada...@google.com can confirm the behaviour we are going for; essentially the goal is to use the stored url in the tab helper (which is essentially the same as using a stored URL in the ZSS that gets updated at every `DidStartNavigation`).

      Now, perhaps I am mistaken here: my understanding is that since we only store one copy of the ZSS structure, it doesn't matter that we tightly couple it to an URL or use the one in the tab helper: they both get updated at every `DidStartNavigation`.

      In any case, I might require some of your inputs to better understand what we want, because this is all quite new to me and I doubt I have all the context to make an appropriate decision.

      Line 427, Patchset 3: ClearZeroStateSuggestions();
      Adam Arcaro . resolved

      This should be behind the `IsZeroStateSuggestionsEnabled` flag

      Francis Beauchamp

      Since the function already gates the entirety of its statements (leading to NO-OP), it felt extraneous. Happy to add the double check here if you think it is necessary in case the content of the function changes someday. I personally find that adding checks everywhere is rather verbose and noisy, as opposed to gating the code once within the functions. Do we have a clear preference in our codebase?

      Adam Arcaro

      For readability, I would suggest either moving the flag check here or just duplicating it. Flag checks are temporary code so I don't feel too strongly, but it's misleading to see an unchecked `ClearZeroStateSuggestions` call on each navigation

      Francis Beauchamp

      Done

      Line 730, Patchset 4: is_gemini_eligible_ =
      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . unresolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Tarek Makkouk

      I'm not sure if they are equivalent, so I'll defer to @ada...@google.com on that, but if it is the case, that would imply that theoretically we should never see the default suggestions (i.e., summary, FAQ, "What can Gemini do?") as any page eligible for Gemini would also be eligible for ZSSs. I'm not sure if this is the intended functionality and, from what I can recall, I think I experienced the default suggestions in the current state of the app.

      Adam Arcaro

      It's correct that any page eligible for Gemini should also be eligible for ZSS.

      The logic for when static chips should be shown is handled within the SDK (e.g. "Summarize" is always shown, "What can Gemini do?" is shown to new users, etc), and the "Create a FAQ" chip is just a fallback.

      Pages without metadata are eligible by default (as per Chrome Intelligence guidance)

      Tarek Makkouk

      That's good to know, thank you!

      Francis Beauchamp

      I feel like this might benefit from a sync conversation when we are back in the office; there seems to be either a misunderstanding on my part or a misalignment between the requirements that we had VS the ones that have been brought to my attention.

      Line 737, Patchset 5 (Latest): if (!IsZeroStateSuggestionsEnabled() || url != current_url_) {
      Nicolas MacBeth . unresolved

      some of the below code should ideally run regardless of `ZeroStateSuggestionsEnabled()`. if eligibility is *good*, lines 760 to 768 (GeminiImageRemix code) of this patchset should be executed regardless of `IsZeroStateSuggestionsEnabled()`. thanks!

      Francis Beauchamp

      My feeling, as I see this function grow (originally much smaller when I started what was supposed to be a small, trivial refactor), is that it is no longer adequately separating the different concerns of updating the page context, the zero state suggestions, and now calling conditional code based on GeminiImageRemix.

      We have an increasing number of conditions and this could lead a dip in maintainability. I would suggest, although beyond the scope of the current change, that we start thinking about a better way of separating these concerns such that the side effects can be contained.

      On that point, the creation of smaller functional units (i.e. functions) gating their own behaviour as opposed to having a bunch of conditions that can conflict with one another would yield cleaner, more maintainable code.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      • Nicolas MacBeth
      • Tarek Makkouk
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 5
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Comment-Date: Mon, 19 Jan 2026 18:52:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      Comment-In-Reply-To: Tarek Makkouk <tarekm...@google.com>
      Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
      Comment-In-Reply-To: Francis Beauchamp <fbeau...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 19, 2026, 4:29:37 PM (2 days ago) Jan 19
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp, Nicolas MacBeth and Tarek Makkouk

      Adam Arcaro added 5 comments

      Patchset-level comments
      File-level comment, Patchset 5:
      Adam Arcaro . resolved

      2 minor comments and this should be ready to land!

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 211, Patchset 4: if (web_state_->GetVisibleURL().GetWithoutRef() == current_url_) {
      Nicolas MacBeth . resolved

      when would this not be true? we set the new URL right when navigations start, so this would presumably always be true, no? I think the URL in the ZeroState suggestions struct is there because the ZS suggestions themselves are tied to a URL, and this helps them not became stale. CC: @tarekm...@google.com for input here

      Tarek Makkouk

      Yeah that's exactly it. The plan was to have the ZSSs tightly coupled with their corresponding URL, which ideally would always be the current one, but ```web_state_->GetVisibleURL().GetWithoutRef()``` will always have the current URL, so the check was added to ensure we don't push stale suggestions, even if it means we have to go with the default suggestions. In short, it's to ensure we fail elegantly if the ZSSs are out of sync for any reason.

      Francis Beauchamp

      Perhaps @ada...@google.com can confirm the behaviour we are going for; essentially the goal is to use the stored url in the tab helper (which is essentially the same as using a stored URL in the ZSS that gets updated at every `DidStartNavigation`).

      Now, perhaps I am mistaken here: my understanding is that since we only store one copy of the ZSS structure, it doesn't matter that we tightly couple it to an URL or use the one in the tab helper: they both get updated at every `DidStartNavigation`.

      In any case, I might require some of your inputs to better understand what we want, because this is all quite new to me and I doubt I have all the context to make an appropriate decision.

      Adam Arcaro

      This CL just extracted the `zero_staet_suggestions_->url` field into a more generic `current_url_` field, so this change should be a no-op. As Tarek said, the condition was previously added as a safety check to make sure we're generating suggestions for the active web state, and not some other tab

      Line 292, Patchset 6 (Latest): page_context->set_url(current_url_.spec());
      Adam Arcaro . unresolved

      I just realized that `current_url_` is being used here, which would benefit from the full URL (and not just the ref-stripped version)

      Would you mind updating the CL to store the full URL in `current_url_`, but then use the ref-stripped version for comparison?

      Thanks for your patience as we figure this out! There are a lot of features at play here

      Line 423, Patchset 3: const GURL& new_url = navigation_context->GetUrl().GetWithoutRef();
      Adam Arcaro . resolved

      In order to better handle single-page applications, we should remove `GetWithoutRef` for the zero-state suggestions check (even though I think this was the existing behavior)

      Francis Beauchamp

      Just to make sure we are on the same page; we are to remove the `GetWithoutRef` which will result in all of the tab helper code relying on the URL to include the `#` parts? I would assume that links within a page that simply lead to an anchor within the same page would result in the equality check to return `false`, thus reloading the ZSS and all that (which might be counter intuitive).

      Adam Arcaro

      For SPAs, the `#` part isn't always simply an anchor within the page. Use gmail.com as an example - the "inbox" URL is https://mail.google.com/mail/u/0/#inbox, and the "sent" URL is https://mail.google.com/mail/u/0/#sent, which have entirely different content and thus different zero-state suggestions

      However, it is true that the Gemini page eligibility check should be consistent for both. We should probably store the full URL, and then add a `GetWithoutRef` check to determine whether to make another eligibility call, but ignore that for the suggestions check

      Does that make sense?

      Francis Beauchamp

      My understanding of this is that you want the rest of the code to ignore the presence of the ref (i.e. use the URL as is), but have the check here as:

      ```
      const GURL& new_url = navigation_context->GetUrl();
      if (new_url.GetWithoutRef() != current_url_.GetWithoutRef()) { ... }
      ```

      Is that what you were trying to say?

      Adam Arcaro

      Exactly!

      Adam Arcaro

      Obsolete, resolving

      Line 749, Patchset 6 (Latest): return;
      Adam Arcaro . unresolved

      Let's remove this `return`, since we still want to generate ZSS if the IPH was shown

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      • Nicolas MacBeth
      • Tarek Makkouk
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 6
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Mon, 19 Jan 2026 21:29:31 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 19, 2026, 4:34:49 PM (2 days ago) Jan 19
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp, Nicolas MacBeth and Tarek Makkouk

      Adam Arcaro added 2 comments

      Patchset-level comments
      Tarek Makkouk . unresolved

      I was wonderring why are we opting to untie the URL from the ZSS? Couldn't we just keep it to ensure that we don't push stale ZSSs and just use the webstate to more accurately get the current URL?

      cc: @ada...@google.com @nicolas...@google.com

      Adam Arcaro

      The ZSS struct should always reflect the current web state, and we already track the current web state's URL in `current_url_`. The way I see it, there should not be a case where `current_url_` and `zero_state_suggestions_->url` are different (the ZSS should just be empty if they don't represent the same URL), and thus both variables feel redundant

      Tarek, please let me know if you see this differently. Thanks!

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 730, Patchset 4: is_gemini_eligible_ =
      decision == optimization_guide::OptimizationGuideDecision::kTrue;
      Nicolas MacBeth . resolved

      I'm not sure this is true, but am really unsure. Look at the below comment (line #737). I think OptiGuide returns kTrue when it has something to say, and the actual result is computed below -> this confuses me too. (`zero_state_suggestions_->can_apply` is equivalent to `is_gemini_eligible_`, no?)

      CC: @tarekm...@google.com who worked on this initially, and @ada...@google.com

      Tarek Makkouk

      I'm not sure if they are equivalent, so I'll defer to @ada...@google.com on that, but if it is the case, that would imply that theoretically we should never see the default suggestions (i.e., summary, FAQ, "What can Gemini do?") as any page eligible for Gemini would also be eligible for ZSSs. I'm not sure if this is the intended functionality and, from what I can recall, I think I experienced the default suggestions in the current state of the app.

      Adam Arcaro

      It's correct that any page eligible for Gemini should also be eligible for ZSS.

      The logic for when static chips should be shown is handled within the SDK (e.g. "Summarize" is always shown, "What can Gemini do?" is shown to new users, etc), and the "Create a FAQ" chip is just a fallback.

      Pages without metadata are eligible by default (as per Chrome Intelligence guidance)

      Tarek Makkouk

      That's good to know, thank you!

      Francis Beauchamp

      I feel like this might benefit from a sync conversation when we are back in the office; there seems to be either a misunderstanding on my part or a misalignment between the requirements that we had VS the ones that have been brought to my attention.

      Adam Arcaro

      Resolving

      Gerrit-Comment-Date: Mon, 19 Jan 2026 21:34:44 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      Jan 20, 2026, 2:54:34 PM (22 hours ago) Jan 20
      to Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro

      Francis Beauchamp added 3 comments

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Francis Beauchamp . resolved

      Reshuffled some code as part of the latest updates. Most importantly, the eligibility computation is extracted in a function; its return value is propagated to the `ZSS->canApply` and `is_gemini_eligible`. Additionally, the `GetWithoutRef()` is added to all the places where it was needed, while ensuring we store the full URL that gets added to the page context.

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 292, Patchset 6: page_context->set_url(current_url_.spec());
      Adam Arcaro . resolved

      I just realized that `current_url_` is being used here, which would benefit from the full URL (and not just the ref-stripped version)

      Would you mind updating the CL to store the full URL in `current_url_`, but then use the ref-stripped version for comparison?

      Thanks for your patience as we figure this out! There are a lot of features at play here

      Francis Beauchamp

      Done

      Line 749, Patchset 6: return;
      Adam Arcaro . resolved

      Let's remove this `return`, since we still want to generate ZSS if the IPH was shown

      Francis Beauchamp

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 7
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Comment-Date: Tue, 20 Jan 2026 19:54:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Adam Arcaro <ada...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      Jan 20, 2026, 3:28:13 PM (22 hours ago) Jan 20
      to Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org

      Francis Beauchamp added 2 comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
      Line 253, Patchset 4: //  Whether the content has been deemed eligible for gemini usage.
      Nicolas MacBeth . resolved

      nit: `Gemini`

      Francis Beauchamp

      Done

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 737, Patchset 5: if (!IsZeroStateSuggestionsEnabled() || url != current_url_) {
      Nicolas MacBeth . resolved

      some of the below code should ideally run regardless of `ZeroStateSuggestionsEnabled()`. if eligibility is *good*, lines 760 to 768 (GeminiImageRemix code) of this patchset should be executed regardless of `IsZeroStateSuggestionsEnabled()`. thanks!

      Francis Beauchamp

      My feeling, as I see this function grow (originally much smaller when I started what was supposed to be a small, trivial refactor), is that it is no longer adequately separating the different concerns of updating the page context, the zero state suggestions, and now calling conditional code based on GeminiImageRemix.

      We have an increasing number of conditions and this could lead a dip in maintainability. I would suggest, although beyond the scope of the current change, that we start thinking about a better way of separating these concerns such that the side effects can be contained.

      On that point, the creation of smaller functional units (i.e. functions) gating their own behaviour as opposed to having a bunch of conditions that can conflict with one another would yield cleaner, more maintainable code.

      Francis Beauchamp

      Done

      Open in Gerrit

      Related details

      Attention set is empty
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 8
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Comment-Date: Tue, 20 Jan 2026 20:28:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nicolas MacBeth <nicolas...@google.com>
      Comment-In-Reply-To: Francis Beauchamp <fbeau...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Arcaro (Gerrit)

      unread,
      Jan 20, 2026, 4:42:01 PM (20 hours ago) Jan 20
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Nicolas MacBeth, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp and Tarek Makkouk

      Adam Arcaro added 4 comments

      Patchset-level comments
      File-level comment, Patchset 5:
      Tarek Makkouk . resolved

      I was wonderring why are we opting to untie the URL from the ZSS? Couldn't we just keep it to ensure that we don't push stale ZSSs and just use the webstate to more accurately get the current URL?

      cc: @ada...@google.com @nicolas...@google.com

      Adam Arcaro

      The ZSS struct should always reflect the current web state, and we already track the current web state's URL in `current_url_`. The way I see it, there should not be a case where `current_url_` and `zero_state_suggestions_->url` are different (the ZSS should just be empty if they don't represent the same URL), and thus both variables feel redundant

      Tarek, please let me know if you see this differently. Thanks!

      Adam Arcaro

      Acknowledged

      File-level comment, Patchset 8 (Latest):
      Adam Arcaro . resolved

      2 minor comments, thanks

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 446, Patchset 8 (Latest): weak_ptr_factory_.InvalidateWeakPtrs();
      Adam Arcaro . unresolved

      We should reset `is_gemini_eligible_` to nullptr here since the previous eligibility decision is obsolete

      Line 774, Patchset 8 (Latest): bool eligible = ComputeGeminiEligibility(decision, metadata);
      Adam Arcaro . unresolved

      nit: We can remove the `eligible` local var since we always assign it to `is_gemini_eligible_` immediately

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      • Tarek Makkouk
      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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 8
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Tue, 20 Jan 2026 21:41:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Nicolas MacBeth (Gerrit)

      unread,
      Jan 20, 2026, 6:28:37 PM (19 hours ago) Jan 20
      to Francis Beauchamp, Tarek Makkouk, Chromium LUCI CQ, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Francis Beauchamp and Tarek Makkouk

      Nicolas MacBeth voted and added 3 comments

      Votes added by Nicolas MacBeth

      Code-Review+1

      3 comments

      Patchset-level comments
      File-level comment, Patchset 8 (Latest):
      Nicolas MacBeth . resolved

      lgtm % 2 nits and Adam's comments. thanks! this looks much cleaner

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
      Line 107, Patchset 8 (Latest): // Gets the state of Gemini eligibility for the tab.
      Nicolas MacBeth . unresolved

      nit: I would add the bit about why this is optional here too, since this is what's public to the class.

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 766, Patchset 8 (Latest): const GURL& url,
      Nicolas MacBeth . unresolved

      nit: `url_without_ref` here and in the header? just to be extra clear as to what's expected/passed

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Francis Beauchamp
      • Tarek Makkouk
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not 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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
      Gerrit-Change-Number: 7463403
      Gerrit-PatchSet: 8
      Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Attention: Francis Beauchamp <fbeau...@google.com>
      Gerrit-Comment-Date: Tue, 20 Jan 2026 23:28:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Francis Beauchamp (Gerrit)

      unread,
      10:08 AM (3 hours ago) 10:08 AM
      to Nicolas MacBeth, Tarek Makkouk, Chromium LUCI CQ, Adam Arcaro, chromium...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro

      Francis Beauchamp added 4 comments

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.h
      Line 107, Patchset 8: // Gets the state of Gemini eligibility for the tab.
      Nicolas MacBeth . resolved

      nit: I would add the bit about why this is optional here too, since this is what's public to the class.

      Francis Beauchamp

      Done

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper.mm
      Line 446, Patchset 8: weak_ptr_factory_.InvalidateWeakPtrs();
      Adam Arcaro . resolved

      We should reset `is_gemini_eligible_` to nullptr here since the previous eligibility decision is obsolete

      Francis Beauchamp

      Done

      Line 766, Patchset 8: const GURL& url,
      Nicolas MacBeth . resolved

      nit: `url_without_ref` here and in the header? just to be extra clear as to what's expected/passed

      Francis Beauchamp

      Done

      Line 774, Patchset 8: bool eligible = ComputeGeminiEligibility(decision, metadata);
      Adam Arcaro . resolved

      nit: We can remove the `eligible` local var since we always assign it to `is_gemini_eligible_` immediately

      Francis Beauchamp

      We use it in the `IsGeminiImageRemixToolEnabled` check and it gets assigned as a `bool` to `zero_state_suggestions_->can_apply`. I'm not convinced that it is meaningfully better to rely on an `std::optional` and be forced into unwrapping with `value_or` on these two occasions.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I236c9e11a7ddafeda277bcc7907965c1a5342bce
        Gerrit-Change-Number: 7463403
        Gerrit-PatchSet: 9
        Gerrit-Owner: Francis Beauchamp <fbeau...@google.com>
        Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
        Gerrit-Reviewer: Francis Beauchamp <fbeau...@google.com>
        Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
        Gerrit-CC: Tarek Makkouk <tarekm...@google.com>
        Gerrit-Attention: Adam Arcaro <ada...@google.com>
        Gerrit-Comment-Date: Wed, 21 Jan 2026 15:08:14 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages