OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.sync; | 5 package org.chromium.chrome.browser.sync; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 | 9 |
10 import org.chromium.base.ActivityState; | 10 import org.chromium.base.ActivityState; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 private static SyncController sInstance; | 64 private static SyncController sInstance; |
65 private static boolean sInitialized; | 65 private static boolean sInitialized; |
66 | 66 |
67 private final Context mContext; | 67 private final Context mContext; |
68 private final ChromeSigninController mChromeSigninController; | 68 private final ChromeSigninController mChromeSigninController; |
69 private final ProfileSyncService mProfileSyncService; | 69 private final ProfileSyncService mProfileSyncService; |
70 private final SyncNotificationController mSyncNotificationController; | 70 private final SyncNotificationController mSyncNotificationController; |
71 | 71 |
72 private SyncController(Context context) { | 72 private SyncController(Context context) { |
73 mContext = context; | 73 mContext = context; |
74 mChromeSigninController = ChromeSigninController.get(mContext); | 74 mChromeSigninController = ChromeSigninController.get(); |
75 AndroidSyncSettings.registerObserver(context, this); | 75 AndroidSyncSettings.registerObserver(context, this); |
76 mProfileSyncService = ProfileSyncService.get(); | 76 mProfileSyncService = ProfileSyncService.get(); |
77 mProfileSyncService.addSyncStateChangedListener(this); | 77 mProfileSyncService.addSyncStateChangedListener(this); |
78 mProfileSyncService.setMasterSyncEnabledProvider( | 78 mProfileSyncService.setMasterSyncEnabledProvider( |
79 new ProfileSyncService.MasterSyncEnabledProvider() { | 79 new ProfileSyncService.MasterSyncEnabledProvider() { |
80 @Override | 80 @Override |
81 public boolean isMasterSyncEnabled() { | 81 public boolean isMasterSyncEnabled() { |
82 return AndroidSyncSettings.isMasterSyncEnabled(mContext)
; | 82 return AndroidSyncSettings.isMasterSyncEnabled(mContext)
; |
83 } | 83 } |
84 }); | 84 }); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 UniqueIdentificationGeneratorFactory.getInstance(GENERATOR_ID); | 233 UniqueIdentificationGeneratorFactory.getInstance(GENERATOR_ID); |
234 String uniqueTag = generator.getUniqueId(null); | 234 String uniqueTag = generator.getUniqueId(null); |
235 if (uniqueTag.isEmpty()) { | 235 if (uniqueTag.isEmpty()) { |
236 Log.e(TAG, "Unable to get unique tag for sync. " | 236 Log.e(TAG, "Unable to get unique tag for sync. " |
237 + "This may lead to unexpected tab sync behavior."); | 237 + "This may lead to unexpected tab sync behavior."); |
238 return; | 238 return; |
239 } | 239 } |
240 mProfileSyncService.setSessionsId(SESSION_TAG_PREFIX + uniqueTag); | 240 mProfileSyncService.setSessionsId(SESSION_TAG_PREFIX + uniqueTag); |
241 } | 241 } |
242 } | 242 } |
OLD | NEW |