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

0 views
Skip to first unread message

Anthi Orfanou (Gerrit)

unread,
Apr 9, 2026, 2:50:22 PM (8 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:30 AM (7 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
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

Amelie Schneider (Gerrit)

unread,
Apr 10, 2026, 6:28:08 AM (7 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:51 AM (7 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:14 AM (7 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,
Apr 13, 2026, 6:38:17 AM (4 days ago) Apr 13
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,
Apr 13, 2026, 8:01:23 AM (4 days ago) Apr 13
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,
    Apr 13, 2026, 8:10:54 AM (4 days ago) Apr 13
    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

    Anthi Orfanou (Gerrit)

    unread,
    Apr 13, 2026, 11:24:59 AM (4 days ago) Apr 13
    to David Roger, 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

    Anthi Orfanou added 3 comments

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

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

    Anthi Orfanou

    Did you mean assert true that another promo is shown after we set the limit preferences? If yes, I have added that.
    If you meant something else, please let me know. At the start of the test all promos should show fine (because we have not written yet an impression/dismissals).

    Line 1076, Patchset 19: prefs::kSearchAIModeSignInPromoShownCountPerProfile, 0);
    Amelie Schneider . resolved

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

    Anthi Orfanou

    Done

    File chrome/browser/signin/signin_promo_util.cc
    Line 738, Patchset 19: NOTREACHED();
    Amelie Schneider . resolved

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

    Anthi Orfanou

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
      Gerrit-Change-Number: 7736186
      Gerrit-PatchSet: 20
      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-Comment-Date: Mon, 13 Apr 2026 15:24:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Amelie Schneider <ame...@google.com>
      satisfied_requirement
      open
      diffy

      Amelie Schneider (Gerrit)

      unread,
      Apr 13, 2026, 11:27:56 AM (4 days ago) Apr 13
      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

      Amelie Schneider voted and added 1 comment

      Votes added by Amelie Schneider

      Code-Review+1

      1 comment

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

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

      Anthi Orfanou

      Did you mean assert true that another promo is shown after we set the limit preferences? If yes, I have added that.
      If you meant something else, please let me know. At the start of the test all promos should show fine (because we have not written yet an impression/dismissals).

      Amelie Schneider

      I meant that through the title I would assume that this tests that the limit that applies to other promos does not affect the search AI mode promo. Now it seems like we are more testing the AI promo limits and that it doesn't affect other promos

      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: 20
        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 15:27:43 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Anthi Orfanou (Gerrit)

        unread,
        Apr 13, 2026, 11:52:55 AM (4 days ago) Apr 13
        to David Roger, 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

        Anthi Orfanou added 1 comment

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

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

        Anthi Orfanou

        Did you mean assert true that another promo is shown after we set the limit preferences? If yes, I have added that.
        If you meant something else, please let me know. At the start of the test all promos should show fine (because we have not written yet an impression/dismissals).

        Amelie Schneider

        I meant that through the title I would assume that this tests that the limit that applies to other promos does not affect the search AI mode promo. Now it seems like we are more testing the AI promo limits and that it doesn't affect other promos

        Anthi Orfanou

        This is a good argument for splitting into two tests.

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
          Gerrit-Change-Number: 7736186
          Gerrit-PatchSet: 22
          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-Comment-Date: Mon, 13 Apr 2026 15:52:42 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Amelie Schneider (Gerrit)

          unread,
          Apr 14, 2026, 4:27:31 AM (3 days ago) Apr 14
          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

          Amelie Schneider voted and added 2 comments

          Votes added by Amelie Schneider

          Code-Review+1

          2 comments

          File chrome/browser/signin/signin_promo_unittest.cc
          Line 1059, Patchset 22 (Latest): SearchAIModePromoIgnoresOtherExperimentThresholds) {
          Amelie Schneider . unresolved

          I think this is not testing the other prefs, and more repeating above tests?
          I meant something like

          ```
          ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
          ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
            profile()->GetPrefs()->SetInteger(
          prefs::kAutofillSignInPromoDismissCountPerProfile, 5);

          ASSERT_FALSE(ShouldShowBookmarkSignInPromo(*profile()));
          EXPECT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
          ```
          Line 1089, Patchset 22 (Latest): SearchAIModePromoLimitsDoNotAffectOtherPromos) {
          Amelie Schneider . unresolved

          How about:

          ```
          ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
          ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
            profile()->GetPrefs()->SetInteger(
          prefs::kSearchAIModeSignInPromoShownCountPerProfile, 5);
            ASSERT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
          EXPECT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
          ```
          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: 22
            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: Tue, 14 Apr 2026 08:27:18 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Anthi Orfanou (Gerrit)

            unread,
            Apr 15, 2026, 11:07:15 AM (2 days ago) Apr 15
            to David Roger, 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

            Anthi Orfanou added 2 comments

            File chrome/browser/signin/signin_promo_unittest.cc
            Line 1059, Patchset 22: SearchAIModePromoIgnoresOtherExperimentThresholds) {
            Amelie Schneider . resolved

            I think this is not testing the other prefs, and more repeating above tests?
            I meant something like

            ```
            ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
            ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
              profile()->GetPrefs()->SetInteger(
            prefs::kAutofillSignInPromoDismissCountPerProfile, 5);

            ASSERT_FALSE(ShouldShowBookmarkSignInPromo(*profile()));
            EXPECT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
            ```
            Anthi Orfanou

            Done, sorry for the multiple rounds of feedback on this test!

            Line 1089, Patchset 22: SearchAIModePromoLimitsDoNotAffectOtherPromos) {
            Amelie Schneider . resolved

            How about:

            ```
            ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
            ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
              profile()->GetPrefs()->SetInteger(
            prefs::kSearchAIModeSignInPromoShownCountPerProfile, 5);
              ASSERT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
            EXPECT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
            ```
            Anthi Orfanou

            Done

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
              Gerrit-Change-Number: 7736186
              Gerrit-PatchSet: 24
              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-Comment-Date: Wed, 15 Apr 2026 15:06:58 +0000
              satisfied_requirement
              open
              diffy

              Anthi Orfanou (Gerrit)

              unread,
              Apr 15, 2026, 11:08:35 AM (2 days ago) Apr 15
              to David Roger, 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

              Anthi Orfanou voted Commit-Queue+2

              Commit-Queue+2
              Open in Gerrit

              Related details

              Attention set is empty
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
              Gerrit-Change-Number: 7736186
              Gerrit-PatchSet: 24
              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-Comment-Date: Wed, 15 Apr 2026 15:08:08 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              chromium-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

              unread,
              Apr 15, 2026, 12:23:09 PM (2 days ago) Apr 15
              to Anthi Orfanou, David Roger, Amelie Schneider, android-bu...@system.gserviceaccount.com, Ryan Sultanem, chromium...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org

              chromiu...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

              Unreviewed changes

              22 is the latest approved patch-set.
              The change was submitted with unreviewed changes in the following files:

              ```
              The name of the file: chrome/browser/signin/signin_promo_unittest.cc
              Insertions: 14, Deletions: 30.

              @@ -1054,59 +1054,43 @@
              EXPECT_FALSE(ShouldShowBookmarkSignInPromo(*profile()));
              }

              -
              TEST_F(ShowSigninPromoTestWithFeatureFlagsPromoLimitsExperiment,
              SearchAIModePromoIgnoresOtherExperimentThresholds) {
              - base::test::ScopedFeatureList features;
              - // Enable the experiment with thresholds lower than the default AI limits.
              - features.InitAndEnableFeatureWithParameters(
              - switches::kSigninPromoLimitsExperiment,
              - {{"contextual_signin_promo_shown_threshold", "2"},
              - {"contextual_signin_promo_dismissed_threshold", "1"}});
              -
              - // Default AI limits are 5 impressions and 2 dismissals.
              ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
              + ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));

              - // Set the AI mode promo to have been shown 3 times.
              - // This is above the experiment threshold (2) but below the AI threshold (5).
              + // Set the bookmark promo shown limit to max (6 times).
              profile()->GetPrefs()->SetInteger(
              - prefs::kSearchAIModeSignInPromoShownCountPerProfile, 3);
              + prefs::kBookmarkSignInPromoShownCountPerProfileForLimitsExperiment, 6);
              + EXPECT_FALSE(ShouldShowBookmarkSignInPromo(*profile()));
              EXPECT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));

              - // Set the AI mode promo to have been dismissed 1 time.
              - // The promo is shown as we are below the AI threshold (2).
              + // Set the bookmark promo impression and dismissal limit to max (2 times).
              profile()->GetPrefs()->SetInteger(
              - prefs::kSearchAIModeSignInPromoDismissCountPerProfile, 1);
              + prefs::kBookmarkSignInPromoShownCountPerProfileForLimitsExperiment, 2);
              + profile()->GetPrefs()->SetInteger(
              + prefs::kBookmarkSignInPromoDismissCountPerProfileForLimitsExperiment, 2);
              + EXPECT_FALSE(ShouldShowBookmarkSignInPromo(*profile()));
              EXPECT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
              -
              - // Reaching the AI specific limit hides it.
              - profile()->GetPrefs()->SetInteger(
              - prefs::kSearchAIModeSignInPromoDismissCountPerProfile, 2);
              - EXPECT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
              }

              TEST_F(ShowSigninPromoTestWithFeatureFlagsPromoLimitsExperiment,
              SearchAIModePromoLimitsDoNotAffectOtherPromos) {
              - base::test::ScopedFeatureList features;
              - features.InitAndEnableFeatureWithParameters(
              - switches::kSigninPromoLimitsExperiment,
              - {{"contextual_signin_promo_shown_threshold", "10"},
              - {"contextual_signin_promo_dismissed_threshold", "5"}});
              -
              ASSERT_TRUE(ShouldShowSearchAIModeSignInPromo(*profile()));
              + ASSERT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));

              - // Verify that reaching the AI limit (5 impressions) doesn't affect other promos.
              + // Set the Search AIM max impression limit (5 times)

              profile()->GetPrefs()->SetInteger(
              prefs::kSearchAIModeSignInPromoShownCountPerProfile, 5);
              -  ASSERT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
              + EXPECT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
              EXPECT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));

              - // Verify that reaching the AI limit (2 dismissals) doesn't affect other promos.
              + // Set the Search AIM max dismissal limit (2 times)
              profile()->GetPrefs()->SetInteger(
              prefs::kSearchAIModeSignInPromoShownCountPerProfile, 2);
              profile()->GetPrefs()->SetInteger(
              prefs::kSearchAIModeSignInPromoDismissCountPerProfile, 2);
              - ASSERT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
              + EXPECT_FALSE(ShouldShowSearchAIModeSignInPromo(*profile()));
              EXPECT_TRUE(ShouldShowBookmarkSignInPromo(*profile()));
              }

              ```

              Change information

              Commit message:
              Add AIM sign-in promo rate limits

              Rate limits per the PRD:
              - Global contextual promo cap: If a user explicitly dismisses 2 contextual sign-in promos globally, all such promos are permanently dismissed.
              - Explicit dismissal (user taps 'x')
              The promo can be shown up to 1 more time with a 14-day gap between impressions - see global cap above.
              - Implicit dismissal:
              The promo is shown up to 4 more times (total 5 impressions) with a 14-day gap between impressions.
              Bug: 499261222
              Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
              Reviewed-by: David Roger <dro...@chromium.org>
              Reviewed-by: Amelie Schneider <ame...@google.com>
              Commit-Queue: Anthi Orfanou <ant...@google.com>
              Cr-Commit-Position: refs/heads/main@{#1615226}
              Files:
              • M chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper.cc
              • M chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper_browsertest.cc
              • M chrome/browser/signin/BUILD.gn
              • M chrome/browser/signin/chrome_signin_pref_names.h
              • M chrome/browser/signin/signin_promo.cc
              • M chrome/browser/signin/signin_promo_unittest.cc
              • M chrome/browser/signin/signin_promo_util.cc
              • M chrome/browser/signin/signin_promo_util.h
              • M chrome/browser/ui/signin/promos/bubble_signin_promo_view.cc
              • M chrome/browser/ui/views/search_ai_mode/signin_promo_controller.cc
              • M chrome/browser/ui/views/search_ai_mode/signin_promo_controller.h
              • M components/signin/public/base/signin_prefs.cc
              • M components/signin/public/base/signin_prefs.h
              • M components/signin/public/base/signin_switches.cc
              • M components/signin/public/base/signin_switches.h
              Change size: L
              Delta: 15 files changed, 417 insertions(+), 67 deletions(-)
              Branch: refs/heads/main
              Submit Requirements:
              • requirement satisfiedCode-Review: +1 by Amelie Schneider, +1 by David Roger
              Open in Gerrit
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: merged
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: Ib2695d7ce2b8b053e7c25ac0ec59d93e97ec6554
              Gerrit-Change-Number: 7736186
              Gerrit-PatchSet: 26
              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>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages