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

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

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698