Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java

Issue 1021783002: Move SyncNotificationController constrution to SyncController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java
index 087b230771f332339a491641ab768cf1fa02c28e..c4f816ed5072d24be0d66e275e360404f03d92a5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncController.java
@@ -12,8 +12,10 @@ import android.util.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.invalidation.InvalidationController;
+import org.chromium.chrome.browser.signin.AccountManagementFragment;
import org.chromium.chrome.browser.signin.SigninManager;
import org.chromium.chrome.browser.signin.SigninManager.SignInFlowObserver;
+import org.chromium.chrome.browser.sync.ui.PassphraseActivity;
import org.chromium.sync.AndroidSyncSettings;
import org.chromium.sync.signin.AccountManagerHelper;
import org.chromium.sync.signin.ChromeSigninController;
@@ -50,8 +52,7 @@ public class SyncController implements ProfileSyncService.SyncStateChangedListen
private final ChromeSigninController mChromeSigninController;
private final AndroidSyncSettings mAndroidSyncSettings;
private final ProfileSyncService mProfileSyncService;
- // TODO(maxbogue): Make final once it's constructed in this class.
- private SyncNotificationController mSyncNotificationController = null;
+ private final SyncNotificationController mSyncNotificationController;
private SyncController(Context context) {
mContext = context;
@@ -64,6 +65,9 @@ public class SyncController implements ProfileSyncService.SyncStateChangedListen
// Set the sessions ID using the generator that was registered for GENERATOR_ID.
mProfileSyncService.setSessionsId(
UniqueIdentificationGeneratorFactory.getInstance(GENERATOR_ID));
+ mSyncNotificationController = new SyncNotificationController(
+ mContext, PassphraseActivity.class, AccountManagementFragment.class);
+ mProfileSyncService.addSyncStateChangedListener(mSyncNotificationController);
}
/**
@@ -199,13 +203,10 @@ public class SyncController implements ProfileSyncService.SyncStateChangedListen
* Sets the SyncNotificationController.
*
* This is a temporary method for transferring ownership of SyncNotificationController
- * upstream. Once all of SNC's dependencies are upstreamed, it will be created in the
- * SyncController constructor and this method won't exist.
+ * upstream. SNC is now created in the constructor and this method can be removed once
+ * the downstream call from GoogleServicesManager is removed.
*/
public void setSyncNotificationController(SyncNotificationController snc) {
- assert mSyncNotificationController == null;
- mSyncNotificationController = snc;
- mProfileSyncService.addSyncStateChangedListener(mSyncNotificationController);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698