| 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.components.sync; | 5 package org.chromium.components.sync; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.content.ContentResolver; | 8 import android.content.ContentResolver; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.SyncStatusObserver; | 10 import android.content.SyncStatusObserver; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 private static AndroidSyncSettings sInstance; | 42 private static AndroidSyncSettings sInstance; |
| 43 | 43 |
| 44 private final Object mLock = new Object(); | 44 private final Object mLock = new Object(); |
| 45 | 45 |
| 46 private final String mContractAuthority; | 46 private final String mContractAuthority; |
| 47 | 47 |
| 48 private final Context mApplicationContext; | 48 private final Context mApplicationContext; |
| 49 | 49 |
| 50 private final SyncContentResolverDelegate mSyncContentResolverDelegate; | 50 private final SyncContentResolverDelegate mSyncContentResolverDelegate; |
| 51 | 51 |
| 52 private Account mAccount = null; | 52 private Account mAccount; |
| 53 | 53 |
| 54 private boolean mIsSyncable = false; | 54 private boolean mIsSyncable; |
| 55 | 55 |
| 56 private boolean mChromeSyncEnabled = false; | 56 private boolean mChromeSyncEnabled; |
| 57 | 57 |
| 58 private boolean mMasterSyncEnabled = false; | 58 private boolean mMasterSyncEnabled; |
| 59 | 59 |
| 60 private final ObserverList<AndroidSyncSettingsObserver> mObservers = | 60 private final ObserverList<AndroidSyncSettingsObserver> mObservers = |
| 61 new ObserverList<AndroidSyncSettingsObserver>(); | 61 new ObserverList<AndroidSyncSettingsObserver>(); |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Provides notifications when Android sync settings have changed. | 64 * Provides notifications when Android sync settings have changed. |
| 65 */ | 65 */ |
| 66 public interface AndroidSyncSettingsObserver { public void androidSyncSettin
gsChanged(); } | 66 public interface AndroidSyncSettingsObserver { public void androidSyncSettin
gsChanged(); } |
| 67 | 67 |
| 68 private static void ensureInitialized(Context context) { | 68 private static void ensureInitialized(Context context) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 private void notifyObservers() { | 298 private void notifyObservers() { |
| 299 for (AndroidSyncSettingsObserver observer : mObservers) { | 299 for (AndroidSyncSettingsObserver observer : mObservers) { |
| 300 observer.androidSyncSettingsChanged(); | 300 observer.androidSyncSettingsChanged(); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 private String getContractAuthority() { | 304 private String getContractAuthority() { |
| 305 return mApplicationContext.getPackageName(); | 305 return mApplicationContext.getPackageName(); |
| 306 } | 306 } |
| 307 } | 307 } |
| OLD | NEW |