Commit fd7acee6 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Updating GetSyncErrorDescriptionForBrowserState() API

Replacing GetSyncErrorDescriptionForBrowserState() by
GetSyncErrorDescriptionForSyncSetupService().

Browser state is not always available. This patch is to prepare for
crrev.com/c/1231333

Bug: 849754
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Iec560ea22b8e8344cca29de036aef299e8e7b667
Reviewed-on: https://chromium-review.googlesource.com/1234155Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593021}
parent 9f54a2ec
...@@ -321,7 +321,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -321,7 +321,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
// Sync error. // Sync error.
syncItem.shouldDisplayError = YES; syncItem.shouldDisplayError = YES;
NSString* errorMessage = NSString* errorMessage =
GetSyncErrorDescriptionForBrowserState(_browserState); GetSyncErrorDescriptionForSyncSetupService(syncSetupService);
DCHECK(errorMessage); DCHECK(errorMessage);
syncItem.image = [UIImage imageNamed:@"settings_error"]; syncItem.image = [UIImage imageNamed:@"settings_error"];
syncItem.detailText = errorMessage; syncItem.detailText = errorMessage;
......
...@@ -1100,7 +1100,7 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -1100,7 +1100,7 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
!IsTransientSyncError(syncSetupService->GetSyncServiceState()); !IsTransientSyncError(syncSetupService->GetSyncServiceState());
if (identityAccountItem.shouldDisplayError) { if (identityAccountItem.shouldDisplayError) {
identityAccountItem.detailText = identityAccountItem.detailText =
GetSyncErrorDescriptionForBrowserState(_browserState); GetSyncErrorDescriptionForSyncSetupService(syncSetupService);
} else { } else {
identityAccountItem.detailText = identityAccountItem.detailText =
syncSetupService->IsSyncEnabled() syncSetupService->IsSyncEnabled()
......
...@@ -18,9 +18,9 @@ class ChromeBrowserState; ...@@ -18,9 +18,9 @@ class ChromeBrowserState;
} }
// Gets the top-level description message associated with the sync error state // Gets the top-level description message associated with the sync error state
// of |browserState|. Returns nil if there is no sync error. // of |syncSetupService|. Returns nil if there is no sync error.
NSString* GetSyncErrorDescriptionForBrowserState( NSString* GetSyncErrorDescriptionForSyncSetupService(
ios::ChromeBrowserState* browserState); SyncSetupService* syncSetupService);
// Gets the string message associated with the sync error state of // Gets the string message associated with the sync error state of
// |browserState|. The returned error message does not contain any links. // |browserState|. The returned error message does not contain any links.
......
...@@ -37,10 +37,8 @@ enum ErrorState { ...@@ -37,10 +37,8 @@ enum ErrorState {
} // namespace } // namespace
NSString* GetSyncErrorDescriptionForBrowserState( NSString* GetSyncErrorDescriptionForSyncSetupService(
ios::ChromeBrowserState* browserState) { SyncSetupService* syncSetupService) {
SyncSetupService* syncSetupService =
SyncSetupServiceFactory::GetForBrowserState(browserState);
DCHECK(syncSetupService); DCHECK(syncSetupService);
SyncSetupService::SyncServiceState syncState = SyncSetupService::SyncServiceState syncState =
syncSetupService->GetSyncServiceState(); syncSetupService->GetSyncServiceState();
......
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