Commit f31ea47f authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[SendTabToSelf] Move iOS activity to 2nd from the left.

The Send to your Devices activity should be offered right next to the
copy activity.

Bug: 966523
Change-Id: I2e8855fbd0894ed6ff7499f55a8cee8eca4e4a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627657
Auto-Submit: sebsg <sebsg@chromium.org>
Reviewed-by: default avatarJeffrey Cohen <jeffreycohen@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662852}
parent 669117a5
...@@ -263,18 +263,18 @@ NSString* const kActivityServicesSnackbarCategory = ...@@ -263,18 +263,18 @@ NSString* const kActivityServicesSnackbarCategory =
addObject:[[CopyActivity alloc] initWithURL:data.shareURL]]; addObject:[[CopyActivity alloc] initWithURL:data.shareURL]];
if (data.shareURL.SchemeIsHTTPOrHTTPS()) { if (data.shareURL.SchemeIsHTTPOrHTTPS()) {
ReadingListActivity* readingListActivity =
[[ReadingListActivity alloc] initWithURL:data.shareURL
title:data.title
dispatcher:dispatcher];
[applicationActivities addObject:readingListActivity];
if (canSendTabToSelf) { if (canSendTabToSelf) {
SendTabToSelfActivity* sendTabToSelfActivity = SendTabToSelfActivity* sendTabToSelfActivity =
[[SendTabToSelfActivity alloc] initWithDispatcher:dispatcher]; [[SendTabToSelfActivity alloc] initWithDispatcher:dispatcher];
[applicationActivities addObject:sendTabToSelfActivity]; [applicationActivities addObject:sendTabToSelfActivity];
} }
ReadingListActivity* readingListActivity =
[[ReadingListActivity alloc] initWithURL:data.shareURL
title:data.title
dispatcher:dispatcher];
[applicationActivities addObject:readingListActivity];
if (bookmarkModel) { if (bookmarkModel) {
BOOL bookmarked = bookmarkModel->loaded() && BOOL bookmarked = bookmarkModel->loaded() &&
bookmarkModel->IsBookmarked(data.visibleURL); bookmarkModel->IsBookmarked(data.visibleURL);
......
...@@ -867,6 +867,10 @@ TEST_F(ActivityServiceControllerTest, SendTabToSelfActivity) { ...@@ -867,6 +867,10 @@ TEST_F(ActivityServiceControllerTest, SendTabToSelfActivity) {
ASSERT_EQ(6U, [items count]); ASSERT_EQ(6U, [items count]);
EXPECT_TRUE(ArrayContainsObjectOfClass(items, [SendTabToSelfActivity class])); EXPECT_TRUE(ArrayContainsObjectOfClass(items, [SendTabToSelfActivity class]));
// When the activity is offered, it should be the second one from the left.
UIActivity* activity = [items objectAtIndex:1];
EXPECT_TRUE([activity isKindOfClass:[SendTabToSelfActivity class]]);
// Verify searchable data with the send tab to self feature disabled. // Verify searchable data with the send tab to self feature disabled.
data = [[ShareToData alloc] data = [[ShareToData alloc]
initWithShareURL:GURL("https://chromium.org/printable") initWithShareURL:GURL("https://chromium.org/printable")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment