[iOS] Integrate Gemini Fullscreen Promo with Feature Engagement Toolkit [chromium/src : main]

0 views
Skip to first unread message

Adam Arcaro (Gerrit)

unread,
Nov 6, 2025, 6:26:19 PM (6 days ago) Nov 6
to Tarek Makkouk, Nicolas MacBeth, Joemer Ramos, chromium...@chromium.org, Chromium LUCI CQ, dfried...@chromium.org, estali...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Joemer Ramos, Nicolas MacBeth and Tarek Makkouk

Adam Arcaro added 1 comment

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

Joemer and Nic should have the context to review this while I'm OOO. Please reach out to me if anything is unclear and I'll help when I'm available, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Joemer Ramos
  • Nicolas MacBeth
  • Tarek Makkouk
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4ac1bbb8dd903e95824d934aace5fbaf2e976674
Gerrit-Change-Number: 7128958
Gerrit-PatchSet: 1
Gerrit-Owner: Tarek Makkouk <tarekm...@google.com>
Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Reviewer: Tarek Makkouk <tarekm...@google.com>
Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
Gerrit-Attention: Joemer Ramos <joeme...@google.com>
Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
Gerrit-Comment-Date: Thu, 06 Nov 2025 23:26:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Joemer Ramos (Gerrit)

unread,
Nov 7, 2025, 9:34:38 AM (6 days ago) Nov 7
to Tarek Makkouk, Adam Arcaro, Nicolas MacBeth, Joemer Ramos, chromium...@chromium.org, Chromium LUCI CQ, dfried...@chromium.org, estali...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Nicolas MacBeth and Tarek Makkouk

Joemer Ramos added 8 comments

Patchset-level comments
Joemer Ramos . unresolved

Thanks for the work! Can you also add histogram metrics for the FET. You get this for free by adding variations in xml files. Check out [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/7087869) as a reference.

File components/feature_engagement/public/feature_configurations.cc
Line 105, Patchset 1 (Latest): config.trigger = EventConfig("gemini_fullscreen_promo_triggered",
Joemer Ramos . unresolved

Add this as a string constant in components/feature_engagement/public/event_constants.h

Line 109, Patchset 1 (Latest): EventConfig("gemini_consent_given", Comparator(EQUAL, 0), 3650, 3650);
Joemer Ramos . unresolved

You can use `feature_engagement::kMaxStoragePeriod` if you want this to only check once. Unless there's a reason we're doing 3650 days?

Line 109, Patchset 1 (Latest): EventConfig("gemini_consent_given", Comparator(EQUAL, 0), 3650, 3650);
Joemer Ramos . unresolved

Add a string constant here too.

Line 2922, Patchset 1 (Latest): if (kIPHiOSGeminiContextualCueChip.name == feature->name) {
Joemer Ramos . unresolved

There's already an iOS build flag guard in this file (like here), move your code to somewhere within the existing flag guard.

File components/feature_engagement/public/feature_list.cc
Line 202, Patchset 1 (Latest): &kIPHiOSGeminiFullscreenPromoFeature,
Joemer Ramos . unresolved

Add this to the header file `feature_list.h`

File ios/chrome/browser/intelligence/bwg/coordinator/bwg_mediator.mm
Line 116, Patchset 1 (Latest): ->NotifyEvent("gemini_consent_given");
Joemer Ramos . unresolved

Replace this with the constant you make.

File ios/chrome/browser/intelligence/bwg/model/DEPS
Line 15, Patchset 1 (Latest): "+ios/chrome/browser/feature_engagement/model/tracker_factory.h",
Joemer Ramos . unresolved

While you're here, can you make this list alphabetical?

Open in Gerrit

Related details

Attention is currently required from:
  • Nicolas MacBeth
  • Tarek Makkouk
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4ac1bbb8dd903e95824d934aace5fbaf2e976674
    Gerrit-Change-Number: 7128958
    Gerrit-PatchSet: 1
    Gerrit-Owner: Tarek Makkouk <tarekm...@google.com>
    Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
    Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
    Gerrit-Reviewer: Tarek Makkouk <tarekm...@google.com>
    Gerrit-CC: Adam Arcaro <ada...@google.com>
    Gerrit-Attention: Nicolas MacBeth <nicolas...@google.com>
    Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
    Gerrit-Comment-Date: Fri, 07 Nov 2025 14:34:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joemer Ramos (Gerrit)

    unread,
    Nov 7, 2025, 9:34:58 AM (6 days ago) Nov 7
    to Tarek Makkouk, Adam Arcaro, Nicolas MacBeth, Joemer Ramos, chromium...@chromium.org, Chromium LUCI CQ, dfried...@chromium.org, estali...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Nicolas MacBeth and Tarek Makkouk

    Joemer Ramos added 1 comment

    Patchset-level comments
    Joemer Ramos . unresolved

    One more, also, note and fix the test cases before your next patch!

    Gerrit-Comment-Date: Fri, 07 Nov 2025 14:34:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tarek Makkouk (Gerrit)

    unread,
    Nov 12, 2025, 8:25:19 PM (9 hours ago) Nov 12
    to Adam Arcaro, Chromium Metrics Reviews, AyeAye, Nicolas MacBeth, Joemer Ramos, chromium...@chromium.org, Chromium LUCI CQ, asvitkine...@chromium.org, dfried...@chromium.org, estali...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Adam Arcaro and Joemer Ramos

    Tarek Makkouk added 9 comments

    Patchset-level comments
    File-level comment, Patchset 1:
    Joemer Ramos . resolved

    Thanks for the work! Can you also add histogram metrics for the FET. You get this for free by adding variations in xml files. Check out [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/7087869) as a reference.

    Tarek Makkouk

    Done

    File-level comment, Patchset 1:
    Joemer Ramos . resolved

    One more, also, note and fix the test cases before your next patch!

    Tarek Makkouk

    Done

    File components/feature_engagement/public/feature_configurations.cc
    Line 105, Patchset 1: config.trigger = EventConfig("gemini_fullscreen_promo_triggered",
    Joemer Ramos . resolved

    Add this as a string constant in components/feature_engagement/public/event_constants.h

    Tarek Makkouk

    Done

    Line 109, Patchset 1: EventConfig("gemini_consent_given", Comparator(EQUAL, 0), 3650, 3650);
    Joemer Ramos . resolved

    You can use `feature_engagement::kMaxStoragePeriod` if you want this to only check once. Unless there's a reason we're doing 3650 days?

    Tarek Makkouk

    Done

    Line 109, Patchset 1: EventConfig("gemini_consent_given", Comparator(EQUAL, 0), 3650, 3650);
    Joemer Ramos . resolved

    Add a string constant here too.

    Tarek Makkouk

    Done

    Line 2922, Patchset 1: if (kIPHiOSGeminiContextualCueChip.name == feature->name) {
    Joemer Ramos . resolved

    There's already an iOS build flag guard in this file (like here), move your code to somewhere within the existing flag guard.

    Tarek Makkouk

    Done

    File components/feature_engagement/public/feature_list.cc
    Line 202, Patchset 1: &kIPHiOSGeminiFullscreenPromoFeature,
    Joemer Ramos . resolved

    Add this to the header file `feature_list.h`

    Tarek Makkouk

    Done

    File ios/chrome/browser/intelligence/bwg/coordinator/bwg_mediator.mm
    Line 116, Patchset 1: ->NotifyEvent("gemini_consent_given");
    Joemer Ramos . resolved

    Replace this with the constant you make.

    Tarek Makkouk

    Done

    File ios/chrome/browser/intelligence/bwg/model/DEPS
    Line 15, Patchset 1: "+ios/chrome/browser/feature_engagement/model/tracker_factory.h",
    Joemer Ramos . resolved

    While you're here, can you make this list alphabetical?

    Tarek Makkouk

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Arcaro
    • Joemer Ramos
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4ac1bbb8dd903e95824d934aace5fbaf2e976674
      Gerrit-Change-Number: 7128958
      Gerrit-PatchSet: 9
      Gerrit-Owner: Tarek Makkouk <tarekm...@google.com>
      Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
      Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
      Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
      Gerrit-Reviewer: Tarek Makkouk <tarekm...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Joemer Ramos <joeme...@google.com>
      Gerrit-Attention: Adam Arcaro <ada...@google.com>
      Gerrit-Comment-Date: Thu, 13 Nov 2025 01:25:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Joemer Ramos <joeme...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joemer Ramos (Gerrit)

      unread,
      Nov 12, 2025, 9:11:22 PM (8 hours ago) Nov 12
      to Tarek Makkouk, Adam Arcaro, Chromium Metrics Reviews, AyeAye, Nicolas MacBeth, Joemer Ramos, chromium...@chromium.org, Chromium LUCI CQ, asvitkine...@chromium.org, dfried...@chromium.org, estali...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Adam Arcaro and Tarek Makkouk

      Joemer Ramos added 8 comments

      Patchset-level comments
      File-level comment, Patchset 9 (Latest):
      Joemer Ramos . resolved

      Thanks for the work, this looks good so far! Added some comments, let me know if you have any questions

      File components/feature_engagement/public/feature_configurations.cc
      Line 2944, Patchset 9 (Latest): config.used =
      EventConfig(events::kIOSGeminiConsentGiven, Comparator(EQUAL, 0),
      feature_engagement::kMaxStoragePeriod,
      feature_engagement::kMaxStoragePeriod);
      Joemer Ramos . unresolved
      I don't think this is how `config.used` is supposed to be used. Maybe we do something similar to: 
      ```
      // This feature should show for 2 weeks after the client was first
      // considered eligible for the AI Hub.
      config.event_configs.insert(
      EventConfig(events::kIOSGeminiEligiblity, Comparator(EQUAL, 1), 14,
      feature_engagement::kMaxStoragePeriod));
      ```
      so we insert an event config, and then tie it to an event. So something like
      ```
      // Some comment.
      config.event_configs.insert(
      EventConfig(events::kIOSGeminiConsentGiven, Comparator(EQUAL, 0),
      feature_engagement::kMaxStoragePeriod,
      feature_engagement::kMaxStoragePeriod));
      ```
      File components/feature_engagement/public/feature_constants.cc
      Line 853, Patchset 9 (Latest): base::FEATURE_DISABLED_BY_DEFAULT);
      Joemer Ramos . unresolved

      Enabled by default please. This isn't a normal feature flag, this is a feature flag to enable the feature config in the FET system. We can enable by default since actually logging the events should be done behind an actual feature flag.

      File ios/chrome/browser/intelligence/bwg/coordinator/bwg_coordinator.mm
      Line 131, Patchset 9 (Latest): feature_engagement::TrackerFactory::GetForProfile(self.profile)
      ->NotifyEvent(
      feature_engagement::events::kIOSGeminiFullscreenPromoTriggered);
      Joemer Ramos . unresolved

      Please hide behind the feature flag: `IsGeminiNavigationPromoEnabled()`

      File ios/chrome/browser/intelligence/bwg/coordinator/bwg_mediator.mm
      Line 115, Patchset 9 (Latest): feature_engagement::TrackerFactory::GetForProfile(
      ProfileIOS::FromBrowserState(
      _webStateList->GetActiveWebState()->GetBrowserState()))
      ->NotifyEvent(feature_engagement::events::kIOSGeminiConsentGiven);
      Joemer Ramos . unresolved

      Hide behind the feature flag `IsGeminiNavigationPromoEnabled()`

      File ios/chrome/browser/intelligence/bwg/model/bwg_tab_helper_unittest.mm
      Line 288, Patchset 9 (Latest): auto* tracker = static_cast<feature_engagement::test::MockTracker*>(
      feature_engagement::TrackerFactory::GetForProfile(profile_.get()));
      EXPECT_CALL(*tracker,
      ShouldTriggerHelpUI(testing::Ref(
      feature_engagement::kIPHiOSGeminiFullscreenPromoFeature)))
      .WillRepeatedly(testing::Return(true));
      Joemer Ramos . unresolved

      Can we test with `tracker->NotifyEvent()` to emulate a user giving consent rather than returning true? Should be possible.

      Line 335, Patchset 9 (Latest): auto* tracker = static_cast<feature_engagement::test::MockTracker*>(
      feature_engagement::TrackerFactory::GetForProfile(profile_.get()));
      EXPECT_CALL(*tracker,
      ShouldTriggerHelpUI(testing::Ref(
      feature_engagement::kIPHiOSGeminiFullscreenPromoFeature)))
      .WillRepeatedly(testing::Return(false));
      Joemer Ramos . unresolved

      Same here, can we emulate an event just not being logged and the promo failing to show?

      File tools/metrics/histograms/metadata/feature_engagement/histograms.xml
      Line 315, Patchset 9 (Latest): summary="showing the fullscreen Gemini in Chrome iOS promo"/>
      Joemer Ramos . unresolved

      Nit: Don't mention Chrome, since this is technically in the chromium repo, iOS is good enough!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Arcaro
      • Tarek Makkouk
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4ac1bbb8dd903e95824d934aace5fbaf2e976674
        Gerrit-Change-Number: 7128958
        Gerrit-PatchSet: 9
        Gerrit-Owner: Tarek Makkouk <tarekm...@google.com>
        Gerrit-Reviewer: Adam Arcaro <ada...@google.com>
        Gerrit-Reviewer: Joemer Ramos <joeme...@google.com>
        Gerrit-Reviewer: Nicolas MacBeth <nicolas...@google.com>
        Gerrit-Reviewer: Tarek Makkouk <tarekm...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Tarek Makkouk <tarekm...@google.com>
        Gerrit-Attention: Adam Arcaro <ada...@google.com>
        Gerrit-Comment-Date: Thu, 13 Nov 2025 02:11:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages