[iOS] Dynamically populate target devices in Share Sheet [chromium/src : main]

0 views
Skip to first unread message

Michael Tatarski (Gerrit)

unread,
Jun 22, 2026, 2:50:10 PMJun 22
to chromium...@chromium.org, jeffreycohen+watc...@chromium.org, feature-me...@chromium.org, ios-r...@chromium.org, ios-revie...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org

Michael Tatarski has uploaded the change for review

Commit message

[iOS] Dynamically populate target devices in Share Sheet

This CL implements the dynamic population of individual device-specific send targets directly into the iOS native Share Sheet.

It updates ActivityServiceCoordinator to retrieve the user's first name from their Google Account via the IdentityManager and pass it to the mediator. The ActivityServiceMediator is updated to fetch the active target devices from the SendTabToSelfSyncService. When the kSendTabToSelfIOSShareSheetDeviceList feature flag is enabled and devices are available, it generates one SendTabToSelfActivity per device.

Each activity is dynamically formatted as "[First name] • [Device model]" (e.g. "Michael • MacBook Pro") with a custom monochrome icon matching its form factor. When clicked, it routes directly to the direct-send coordinator pipeline, bypassing the bottom sheet picker.


[iOS] Support device-specific mode in SendTabToSelfActivity

This CL introduces a new device-specific initialization mode to SendTabToSelfActivity, allowing it to represent a single, specific target device in the Share Sheet.

It implements a convenience initializer to pass the target device name, cache GUID, and form factor. It updates the activity to dynamically set its title to "Send to [Device Name]" and resolve its monochrome icon to a phone, tablet, or laptop symbol matching the device's form factor.

In addition, the activity's execution is updated to trigger the direct-send coordinator command when targeting a specific device. Unit tests are added to verify the dynamic titles, icons, and direct-send routing.


[iOS] Add Send Tab to Self Share Sheet flag, dependency injection, and direct-send pipeline

This CL introduces the kSendTabToSelfIOSShareSheetDeviceList feature flag to control the rollout of dynamic device targets in the native iOS Share Sheet.

It updates ActivityServiceMediator to accept SendTabToSelfSyncService as a dependency (cleaning up and utilizing a pre-existing unused import).

It also adds a direct-send command to BrowserCoordinatorCommands, allowing a tab to be sent directly to a specific target device cache GUID without presenting the device picker UI. The SendTabToSelfCoordinator is updated to execute the send transaction asynchronously, extracting scroll position and form fields, and displaying the post-send snackbar upon completion.
Change-Id: I519ba181eba5b3c1662c06427b0529327a36cdc3

Change diff


Change information

Files:
Change size: L
Delta: 18 files changed, 508 insertions(+), 31 deletions(-)
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 satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I519ba181eba5b3c1662c06427b0529327a36cdc3
Gerrit-Change-Number: 7980620
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Tatarski <mtat...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Tatarski (Gerrit)

unread,
Jun 23, 2026, 10:13:05 AMJun 23
to Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, jeffreycohen+watc...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org

Michael Tatarski added 1 comment

File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_mediator.mm
Line 165, Patchset 17 (Latest): if (self.userGivenName.length > 0) {
activityTitle = [NSString
stringWithFormat:@"%@ • %@", self.userGivenName, rawDeviceName];
}
Michael Tatarski . unresolved

This needs to be adjusted. It doesn't work well i18n

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: I519ba181eba5b3c1662c06427b0529327a36cdc3
    Gerrit-Change-Number: 7980620
    Gerrit-PatchSet: 17
    Gerrit-Owner: Michael Tatarski <mtat...@google.com>
    Gerrit-Reviewer: Michael Tatarski <mtat...@google.com>
    Gerrit-Comment-Date: Tue, 23 Jun 2026 14:12:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Tatarski (Gerrit)

    unread,
    Jun 24, 2026, 2:59:40 AMJun 24
    to Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, jeffreycohen+watc...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org

    Michael Tatarski added 1 comment

    File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_mediator.mm
    Line 165, Patchset 17 (Latest): if (self.userGivenName.length > 0) {
    activityTitle = [NSString
    stringWithFormat:@"%@ • %@", self.userGivenName, rawDeviceName];
    }
    Michael Tatarski . resolved

    This needs to be adjusted. It doesn't work well i18n

    Michael Tatarski

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not 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: I519ba181eba5b3c1662c06427b0529327a36cdc3
      Gerrit-Change-Number: 7980620
      Gerrit-PatchSet: 17
      Gerrit-Owner: Michael Tatarski <mtat...@google.com>
      Gerrit-Reviewer: Michael Tatarski <mtat...@google.com>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 06:59:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Michael Tatarski <mtat...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Marc Treib (Gerrit)

      unread,
      Aug 3, 2026, 12:48:03 PM (2 days ago) Aug 3
      to Michael Tatarski, Marc Treib, Mark Cogan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, devtools...@chromium.org, derinel+wat...@google.com, webauthn...@chromium.org, oshima...@chromium.org, cblume...@chromium.org, chrome-intelligence-te...@google.com, chrome-intell...@chromium.org, penghuan...@chromium.org, srahim...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, jeffreycohen+watc...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org
      Attention needed from Mark Cogan and Michael Tatarski

      Marc Treib voted and added 4 comments

      Votes added by Marc Treib

      Code-Review+1

      4 comments

      Commit Message
      Line 14, Patchset 81 (Latest):formatted as [First Name] • [Device Model], enabling direct one-tap tab
      Marc Treib . unresolved

      Do you know if the desired format has been decided? I ask because the Android implementation currently only uses "device model", but I still have a TODO to follow up on this.

      File ios/chrome/app/strings/ios_strings_grd/IDS_IOS_SEND_TAB_TO_SELF_SHARE_SHEET_DEVICE_NAME_WITH_OWNER.png.sha1
      Line 1, Patchset 81 (Latest):da39a3ee5e6b4b0d3255bfef95601890afd80709
      Marc Treib . unresolved

      This image doesn't seem to exist on the server?

      File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_mediator.mm
      Line 97, Patchset 81 (Latest): // the picker UI even when dynamic target activities are available.
      Marc Treib . unresolved

      I think we should also clarify whether there should be a limit to the number of devices. On Android, we limited it to 2, so as to not overcrowd this row. (I'm not sure what other competing entries there are in the iOS share sheet - on Android there are typically lots!)

      File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_mediator_unittest.mm
      Line 530, Patchset 81 (Latest): ]);

      SendTabToSelfShareActivity* phone_activity = activities[2];
      SendTabToSelfShareActivity* tablet_activity = activities[3];
      SendTabToSelfShareActivity* desktop_activity = activities[4];

      EXPECT_NSEQ(@"Michael • Phone", [phone_activity activityTitle]);
      EXPECT_NSEQ(@"Michael • Tablet", [tablet_activity activityTitle]);
      EXPECT_NSEQ(@"Michael • Desktop", [desktop_activity activityTitle]);
      Marc Treib . unresolved

      I was wondering whether the ordering actually works out like this here, since "desktop" might actually have a slightly larger timestamp than "tablet" or "phone". It does, because the fake model returns the devices in the order they were added...
      Maybe using `SetTargetDeviceInfoSortedList` instead of adding the devices one by one would make the ordering clearer?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mark Cogan
      • Michael Tatarski
      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: I519ba181eba5b3c1662c06427b0529327a36cdc3
        Gerrit-Change-Number: 7980620
        Gerrit-PatchSet: 81
        Gerrit-Owner: Michael Tatarski <mtat...@google.com>
        Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
        Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
        Gerrit-Reviewer: Michael Tatarski <mtat...@google.com>
        Gerrit-Attention: Mark Cogan <ma...@chromium.org>
        Gerrit-Attention: Michael Tatarski <mtat...@google.com>
        Gerrit-Comment-Date: Mon, 03 Aug 2026 16:47:43 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mark Cogan (Gerrit)

        unread,
        Aug 4, 2026, 5:13:47 AM (yesterday) Aug 4
        to Michael Tatarski, Marc Treib, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, devtools...@chromium.org, derinel+wat...@google.com, webauthn...@chromium.org, oshima...@chromium.org, cblume...@chromium.org, chrome-intelligence-te...@google.com, chrome-intell...@chromium.org, penghuan...@chromium.org, srahim...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, jeffreycohen+watc...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org
        Attention needed from Marc Treib and Michael Tatarski

        Mark Cogan added 2 comments

        File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_coordinator.mm
        Line 142, Patchset 93: initWithHandler:self.handler
        Mark Cogan . unresolved

        The pattern of collecting multiple protocols into a single handler is long-deprectated (and I thought all of them had been cleaned up).

        Even if fixing this coordinator's 'handler' property is out of scope for this CL, since you're changing the mediator, it should have separate BrowserCooordinator and FindInPage handlers (assuming it needs both -- if not, it should just have the one it needs, clearly named as such).

        File ios/chrome/browser/sharing/ui_bundled/activity_services/activity_service_mediator.mm
        Line 50, Patchset 93:namespace {
        Mark Cogan . unresolved

        I'd like to manage scope creep in both the mediator and coordinator for the activity service; this is an OS-supplied gateway to a bunch of internal Chrome features, so ideally as much feature-specific code as possible should be moved out of these classes and into classes or utility files that are local to those features. This keeps all of the logic related to each feature collected together, and it keeps this mediator and its associated coordinator more readable.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Marc Treib
        • Michael Tatarski
        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: I519ba181eba5b3c1662c06427b0529327a36cdc3
          Gerrit-Change-Number: 7980620
          Gerrit-PatchSet: 93
          Gerrit-Owner: Michael Tatarski <mtat...@google.com>
          Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
          Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
          Gerrit-Reviewer: Michael Tatarski <mtat...@google.com>
          Gerrit-Attention: Marc Treib <tr...@chromium.org>
          Gerrit-Attention: Michael Tatarski <mtat...@google.com>
          Gerrit-Comment-Date: Tue, 04 Aug 2026 09:13:29 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Marc Treib (Gerrit)

          unread,
          5:48 AM (2 hours ago) 5:48 AM
          to Michael Tatarski, AyeAye Python Dispatcher, SLSA Policy Verification Service, Marc Treib, Mark Cogan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, devtools...@chromium.org, derinel+wat...@google.com, webauthn...@chromium.org, oshima...@chromium.org, cblume...@chromium.org, chrome-intelligence-te...@google.com, chrome-intell...@chromium.org, penghuan...@chromium.org, srahim...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, jeffreycohen+watc...@chromium.org, knollr+wat...@chromium.org, marq+...@chromium.org, tgupta...@chromium.org
          Attention needed from Michael Tatarski

          Marc Treib added 1 comment

          Commit Message
          Line 14, Patchset 81:formatted as [First Name] • [Device Model], enabling direct one-tap tab
          Marc Treib . resolved

          Do you know if the desired format has been decided? I ask because the Android implementation currently only uses "device model", but I still have a TODO to follow up on this.

          Marc Treib

          I've checked with UXW and this format is indeed the one we want!

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Michael Tatarski
          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: I519ba181eba5b3c1662c06427b0529327a36cdc3
          Gerrit-Change-Number: 7980620
          Gerrit-PatchSet: 107
          Gerrit-Owner: Michael Tatarski <mtat...@google.com>
          Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
          Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
          Gerrit-Reviewer: Michael Tatarski <mtat...@google.com>
          Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
          Gerrit-CC: AyeAye Python Dispatcher <android-build-ayeay...@system.gserviceaccount.com>
          Gerrit-Attention: Michael Tatarski <mtat...@google.com>
          Gerrit-Comment-Date: Wed, 05 Aug 2026 09:47:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Marc Treib <tr...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages