Commit 324b9b36 authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Chromium LUCI CQ

Rename SyncNotificationController to SyncErrorNotifier

The functionality of this class is specific to errors: notifying the
user about them  and providing a way to resolve them. This is now
properly reflected in the name of the class. The name is also picked so
as to match its ChromeOS counterpart in sync_error_notifier_ash.h.

Bug: None
Change-Id: I5fef45fa33df8d92a53e327f1c61d38a07fb54ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642333
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846073}
parent 4767f561
......@@ -1294,7 +1294,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java",
"java/src/org/chromium/chrome/browser/sync/SyncContentResolverDelegate.java",
"java/src/org/chromium/chrome/browser/sync/SyncController.java",
"java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java",
"java/src/org/chromium/chrome/browser/sync/SyncErrorNotifier.java",
"java/src/org/chromium/chrome/browser/sync/SyncUserDataWiper.java",
"java/src/org/chromium/chrome/browser/sync/TrustedVaultClient.java",
"java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java",
......
......@@ -53,7 +53,7 @@ public class SyncController
private static boolean sInitialized;
private final ProfileSyncService mProfileSyncService;
private final SyncNotificationController mSyncNotificationController;
private final SyncErrorNotifier mSyncErrorNotifier;
private SyncController() {
AndroidSyncSettings.get().setDelegate(this);
......@@ -62,9 +62,9 @@ public class SyncController
setSessionsId();
// Create the SyncNotificationController.
mSyncNotificationController = new SyncNotificationController();
mProfileSyncService.addSyncStateChangedListener(mSyncNotificationController);
// Create the SyncErrorNotifier.
mSyncErrorNotifier = new SyncErrorNotifier();
mProfileSyncService.addSyncStateChangedListener(mSyncErrorNotifier);
updateSyncStateFromAndroid();
}
......@@ -159,10 +159,10 @@ public class SyncController
}
/**
* Returns the SyncNotificationController.
* Returns the SyncErrorNotifier.
*/
public SyncNotificationController getSyncNotificationController() {
return mSyncNotificationController;
public SyncErrorNotifier getSyncErrorNotifier() {
return mSyncErrorNotifier;
}
/**
......
......@@ -37,17 +37,16 @@ import org.chromium.components.signin.identitymanager.ConsentLevel;
import org.chromium.components.sync.PassphraseType;
/**
* {@link SyncNotificationController} displays Android notifications regarding sync errors.
* {@link SyncErrorNotifier} displays Android notifications regarding sync errors.
* Errors can be fixed by clicking the notification.
*/
// TODO(victorvianna): Rename to SyncErrorNotificationController.
public class SyncNotificationController implements ProfileSyncService.SyncStateChangedListener {
public class SyncErrorNotifier implements ProfileSyncService.SyncStateChangedListener {
private static final String TAG = "SyncUI";
private final NotificationManagerProxy mNotificationManager;
private final ProfileSyncService mProfileSyncService;
private boolean mTrustedVaultNotificationShownOrCreating;
public SyncNotificationController() {
public SyncErrorNotifier() {
mNotificationManager =
new NotificationManagerProxyImpl(ContextUtils.getApplicationContext());
mProfileSyncService = ProfileSyncService.get();
......
......@@ -134,7 +134,7 @@ public class PassphraseActivity extends AppCompatActivity
@Override
public void onPassphraseCanceled() {
// Re add the notification.
SyncController.get().getSyncNotificationController().syncStateChanged();
SyncController.get().getSyncErrorNotifier().syncStateChanged();
finish();
}
......
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