[AF] Fill or preview cards from the omnibox delegate [chromium/src : main]

0 views
Skip to first unread message

Yishui Liu (Gerrit)

unread,
Jun 25, 2026, 4:14:46 PMJun 25
to Fernando Ramirez, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
Attention needed from Fernando Ramirez and Vinny Persky

Yishui Liu added 1 comment

Patchset-level comments
File-level comment, Patchset 15 (Latest):
Yishui Liu . resolved

Hello Fernando and Vinny,

Could you please take a look?

Thanks

Open in Gerrit

Related details

Attention is currently required from:
  • Fernando Ramirez
  • Vinny Persky
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: I1bd8560195851ddf47521e82eedae8ef3083170a
Gerrit-Change-Number: 7963980
Gerrit-PatchSet: 15
Gerrit-Owner: Yishui Liu <yis...@google.com>
Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
Gerrit-Reviewer: Yishui Liu <yis...@google.com>
Gerrit-Attention: Vinny Persky <vinny...@google.com>
Gerrit-Attention: Fernando Ramirez <fe...@google.com>
Gerrit-Comment-Date: Thu, 25 Jun 2026 20:14:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Fernando Ramirez (Gerrit)

unread,
Jun 26, 2026, 4:36:22 PMJun 26
to Yishui Liu, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
Attention needed from Vinny Persky and Yishui Liu

Fernando Ramirez voted and added 3 comments

Votes added by Fernando Ramirez

Code-Review+1

3 comments

Patchset-level comments
Fernando Ramirez . resolved

This looks great, thank you! Just left a clarifying question, I believe my understanding is correct, especially after looking at the new tests.

File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
Line 397, Patchset 15 (Latest):BrowserAutofillManager* OmniboxAutofillDelegate::GetManagerWithForm(
FormGlobalId form_id) {
for (AutofillDriver* driver :
client_->GetAutofillDriverFactory().GetExistingDrivers()) {
auto* manager =
static_cast<BrowserAutofillManager*>(&driver->GetAutofillManager());
if (manager->FindCachedFormById(form_id)) {
return manager;
}
}
return nullptr;
}
Fernando Ramirez . unresolved
So the previous check:
```
auto* manager = static_cast<BrowserAutofillManager*>(
client_->GetAutofillManagerForPrimaryMainFrame());
```
this would only work if the CC field was in the main frame, but would early return if it was in an iframe, for example?
If we use `GetManagerWithForm`, do we still need this in `OnGetIntersectionObserverInfo`:
```
const FormStructure* form =
manager->FindCachedFormById(trigger_form_global_id_);
if (!form) {
return;
}
```
We're already verifying that the manager has the form, so the `if (!form)` check isn't needed. Instead can we add `CHECK(manager->FindCachedFormById(trigger_form_global_id_))` here too?
Line 412, Patchset 15 (Latest): if (suggestion.type != SuggestionType::kCreditCardEntry &&
suggestion.type != SuggestionType::kVirtualCreditCardEntry) {
return;
}
Fernando Ramirez . unresolved

There shouldn't be any other suggestion types here since we make sure to only display credit card and virtual card suggestions on the omnibox autofill bubble: https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc;l=368-370;drc=5650b3485eaa8443ee812a44056a1b88b4ee0ce1

Can we add `CHECK()` here to assert that?

Open in Gerrit

Related details

Attention is currently required from:
  • Vinny Persky
  • Yishui Liu
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: I1bd8560195851ddf47521e82eedae8ef3083170a
    Gerrit-Change-Number: 7963980
    Gerrit-PatchSet: 15
    Gerrit-Owner: Yishui Liu <yis...@google.com>
    Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
    Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
    Gerrit-Reviewer: Yishui Liu <yis...@google.com>
    Gerrit-Attention: Vinny Persky <vinny...@google.com>
    Gerrit-Attention: Yishui Liu <yis...@google.com>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 20:36:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Vinny Persky (Gerrit)

    unread,
    Jul 1, 2026, 1:39:59 AMJul 1
    to Yishui Liu, Code Review Nudger, Fernando Ramirez, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
    Attention needed from Christoph Schwering and Yishui Liu

    Vinny Persky added 2 comments

    Patchset-level comments
    Vinny Persky . resolved

    Adding Chris as this is an area he has a lot of expertise in

    File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
    Line 440, Patchset 15 (Latest): const CreditCard* card_to_fill = credit_card;
    std::optional<CreditCard> virtual_card;
    if (action_persistence == mojom::ActionPersistence::kFill &&
    suggestion.type == SuggestionType::kVirtualCreditCardEntry) {
    virtual_card = CreditCard::CreateVirtualCard(*credit_card);
    card_to_fill = &*virtual_card;
    }

    manager->FillOrPreviewForm(action_persistence, trigger_form_global_id_,
    trigger_field_global_id_, card_to_fill,
    AutofillTriggerSource::kOmniboxAutofill,
    /*blocked_fields=*/{});
    Vinny Persky . unresolved

    It looks like a lot of this is handled in AutofillExternalDelegate::AutofillForm(). Is there a way we can re-use that?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    • Yishui Liu
    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: I1bd8560195851ddf47521e82eedae8ef3083170a
    Gerrit-Change-Number: 7963980
    Gerrit-PatchSet: 15
    Gerrit-Owner: Yishui Liu <yis...@google.com>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
    Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
    Gerrit-Reviewer: Yishui Liu <yis...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Yishui Liu <yis...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 01 Jul 2026 05:39:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Jul 1, 2026, 3:49:51 PMJul 1
    to Yishui Liu, Code Review Nudger, Fernando Ramirez, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
    Attention needed from Yishui Liu

    Christoph Schwering added 2 comments

    File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
    Line 397, Patchset 15 (Latest):BrowserAutofillManager* OmniboxAutofillDelegate::GetManagerWithForm(
    FormGlobalId form_id) {
    for (AutofillDriver* driver :
    client_->GetAutofillDriverFactory().GetExistingDrivers()) {
    auto* manager =
    static_cast<BrowserAutofillManager*>(&driver->GetAutofillManager());
    if (manager->FindCachedFormById(form_id)) {
    return manager;
    }
    }
    return nullptr;
    }
    Fernando Ramirez . unresolved
    So the previous check:
    ```
    auto* manager = static_cast<BrowserAutofillManager*>(
    client_->GetAutofillManagerForPrimaryMainFrame());
    ```
    this would only work if the CC field was in the main frame, but would early return if it was in an iframe, for example?
    If we use `GetManagerWithForm`, do we still need this in `OnGetIntersectionObserverInfo`:
    ```
    const FormStructure* form =
    manager->FindCachedFormById(trigger_form_global_id_);
    if (!form) {
    return;
    }
    ```
    We're already verifying that the manager has the form, so the `if (!form)` check isn't needed. Instead can we add `CHECK(manager->FindCachedFormById(trigger_form_global_id_))` here too?
    Christoph Schwering

    IIRC the whole omnibox mechanism was intended to only consider forms of the primary main frame's AutofillManager. Why do we need this change? I don't know what the consequences are.

    File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate_unittest.cc
    Line 30, Patchset 15 (Latest):AutofillDriverRouter* g_active_router = nullptr;
    Christoph Schwering . unresolved

    I don't know yet what the motivation is but accessing the router in here is probably wrong, and most likely there should be no global variables.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yishui Liu
    Gerrit-Comment-Date: Wed, 01 Jul 2026 19:49:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Fernando Ramirez <fe...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fernando Ramirez (Gerrit)

    unread,
    Jul 14, 2026, 7:54:45 PM (8 days ago) Jul 14
    to Yishui Liu, Code Review Nudger, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
    Attention needed from Yishui Liu

    Fernando Ramirez added 1 comment

    Commit Message
    Line 14, Patchset 22 (Latest):Bug: 490213796
    Fernando Ramirez . unresolved

    I believe this should be the last CL needed to complete this task. Can this instead be "Fixed"?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yishui Liu
    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: I1bd8560195851ddf47521e82eedae8ef3083170a
      Gerrit-Change-Number: 7963980
      Gerrit-PatchSet: 22
      Gerrit-Owner: Yishui Liu <yis...@google.com>
      Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
      Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
      Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
      Gerrit-Reviewer: Yishui Liu <yis...@google.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-Attention: Yishui Liu <yis...@google.com>
      Gerrit-Comment-Date: Tue, 14 Jul 2026 23:54:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fernando Ramirez (Gerrit)

      unread,
      Jul 21, 2026, 3:27:37 PM (yesterday) Jul 21
      to Yishui Liu, Code Review Nudger, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
      Attention needed from Christoph Schwering, Vinny Persky and Yishui Liu

      Fernando Ramirez added 5 comments

      Commit Message
      Line 14, Patchset 22:Bug: 490213796
      Fernando Ramirez . resolved

      I believe this should be the last CL needed to complete this task. Can this instead be "Fixed"?

      Fernando Ramirez

      Done

      File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
      Line 397, Patchset 15:BrowserAutofillManager* OmniboxAutofillDelegate::GetManagerWithForm(

      FormGlobalId form_id) {
      for (AutofillDriver* driver :
      client_->GetAutofillDriverFactory().GetExistingDrivers()) {
      auto* manager =
      static_cast<BrowserAutofillManager*>(&driver->GetAutofillManager());
      if (manager->FindCachedFormById(form_id)) {
      return manager;
      }
      }
      return nullptr;
      }
      Fernando Ramirez . resolved
      So the previous check:
      ```
      auto* manager = static_cast<BrowserAutofillManager*>(
      client_->GetAutofillManagerForPrimaryMainFrame());
      ```
      this would only work if the CC field was in the main frame, but would early return if it was in an iframe, for example?
      If we use `GetManagerWithForm`, do we still need this in `OnGetIntersectionObserverInfo`:
      ```
      const FormStructure* form =
      manager->FindCachedFormById(trigger_form_global_id_);
      if (!form) {
      return;
      }
      ```
      We're already verifying that the manager has the form, so the `if (!form)` check isn't needed. Instead can we add `CHECK(manager->FindCachedFormById(trigger_form_global_id_))` here too?
      Christoph Schwering

      IIRC the whole omnibox mechanism was intended to only consider forms of the primary main frame's AutofillManager. Why do we need this change? I don't know what the consequences are.

      Fernando Ramirez

      You're right, we can just use the primary main frame autofill manager to find the form.

      Line 412, Patchset 15: if (suggestion.type != SuggestionType::kCreditCardEntry &&

      suggestion.type != SuggestionType::kVirtualCreditCardEntry) {
      return;
      }
      Fernando Ramirez . resolved

      There shouldn't be any other suggestion types here since we make sure to only display credit card and virtual card suggestions on the omnibox autofill bubble: https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc;l=368-370;drc=5650b3485eaa8443ee812a44056a1b88b4ee0ce1

      Can we add `CHECK()` here to assert that?

      Fernando Ramirez

      Done

      Line 440, Patchset 15: const CreditCard* card_to_fill = credit_card;

      std::optional<CreditCard> virtual_card;
      if (action_persistence == mojom::ActionPersistence::kFill &&
      suggestion.type == SuggestionType::kVirtualCreditCardEntry) {
      virtual_card = CreditCard::CreateVirtualCard(*credit_card);
      card_to_fill = &*virtual_card;
      }

      manager->FillOrPreviewForm(action_persistence, trigger_form_global_id_,
      trigger_field_global_id_, card_to_fill,
      AutofillTriggerSource::kOmniboxAutofill,
      /*blocked_fields=*/{});
      Vinny Persky . resolved

      It looks like a lot of this is handled in AutofillExternalDelegate::AutofillForm(). Is there a way we can re-use that?

      Fernando Ramirez

      Good idea, Yishui created a helper function `FillOrPreviewCard` in `payments_util.h`.

      File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate_unittest.cc
      Line 30, Patchset 15:AutofillDriverRouter* g_active_router = nullptr;
      Christoph Schwering . resolved

      I don't know yet what the motivation is but accessing the router in here is probably wrong, and most likely there should be no global variables.

      Fernando Ramirez

      Thanks, Yishui removed the global variable.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Christoph Schwering
      • Vinny Persky
      • Yishui Liu
      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: I1bd8560195851ddf47521e82eedae8ef3083170a
        Gerrit-Change-Number: 7963980
        Gerrit-PatchSet: 23
        Gerrit-Owner: Yishui Liu <yis...@google.com>
        Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
        Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
        Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
        Gerrit-Reviewer: Yishui Liu <yis...@google.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-Attention: Vinny Persky <vinny...@google.com>
        Gerrit-Attention: Yishui Liu <yis...@google.com>
        Gerrit-Attention: Christoph Schwering <schw...@google.com>
        Gerrit-Comment-Date: Tue, 21 Jul 2026 19:27:24 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Vinny Persky <vinny...@google.com>
        Comment-In-Reply-To: Fernando Ramirez <fe...@google.com>
        Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Christoph Schwering (Gerrit)

        unread,
        1:08 PM (8 hours ago) 1:08 PM
        to Yishui Liu, Fernando Ramirez, Code Review Nudger, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
        Attention needed from Fernando Ramirez, Vinny Persky and Yishui Liu

        Christoph Schwering added 3 comments

        Patchset-level comments
        File-level comment, Patchset 23 (Latest):
        Christoph Schwering . resolved

        Could only take a partial look so far

        File components/autofill/core/browser/payments/payments_util.cc
        Line 92, Patchset 23 (Latest): std::optional<CreditCard> virtual_card;
        Christoph Schwering . unresolved

        You don't a need an `optional` because `CreditCard` has a default ctor, right?

        File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
        Line 505, Patchset 23 (Latest): auto* manager = static_cast<BrowserAutofillManager*>(
        client_->GetAutofillManagerForPrimaryMainFrame());
        Christoph Schwering . unresolved

        This isn't necessarily the right one, correct?
        It probably most often is the right one, so in practice it may work just fine.
        But a safer option could be to store the `manager.GetWeakPtr()` where you also remember the `trigger_{form,field}_global_id_`.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fernando Ramirez
        • Vinny Persky
        • Yishui Liu
        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: I1bd8560195851ddf47521e82eedae8ef3083170a
          Gerrit-Change-Number: 7963980
          Gerrit-PatchSet: 23
          Gerrit-Owner: Yishui Liu <yis...@google.com>
          Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
          Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
          Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
          Gerrit-Reviewer: Yishui Liu <yis...@google.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-Attention: Vinny Persky <vinny...@google.com>
          Gerrit-Attention: Yishui Liu <yis...@google.com>
          Gerrit-Attention: Fernando Ramirez <fe...@google.com>
          Gerrit-Comment-Date: Wed, 22 Jul 2026 17:08:15 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Fernando Ramirez (Gerrit)

          unread,
          3:50 PM (5 hours ago) 3:50 PM
          to Yishui Liu, Code Review Nudger, Vinny Persky, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
          Attention needed from Christoph Schwering, Vinny Persky and Yishui Liu

          Fernando Ramirez added 2 comments

          File components/autofill/core/browser/payments/payments_util.cc
          Line 92, Patchset 23: std::optional<CreditCard> virtual_card;
          Christoph Schwering . resolved

          You don't a need an `optional` because `CreditCard` has a default ctor, right?

          Fernando Ramirez

          Technically yes, `CreditCard` has a default ctor but using `std::optional` allows us to avoid allocating a virtual `CreditCard` when not needed.

          File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
          Line 505, Patchset 23: auto* manager = static_cast<BrowserAutofillManager*>(
          client_->GetAutofillManagerForPrimaryMainFrame());
          Christoph Schwering . resolved

          This isn't necessarily the right one, correct?
          It probably most often is the right one, so in practice it may work just fine.
          But a safer option could be to store the `manager.GetWeakPtr()` where you also remember the `trigger_{form,field}_global_id_`.

          Fernando Ramirez

          Good idea, this is a better approach. I've gone ahead and stored a `trigger_autofill_manager_` and replaced all calls to `GetAutofillManagerForPrimaryMainFrame` with it. I tested the build locally and everything worked as expected.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Christoph Schwering
          • Vinny Persky
          • Yishui Liu
          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: I1bd8560195851ddf47521e82eedae8ef3083170a
            Gerrit-Change-Number: 7963980
            Gerrit-PatchSet: 24
            Gerrit-Owner: Yishui Liu <yis...@google.com>
            Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
            Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
            Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
            Gerrit-Reviewer: Yishui Liu <yis...@google.com>
            Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
            Gerrit-Attention: Vinny Persky <vinny...@google.com>
            Gerrit-Attention: Yishui Liu <yis...@google.com>
            Gerrit-Attention: Christoph Schwering <schw...@google.com>
            Gerrit-Comment-Date: Wed, 22 Jul 2026 19:49:55 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Vinny Persky (Gerrit)

            unread,
            5:26 PM (4 hours ago) 5:26 PM
            to Yishui Liu, Fernando Ramirez, Code Review Nudger, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
            Attention needed from Christoph Schwering, Fernando Ramirez and Yishui Liu

            Vinny Persky voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Christoph Schwering
            • Fernando Ramirez
            • Yishui Liu
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I1bd8560195851ddf47521e82eedae8ef3083170a
              Gerrit-Change-Number: 7963980
              Gerrit-PatchSet: 24
              Gerrit-Owner: Yishui Liu <yis...@google.com>
              Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
              Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
              Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
              Gerrit-Reviewer: Yishui Liu <yis...@google.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-Attention: Yishui Liu <yis...@google.com>
              Gerrit-Attention: Fernando Ramirez <fe...@google.com>
              Gerrit-Attention: Christoph Schwering <schw...@google.com>
              Gerrit-Comment-Date: Wed, 22 Jul 2026 21:26:33 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Fernando Ramirez (Gerrit)

              unread,
              7:18 PM (2 hours ago) 7:18 PM
              to Yishui Liu, Vinny Persky, Code Review Nudger, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
              Attention needed from Christoph Schwering

              Fernando Ramirez added 1 comment

              File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
              Line 505, Patchset 23: auto* manager = static_cast<BrowserAutofillManager*>(
              client_->GetAutofillManagerForPrimaryMainFrame());
              Christoph Schwering . unresolved

              This isn't necessarily the right one, correct?
              It probably most often is the right one, so in practice it may work just fine.
              But a safer option could be to store the `manager.GetWeakPtr()` where you also remember the `trigger_{form,field}_global_id_`.

              Fernando Ramirez

              Good idea, this is a better approach. I've gone ahead and stored a `trigger_autofill_manager_` and replaced all calls to `GetAutofillManagerForPrimaryMainFrame` with it. I tested the build locally and everything worked as expected.

              Fernando Ramirez

              Re-opening this comment thread based on your last comment here: https://chromium-review.git.corp.google.com/c/chromium/src/+/8069095/comment/e8d19c9d_2456c4fd/

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Christoph Schwering
              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: I1bd8560195851ddf47521e82eedae8ef3083170a
                Gerrit-Change-Number: 7963980
                Gerrit-PatchSet: 24
                Gerrit-Owner: Yishui Liu <yis...@google.com>
                Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
                Gerrit-Reviewer: Fernando Ramirez <fe...@google.com>
                Gerrit-Reviewer: Vinny Persky <vinny...@google.com>
                Gerrit-Reviewer: Yishui Liu <yis...@google.com>
                Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
                Gerrit-Attention: Christoph Schwering <schw...@google.com>
                Gerrit-Comment-Date: Wed, 22 Jul 2026 23:18:05 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Fernando Ramirez (Gerrit)

                unread,
                7:28 PM (2 hours ago) 7:28 PM
                to Yishui Liu, Vinny Persky, Code Review Nudger, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, ios-r...@chromium.org, tmartino+tran...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, armalhotra+a...@google.com, browser-comp...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vinnypersky+...@google.com
                Attention needed from Christoph Schwering

                Fernando Ramirez added 1 comment

                File components/autofill/core/browser/ui/payments/omnibox_autofill_delegate.cc
                Line 505, Patchset 23: auto* manager = static_cast<BrowserAutofillManager*>(
                client_->GetAutofillManagerForPrimaryMainFrame());
                Christoph Schwering . unresolved

                This isn't necessarily the right one, correct?
                It probably most often is the right one, so in practice it may work just fine.
                But a safer option could be to store the `manager.GetWeakPtr()` where you also remember the `trigger_{form,field}_global_id_`.

                Fernando Ramirez

                Good idea, this is a better approach. I've gone ahead and stored a `trigger_autofill_manager_` and replaced all calls to `GetAutofillManagerForPrimaryMainFrame` with it. I tested the build locally and everything worked as expected.

                Fernando Ramirez

                Re-opening this comment thread based on your last comment here: https://chromium-review.git.corp.google.com/c/chromium/src/+/8069095/comment/e8d19c9d_2456c4fd/

                Fernando Ramirez

                Update: based on your other comment in https://chromium-review.git.corp.google.com/c/chromium/src/+/8109166/comment/63bc7454_3419a383/

                It looks like it's better to proceed with storing the `WeakPtr<AutofillManager>`.

                Gerrit-Comment-Date: Wed, 22 Jul 2026 23:28:06 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages