Commit 9300797a authored by Guillaume Jenkins's avatar Guillaume Jenkins Committed by Commit Bot

[iOS] Don't donate intents at startup

According to the Apple doc below, donating intents is a way for apps to
tell Siri "The user just performed this action inside my app". This is
used by Siri to give better results to the user when they search in
Spotlight, or to give suggestions to the user on the homescreen, such
as "Do you wish to Search in Chrome?". According to the doc, donating
intents should only happen immediately after the user performs the
related action inside the app.

Also, donating intents is not needed to register shortcut actions. That
happens automatically via the intent definition file.

For those two reasons, there is no need to donate the SearchInChrome
intent during startup, so this CL removes that.

https://developer.apple.com/documentation/sirikit/donating_shortcuts

Bug: 1125200
Change-Id: I93c1e71ced03b70d0849ce27390ccbfe9821b4f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401761Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Guillaume Jenkins <gujen@google.com>
Cr-Commit-Position: refs/heads/master@{#805728}
parent 8ea36a52
...@@ -982,7 +982,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -982,7 +982,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
- (void)scheduleLowPriorityStartupTasks { - (void)scheduleLowPriorityStartupTasks {
[_startupTasks initializeOmaha]; [_startupTasks initializeOmaha];
[_startupTasks donateIntents];
// Deferred tasks. // Deferred tasks.
[self schedulePrefObserverInitialization]; [self schedulePrefObserverInitialization];
......
...@@ -18,8 +18,6 @@ class ChromeBrowserState; ...@@ -18,8 +18,6 @@ class ChromeBrowserState;
(ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Starts Omaha and, if first run, sets install time. For official builds only. // Starts Omaha and, if first run, sets install time. For official builds only.
- (void)initializeOmaha; - (void)initializeOmaha;
// Donate initial Intents.
- (void)donateIntents;
// Registers to receive UIApplicationWillResignActiveNotification. // Registers to receive UIApplicationWillResignActiveNotification.
- (void)registerForApplicationWillResignActiveNotification; - (void)registerForApplicationWillResignActiveNotification;
......
...@@ -77,17 +77,6 @@ NSString* const kStartProfileStartupTaskRunners = ...@@ -77,17 +77,6 @@ NSString* const kStartProfileStartupTaskRunners =
object:nil]; object:nil];
} }
- (void)donateIntents {
SearchInChromeIntent* searchInChromeIntent =
[[SearchInChromeIntent alloc] init];
searchInChromeIntent.suggestedInvocationPhrase = l10n_util::GetNSString(
IDS_IOS_INTENTS_SEARCH_IN_CHROME_INVOCATION_PHRASE);
INInteraction* interaction =
[[INInteraction alloc] initWithIntent:searchInChromeIntent response:nil];
[interaction donateInteractionWithCompletion:^(NSError* _Nullable error){
}];
}
#pragma mark - Private methods. #pragma mark - Private methods.
+ (void)performDeferredInitializationForBrowserState: + (void)performDeferredInitializationForBrowserState:
......
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