Add AIM sign-in promo rate limits [chromium/src : main]

0 views
Skip to first unread message

Anthi Orfanou (Gerrit)

unread,
Apr 8, 2026, 11:04:28 AM (5 days ago) Apr 8
to Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Ryan Sultanem

Anthi Orfanou voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ryan Sultanem
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 5
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Ryan Sultanem <rs...@google.com>
Gerrit-Comment-Date: Wed, 08 Apr 2026 15:04:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
Apr 8, 2026, 11:08:08 AM (5 days ago) Apr 8
to Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Amelie Schneider

Anthi Orfanou added 1 comment

File chrome/browser/signin/signin_promo_util.cc
Line 470, Patchset 5 (Latest): if (type == SignInPromoType::kSearchAIMode) {
Anthi Orfanou . unresolved

See also the previously raised topic in this CL: https://chromium-review.git.corp.google.com/c/chromium/src/+/7616929/comment/d3c5de16_98107f0a/

The new AIM promo should have it's own rate limits, independent of the other autofill promos (it is an entirely different flow).

Open in Gerrit

Related details

Attention is currently required from:
  • Amelie Schneider
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 5
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Amelie Schneider <ame...@google.com>
Gerrit-Comment-Date: Wed, 08 Apr 2026 15:07:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
Apr 8, 2026, 11:39:03 AM (5 days ago) Apr 8
to Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org

Anthi Orfanou added 1 comment

File chrome/browser/signin/signin_promo_unittest.cc
Line 436, Patchset 6 (Latest):TEST_F(ShowSigninPromoTestWithFeatureFlags,
Anthi Orfanou . unresolved

Maybe worth repeating/parametrizing the new test for the case of a know Gaia id?

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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 6
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Comment-Date: Wed, 08 Apr 2026 15:38:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Amelie Schneider (Gerrit)

unread,
Apr 8, 2026, 12:15:49 PM (5 days ago) Apr 8
to Anthi Orfanou, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Anthi Orfanou

Amelie Schneider added 9 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Amelie Schneider . resolved

Thanks Anthi!! Added a couple first commments :)

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper.cc
Line 310, Patchset 6 (Latest):
Amelie Schneider . unresolved

Do you think we need to check `ShouldShowSearchAIModeSignInPromo()` again here, or is the one in line 270 sufficient?

File chrome/browser/signin/signin_promo_unittest.cc
Line 436, Patchset 6 (Latest):TEST_F(ShowSigninPromoTestWithFeatureFlags,
Anthi Orfanou . resolved

Maybe worth repeating/parametrizing the new test for the case of a know Gaia id?

Amelie Schneider

I think it's fine since the gaia id functionality is tested in different places in this file.

File chrome/browser/signin/signin_promo_util.cc
Line 314, Patchset 6 (Latest): return (gap > base::Days(14));
Amelie Schneider . unresolved

This should be a constant like the ones in line 73

Line 579, Patchset 6 (Latest): // - has already been dismissed `kSigninPromoDismissedThreshold` times,
Amelie Schneider . unresolved

please add a comment as such for the frequency

Also, if you add the function in the utils which i suggested, then we can inverse these two return blocks so that the function can be used.

Line 697, Patchset 6 (Latest): } else {
Amelie Schneider . unresolved

unneccesary else?

File chrome/browser/ui/signin/promos/bubble_signin_promo_view.cc
Line 220, Patchset 5: if (!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment)) {
Amelie Schneider . unresolved

WDYT about creating a function in the signin_promo_util that checks what I think would be:

```
bool ShouldUseAutofillPromoLimits() {
return promo_type != signin::SignInPromoType::kSearchAIMode &&
!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment);
}
```

I think there are some places now where we could use it, so that you can add the code for AI mode to the switch statement.

File chrome/browser/ui/views/search_ai_mode/signin_promo_controller.cc
Line 31, Patchset 6 (Latest): if (promo_view_ || !browser_view || !web_contents_) {
return TriggerStatus::kPromoNotTriggered;
}
Amelie Schneider . unresolved

Are these (and the avatar button below) valid scenarios?

I feel like we don't really need the `Maybe` here (and therefore also no trigger status). `ShouldShowSearchAIModeSignInPromo()` is called before and does not need to be repeated. And then we can just show the promo (and include some safeguards if something goes really wrong as e.g. !browser_view or CHECK(browser_view)).

File components/signin/public/base/signin_prefs.h
Line 131, Patchset 6 (Latest): void IncrementSearchAIModeSigninPromoImpressionCount(const GaiaId& gaia_id);
int GetSearchAIModeSigninPromoImpressionCount(const GaiaId& gaia_id) const;
Amelie Schneider . unresolved

nit: the other types are ordered together by dismiss/impression, let's do the same here

Open in Gerrit

Related details

Attention is currently required from:
  • Anthi Orfanou
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 6
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Anthi Orfanou <ant...@google.com>
Gerrit-Comment-Date: Wed, 08 Apr 2026 16:15:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anthi Orfanou <ant...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
Apr 9, 2026, 8:48:50 AM (4 days ago) Apr 9
to Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Amelie Schneider

Anthi Orfanou added 9 comments

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper.cc
Line 310, Patchset 6:
Amelie Schneider . resolved

Do you think we need to check `ShouldShowSearchAIModeSignInPromo()` again here, or is the one in line 270 sufficient?

Anthi Orfanou

The check in line 270 is enough, this method will always run after that. Also the call in line 270 is a "nice to have" but not mandatory call for our functionality: the main advantage here is that it allows us to destruct the present web content observer.

But even without it, we do another call of `ShouldShowSearchAIModeSignInPromo` in `SearchAIModeSignInPromoController::MaybeShowPromo` so that the bubble will only appears if the rate limits allow it.

File chrome/browser/signin/signin_promo_util.cc
Line 314, Patchset 6: return (gap > base::Days(14));
Amelie Schneider . resolved

This should be a constant like the ones in line 73

Anthi Orfanou

I turned this into a feature param in case we want to experiment with it. I will also make manual testing easier (the testers can provide a custom value).

Line 470, Patchset 5: if (type == SignInPromoType::kSearchAIMode) {
Anthi Orfanou . resolved

See also the previously raised topic in this CL: https://chromium-review.git.corp.google.com/c/chromium/src/+/7616929/comment/d3c5de16_98107f0a/

The new AIM promo should have it's own rate limits, independent of the other autofill promos (it is an entirely different flow).

Anthi Orfanou

Acknowledged

Line 579, Patchset 6: // - has already been dismissed `kSigninPromoDismissedThreshold` times,
Amelie Schneider . unresolved

please add a comment as such for the frequency

Also, if you add the function in the utils which i suggested, then we can inverse these two return blocks so that the function can be used.

Anthi Orfanou

I updated the comment. However I cannot find the comment where you suggest moving the frequency to a utility/helper. Could you point me to what you suggest moving?

Line 697, Patchset 6: } else {
Amelie Schneider . resolved

unneccesary else?

Anthi Orfanou

Done

File chrome/browser/ui/signin/promos/bubble_signin_promo_view.cc
Line 220, Patchset 5: if (!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment)) {
Amelie Schneider . resolved

WDYT about creating a function in the signin_promo_util that checks what I think would be:

```
bool ShouldUseAutofillPromoLimits() {
return promo_type != signin::SignInPromoType::kSearchAIMode &&
!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment);
}
```

I think there are some places now where we could use it, so that you can add the code for AI mode to the switch statement.

Anthi Orfanou

Done

File chrome/browser/ui/views/search_ai_mode/signin_promo_controller.h
Line 29, Patchset 4: // Attempts to triggers the promo subject to its rate limits and other
Anthi Orfanou . resolved

typo

Anthi Orfanou

Done

File chrome/browser/ui/views/search_ai_mode/signin_promo_controller.cc
Line 31, Patchset 6: if (promo_view_ || !browser_view || !web_contents_) {
return TriggerStatus::kPromoNotTriggered;
}
Amelie Schneider . unresolved

Are these (and the avatar button below) valid scenarios?

I feel like we don't really need the `Maybe` here (and therefore also no trigger status). `ShouldShowSearchAIModeSignInPromo()` is called before and does not need to be repeated. And then we can just show the promo (and include some safeguards if something goes really wrong as e.g. !browser_view or CHECK(browser_view)).

Anthi Orfanou

You are right about the early exits, I think all these conditions should be CHECKs instead. I have changed them now (and of the browser_view the caller ensure it exists in any case).

However for the the need to call ShouldShowSearchAIModeSignInPromo I think the controller is the right entity ensure that this condition is met before showing the promo.
If not in the form of a conditional, we should at least have a check (and leave it to the caller to ensure this).

Right now the caller (aim_tab_helper) indeed calls this this method, but the reason is that in that case it can self destruct.

File components/signin/public/base/signin_prefs.h
Line 131, Patchset 6: void IncrementSearchAIModeSigninPromoImpressionCount(const GaiaId& gaia_id);

int GetSearchAIModeSigninPromoImpressionCount(const GaiaId& gaia_id) const;
Amelie Schneider . resolved

nit: the other types are ordered together by dismiss/impression, let's do the same here

Anthi Orfanou

Done, If understood correctly you comment you want to move the impression count methods together with the impressions-related methods above.

Open in Gerrit

Related details

Attention is currently required from:
  • Amelie Schneider
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 8
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Amelie Schneider <ame...@google.com>
Gerrit-Comment-Date: Thu, 09 Apr 2026 12:48:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Amelie Schneider <ame...@google.com>
Comment-In-Reply-To: Anthi Orfanou <ant...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
Apr 9, 2026, 2:50:22 PM (4 days ago) Apr 9
to AyeAye, Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org

New activity on the change

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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 14
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Comment-Date: Thu, 09 Apr 2026 18:50:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Amelie Schneider (Gerrit)

unread,
Apr 10, 2026, 6:26:29 AM (3 days ago) Apr 10
to Anthi Orfanou, android-bu...@system.gserviceaccount.com, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Anthi Orfanou

Amelie Schneider added 13 comments

Patchset-level comments
File-level comment, Patchset 8:
Amelie Schneider . resolved

Thanks!! 😊

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper_browsertest.cc
Line 224, Patchset 8: EXPECT_FALSE(SearchAiModePromoTabHelper::FromWebContents(new_contents));
Amelie Schneider . unresolved

Can we reuse the `helper` here?

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper_interactive_uitest.cc
Line 10, Patchset 8:#include "base/test/metrics/histogram_tester.h"
Amelie Schneider . unresolved

please remove

File chrome/browser/signin/signin_promo_unittest.cc
Line 458, Patchset 8:
Amelie Schneider . unresolved

I think tests checking that AI mode is unaffacted by the signinpromolimits experiment flag could also be useful

File chrome/browser/signin/signin_promo_util.cc
Line 300, Patchset 8: // For the Search AI Mode there should be a 14 day gap between impressions.
Amelie Schneider . unresolved

Please update this comment to mention the variable rather than the time so that it does not become out of date when the frequency is changed.

Line 471, Patchset 8: if (type == SignInPromoType::kSearchAIMode) {
return profile.GetPrefs()->GetInteger(
prefs::kSearchAIModeSignInPromoDismissCountPerProfile);

}
if (!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment)) {
return profile.GetPrefs()->GetInteger(
prefs::kAutofillSignInPromoDismissCountPerProfile);
}
Amelie Schneider . unresolved

Same as the comment below, let's use `ShouldUseAutofillPromoLimits()` and put the ai mode into the switch

Line 499, Patchset 8:int GetContextualPromoDismissCountPerAccount(Profile& profile,
SignInPromoType type,
const GaiaId& gaia_id) {

if (type == SignInPromoType::kSearchAIMode) {
return SigninPrefs(*profile.GetPrefs())
.GetSearchAIModeSigninPromoDismissCount(gaia_id);

}
if (!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment)) {
return SigninPrefs(*profile.GetPrefs())
.GetAutofillSigninPromoDismissCount(gaia_id);
}

switch (type) {
case SignInPromoType::kAddress:
return SigninPrefs(*profile.GetPrefs())
.GetAddressSigninPromoDismissCount(gaia_id);
case SignInPromoType::kPassword:
return SigninPrefs(*profile.GetPrefs())
.GetPasswordSigninPromoDismissCount(gaia_id);
case SignInPromoType::kSearchAIMode:
// Search AI Mode promo's rate limits are independent from the
// `kSigninPromoLimitsExperiment` flag.
NOTREACHED();
case SignInPromoType::kBookmark:
return SigninPrefs(*profile.GetPrefs())
.GetBookmarkSigninPromoDismissCount(gaia_id);
case SignInPromoType::kExtension:
NOTREACHED();
}
}
Amelie Schneider . unresolved

Can we do instead:

```
int GetContextualPromoDismissCountPerAccount(Profile& profile,
SignInPromoType type,
const GaiaId& gaia_id) {
if (ShouldUseAutofillPromoLimits()) {
return SigninPrefs(*profile.GetPrefs())
.GetAutofillSigninPromoDismissCount(gaia_id);
}
  switch (type) {
case SignInPromoType::kAddress:
return SigninPrefs(*profile.GetPrefs())
.GetAddressSigninPromoDismissCount(gaia_id);
case SignInPromoType::kPassword:
return SigninPrefs(*profile.GetPrefs())
.GetPasswordSigninPromoDismissCount(gaia_id);
case SignInPromoType::kSearchAIMode:
return SigninPrefs(*profile.GetPrefs())
.GetSearchAIModeSigninPromoDismissCount(gaia_id);
case SignInPromoType::kBookmark:
return SigninPrefs(*profile.GetPrefs())
.GetBookmarkSigninPromoDismissCount(gaia_id);
case SignInPromoType::kExtension:
NOTREACHED();
}
}
```
Line 576, Patchset 8: // Don't show the promo again if i:
Amelie Schneider . unresolved

typo

Line 579, Patchset 6: // - has already been dismissed `kSigninPromoDismissedThreshold` times,
Amelie Schneider . resolved

please add a comment as such for the frequency

Also, if you add the function in the utils which i suggested, then we can inverse these two return blocks so that the function can be used.

Anthi Orfanou

I updated the comment. However I cannot find the comment where you suggest moving the frequency to a utility/helper. Could you point me to what you suggest moving?

Amelie Schneider

Hmm I was going to suggest to use `ShouldUseAutofillPromoLimits` but I don't think it actually works because the conditions are not the same. Let's leave it as is.

Line 674, Patchset 8:// Needs additional checks depending on the type of the promo (see
// `ShouldShowAddressSignInPromo` and `ShouldShowPasswordSignInPromo`).
Amelie Schneider . unresolved

This is out of date, let's remove

Line 677, Patchset 8:bool ShouldShowSignInPromoCommon(Profile& profile, SignInPromoType type) {
Amelie Schneider . unresolved

What about the checks for ShouldShowSyncPromo and sync_service above? Why are these not needed for AI mode?

edit: Upon checking I saw this CL might be out of date with https://chromium-review.git.corp.google.com/c/chromium/src/+/7695174 . Can you please update?

Line 697, Patchset 8: if (type == SignInPromoType::kSearchAIMode) {
Amelie Schneider . unresolved

Why is it not always shown in pending mode? Is this a product requirement?

File chrome/browser/ui/views/search_ai_mode/signin_promo_controller.cc
Line 31, Patchset 6: if (promo_view_ || !browser_view || !web_contents_) {
return TriggerStatus::kPromoNotTriggered;
}
Amelie Schneider . unresolved

Are these (and the avatar button below) valid scenarios?

I feel like we don't really need the `Maybe` here (and therefore also no trigger status). `ShouldShowSearchAIModeSignInPromo()` is called before and does not need to be repeated. And then we can just show the promo (and include some safeguards if something goes really wrong as e.g. !browser_view or CHECK(browser_view)).

Anthi Orfanou

You are right about the early exits, I think all these conditions should be CHECKs instead. I have changed them now (and of the browser_view the caller ensure it exists in any case).

However for the the need to call ShouldShowSearchAIModeSignInPromo I think the controller is the right entity ensure that this condition is met before showing the promo.
If not in the form of a conditional, we should at least have a check (and leave it to the caller to ensure this).

Right now the caller (aim_tab_helper) indeed calls this this method, but the reason is that in that case it can self destruct.

Amelie Schneider

I see your point. I think it's true it makes sense that the controller would decide about the promo showing. I was a bit confused why there are two instances (helper, controller) that both hold conditions for the promo. Why is the check in `DidFinishNavigation()` needed?

If we keep the retur in this function, then let's add the `Maybe` to the function name again!

Open in Gerrit

Related details

Attention is currently required from:
  • Anthi Orfanou
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 8
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Anthi Orfanou <ant...@google.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 10:26:16 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Amelie Schneider (Gerrit)

unread,
Apr 10, 2026, 6:28:08 AM (3 days ago) Apr 10
to Anthi Orfanou, android-bu...@system.gserviceaccount.com, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Anthi Orfanou

Amelie Schneider added 1 comment

Patchset-level comments
File-level comment, Patchset 15 (Latest):
Amelie Schneider . resolved

Oh sorry I just realized I was reviewing on an older patch! I will go over it again

Open in Gerrit

Related details

Attention is currently required from:
  • Anthi Orfanou
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 15
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Anthi Orfanou <ant...@google.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 10:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Amelie Schneider (Gerrit)

unread,
Apr 10, 2026, 6:34:52 AM (3 days ago) Apr 10
to Anthi Orfanou, android-bu...@system.gserviceaccount.com, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Anthi Orfanou

Amelie Schneider added 6 comments

File chrome/browser/signin/BUILD.gn
Line 27, Patchset 15 (Latest): "//chrome/browser/signin:signin_promo",
Amelie Schneider . unresolved

why is this needed?

File chrome/browser/signin/signin_promo_util.cc
Line 471, Patchset 8: if (type == SignInPromoType::kSearchAIMode) {
return profile.GetPrefs()->GetInteger(
prefs::kSearchAIModeSignInPromoDismissCountPerProfile);
}
if (!base::FeatureList::IsEnabled(switches::kSigninPromoLimitsExperiment)) {
return profile.GetPrefs()->GetInteger(
prefs::kAutofillSignInPromoDismissCountPerProfile);
}
Amelie Schneider . resolved

Same as the comment below, let's use `ShouldUseAutofillPromoLimits()` and put the ai mode into the switch

Amelie Schneider

Done

Amelie Schneider . resolved

Can we do instead:

```
int GetContextualPromoDismissCountPerAccount(Profile& profile,
SignInPromoType type,
const GaiaId& gaia_id) {
if (ShouldUseAutofillPromoLimits()) {
return SigninPrefs(*profile.GetPrefs())
.GetAutofillSigninPromoDismissCount(gaia_id);
}
  switch (type) {
case SignInPromoType::kAddress:
return SigninPrefs(*profile.GetPrefs())
.GetAddressSigninPromoDismissCount(gaia_id);
case SignInPromoType::kPassword:
return SigninPrefs(*profile.GetPrefs())
.GetPasswordSigninPromoDismissCount(gaia_id);
case SignInPromoType::kSearchAIMode:
return SigninPrefs(*profile.GetPrefs())
.GetSearchAIModeSigninPromoDismissCount(gaia_id);
case SignInPromoType::kBookmark:
return SigninPrefs(*profile.GetPrefs())
.GetBookmarkSigninPromoDismissCount(gaia_id);
case SignInPromoType::kExtension:
NOTREACHED();
}
}
```
Amelie Schneider

Done

Line 576, Patchset 8: // Don't show the promo again if i:
Amelie Schneider . resolved

typo

Amelie Schneider

Done

Line 677, Patchset 8:bool ShouldShowSignInPromoCommon(Profile& profile, SignInPromoType type) {
Amelie Schneider . unresolved

What about the checks for ShouldShowSyncPromo and sync_service above? Why are these not needed for AI mode?

edit: Upon checking I saw this CL might be out of date with https://chromium-review.git.corp.google.com/c/chromium/src/+/7695174 . Can you please update?

Amelie Schneider

Maybe just the check for sync service, not sure if it's needed?

Line 697, Patchset 8: if (type == SignInPromoType::kSearchAIMode) {
Amelie Schneider . resolved

Why is it not always shown in pending mode? Is this a product requirement?

Amelie Schneider

Done

Gerrit-Comment-Date: Fri, 10 Apr 2026 10:34:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Amelie Schneider <ame...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
Apr 10, 2026, 9:15:15 AM (3 days ago) Apr 10
to android-bu...@system.gserviceaccount.com, Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Amelie Schneider

Anthi Orfanou added 9 comments

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper_browsertest.cc
Line 224, Patchset 8: EXPECT_FALSE(SearchAiModePromoTabHelper::FromWebContents(new_contents));
Amelie Schneider . resolved

Can we reuse the `helper` here?

Anthi Orfanou

No, I think it will be a a dangling pointer at this point (it's a raw pointer), so we have to invoke the method again. This is similar to the test above.

File chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper_interactive_uitest.cc
Line 10, Patchset 8:#include "base/test/metrics/histogram_tester.h"
Amelie Schneider . resolved

please remove

Anthi Orfanou

Kept it, because histograms are now consumed in these tests (after rebasing).

File chrome/browser/signin/BUILD.gn
Line 27, Patchset 15: "//chrome/browser/signin:signin_promo",
Amelie Schneider . resolved

why is this needed?

Anthi Orfanou
It's because of the inclusion of the #include "chrome/browser/signin/signin_promo.h"
in signin_promo_util.h (o/w the build fails: https://ci.chromium.org/ui/p/chromium/builders/try/linux-libfuzzer-asan-rel/2646155/overview)
File chrome/browser/signin/signin_promo_unittest.cc
Line 458, Patchset 8:
Amelie Schneider . resolved

I think tests checking that AI mode is unaffacted by the signinpromolimits experiment flag could also be useful

Anthi Orfanou

Done

File chrome/browser/signin/signin_promo_util.cc
Line 300, Patchset 8: // For the Search AI Mode there should be a 14 day gap between impressions.
Amelie Schneider . resolved

Please update this comment to mention the variable rather than the time so that it does not become out of date when the frequency is changed.

Anthi Orfanou

Done

Line 579, Patchset 6: // - has already been dismissed `kSigninPromoDismissedThreshold` times,
Amelie Schneider . resolved

please add a comment as such for the frequency

Also, if you add the function in the utils which i suggested, then we can inverse these two return blocks so that the function can be used.

Anthi Orfanou

I updated the comment. However I cannot find the comment where you suggest moving the frequency to a utility/helper. Could you point me to what you suggest moving?

Amelie Schneider

Hmm I was going to suggest to use `ShouldUseAutofillPromoLimits` but I don't think it actually works because the conditions are not the same. Let's leave it as is.

Anthi Orfanou

Yes, it's a different condition here (I also got confused and got this wrong in one PS).

Line 674, Patchset 8:// Needs additional checks depending on the type of the promo (see
// `ShouldShowAddressSignInPromo` and `ShouldShowPasswordSignInPromo`).
Amelie Schneider . resolved

This is out of date, let's remove

Anthi Orfanou

Done

Line 677, Patchset 8:bool ShouldShowSignInPromoCommon(Profile& profile, SignInPromoType type) {
Amelie Schneider . unresolved

What about the checks for ShouldShowSyncPromo and sync_service above? Why are these not needed for AI mode?

edit: Upon checking I saw this CL might be out of date with https://chromium-review.git.corp.google.com/c/chromium/src/+/7695174 . Can you please update?

Amelie Schneider

Maybe just the check for sync service, not sure if it's needed?

Anthi Orfanou

I think this comment is outdated and has been addressed in the latest PS.

File chrome/browser/ui/views/search_ai_mode/signin_promo_controller.cc
Line 31, Patchset 6: if (promo_view_ || !browser_view || !web_contents_) {
return TriggerStatus::kPromoNotTriggered;
}
Amelie Schneider . resolved

Are these (and the avatar button below) valid scenarios?

I feel like we don't really need the `Maybe` here (and therefore also no trigger status). `ShouldShowSearchAIModeSignInPromo()` is called before and does not need to be repeated. And then we can just show the promo (and include some safeguards if something goes really wrong as e.g. !browser_view or CHECK(browser_view)).

Anthi Orfanou

You are right about the early exits, I think all these conditions should be CHECKs instead. I have changed them now (and of the browser_view the caller ensure it exists in any case).

However for the the need to call ShouldShowSearchAIModeSignInPromo I think the controller is the right entity ensure that this condition is met before showing the promo.
If not in the form of a conditional, we should at least have a check (and leave it to the caller to ensure this).

Right now the caller (aim_tab_helper) indeed calls this this method, but the reason is that in that case it can self destruct.

Amelie Schneider

I see your point. I think it's true it makes sense that the controller would decide about the promo showing. I was a bit confused why there are two instances (helper, controller) that both hold conditions for the promo. Why is the check in `DidFinishNavigation()` needed?

If we keep the retur in this function, then let's add the `Maybe` to the function name again!

Anthi Orfanou

Restored the name to `Maybe*` and added some comments in the call on the tab_helper (relevant to this comment: https://chromium-review.git.corp.google.com/c/chromium/src/+/7736186/comment/41eb60e6_82e1d9e8/).

I think I might be also to avoid the helper call in the future if we land one upcoming CL (https://chromium-review.git.corp.google.com/c/chromium/src/+/7736189/5): the plan is to pass a callback to destruct the calle to the MaybeShowPromo method. It will be then used when 1) the promo cannot be shown or when 2) the promo is shown but the user closes it.

Open in Gerrit

Related details

Attention is currently required from:
  • Amelie Schneider
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 16
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Amelie Schneider <ame...@google.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 13:14:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Amelie Schneider <ame...@google.com>
Comment-In-Reply-To: Anthi Orfanou <ant...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anthi Orfanou (Gerrit)

unread,
6:38 AM (2 hours ago) 6:38 AM
to David Roger, android-bu...@system.gserviceaccount.com, Amelie Schneider, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Amelie Schneider and David Roger

Anthi Orfanou added 1 comment

Patchset-level comments
File-level comment, Patchset 19 (Latest):
Anthi Orfanou . resolved

+David for the comp/s/p/b/prefs and switches owner's review.

Open in Gerrit

Related details

Attention is currently required from:
  • Amelie Schneider
  • David Roger
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
Gerrit-Change-Number: 7736186
Gerrit-PatchSet: 19
Gerrit-Owner: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
Gerrit-Reviewer: David Roger <dro...@chromium.org>
Gerrit-Attention: David Roger <dro...@chromium.org>
Gerrit-Attention: Amelie Schneider <ame...@google.com>
Gerrit-Comment-Date: Mon, 13 Apr 2026 10:38:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Amelie Schneider (Gerrit)

unread,
8:01 AM (20 minutes ago) 8:01 AM
to Anthi Orfanou, David Roger, android-bu...@system.gserviceaccount.com, Ryan Sultanem, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
Attention needed from Anthi Orfanou and David Roger

Amelie Schneider voted and added 5 comments

Votes added by Amelie Schneider

Code-Review+1

5 comments

Patchset-level comments
Amelie Schneider . resolved

Thanks Anthi!

File chrome/browser/signin/signin_promo_unittest.cc
Line 1065, Patchset 19 (Latest): ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
Amelie Schneider . unresolved

assert_false that another promo is shown? so that we see the difference between the two

Line 1076, Patchset 19 (Latest): prefs::kSearchAIModeSignInPromoShownCountPerProfile, 0);
Amelie Schneider . unresolved

Maybe assert_true here again to make sure it is due to the dismiss count that the promo is not shown

File chrome/browser/signin/signin_promo_util.cc
Line 677, Patchset 8:bool ShouldShowSignInPromoCommon(Profile& profile, SignInPromoType type) {
Amelie Schneider . resolved

What about the checks for ShouldShowSyncPromo and sync_service above? Why are these not needed for AI mode?

edit: Upon checking I saw this CL might be out of date with https://chromium-review.git.corp.google.com/c/chromium/src/+/7695174 . Can you please update?

Amelie Schneider

Maybe just the check for sync service, not sure if it's needed?

Anthi Orfanou

I think this comment is outdated and has been addressed in the latest PS.

Amelie Schneider

Acknowledged

Line 738, Patchset 19 (Latest): NOTREACHED();
Amelie Schneider . unresolved

optional nit: I think `return false;` is fine here, as we do for other promo types

Open in Gerrit

Related details

Attention is currently required from:
  • Anthi Orfanou
  • David Roger
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: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
    Gerrit-Change-Number: 7736186
    Gerrit-PatchSet: 19
    Gerrit-Owner: Anthi Orfanou <ant...@google.com>
    Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
    Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
    Gerrit-Reviewer: David Roger <dro...@chromium.org>
    Gerrit-Attention: David Roger <dro...@chromium.org>
    Gerrit-Attention: Anthi Orfanou <ant...@google.com>
    Gerrit-Comment-Date: Mon, 13 Apr 2026 12:01:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Roger (Gerrit)

    unread,
    8:10 AM (11 minutes ago) 8:10 AM
    to Anthi Orfanou, Amelie Schneider, android-bu...@system.gserviceaccount.com, Ryan Sultanem, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org
    Attention needed from Anthi Orfanou

    David Roger voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anthi Orfanou
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
    Gerrit-Change-Number: 7736186
    Gerrit-PatchSet: 19
    Gerrit-Owner: Anthi Orfanou <ant...@google.com>
    Gerrit-Reviewer: Amelie Schneider <ame...@google.com>
    Gerrit-Reviewer: Anthi Orfanou <ant...@google.com>
    Gerrit-Reviewer: David Roger <dro...@chromium.org>
    Gerrit-CC: Ryan Sultanem <rs...@google.com>
    Gerrit-Attention: Anthi Orfanou <ant...@google.com>
    Gerrit-Comment-Date: Mon, 13 Apr 2026 12:10:39 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages