OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Sync configuration is accomplished via the following APIs: | 119 // Sync configuration is accomplished via the following APIs: |
120 // * OnUserChoseDatatypes(): Set the data types the user wants to sync. | 120 // * OnUserChoseDatatypes(): Set the data types the user wants to sync. |
121 // * SetDecryptionPassphrase(): Attempt to decrypt the user's encrypted data | 121 // * SetDecryptionPassphrase(): Attempt to decrypt the user's encrypted data |
122 // using the passed passphrase. | 122 // using the passed passphrase. |
123 // * SetEncryptionPassphrase(): Re-encrypt the user's data using the passed | 123 // * SetEncryptionPassphrase(): Re-encrypt the user's data using the passed |
124 // passphrase. | 124 // passphrase. |
125 // | 125 // |
126 // Additionally, the current sync configuration can be fetched by calling | 126 // Additionally, the current sync configuration can be fetched by calling |
127 // * GetRegisteredDataTypes() | 127 // * GetRegisteredDataTypes() |
128 // * GetPreferredDataTypes() | 128 // * GetPreferredDataTypes() |
| 129 // * GetActiveDataTypes() |
129 // * IsUsingSecondaryPassphrase() | 130 // * IsUsingSecondaryPassphrase() |
130 // * EncryptEverythingEnabled() | 131 // * EncryptEverythingEnabled() |
131 // * IsPassphraseRequired()/IsPassphraseRequiredForDecryption() | 132 // * IsPassphraseRequired()/IsPassphraseRequiredForDecryption() |
132 // | 133 // |
133 // The "sync everything" state cannot be read from ProfileSyncService, but | 134 // The "sync everything" state cannot be read from ProfileSyncService, but |
134 // is instead pulled from SyncPrefs.HasKeepEverythingSynced(). | 135 // is instead pulled from SyncPrefs.HasKeepEverythingSynced(). |
135 // | 136 // |
136 // Initial sync setup: | 137 // Initial sync setup: |
137 // | 138 // |
138 // For privacy reasons, it is usually desirable to avoid syncing any data | 139 // For privacy reasons, it is usually desirable to avoid syncing any data |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 227 |
227 // Initializes the object. This must be called at most once, and | 228 // Initializes the object. This must be called at most once, and |
228 // immediately after an object of this class is constructed. | 229 // immediately after an object of this class is constructed. |
229 void Initialize(); | 230 void Initialize(); |
230 | 231 |
231 virtual void SetSyncSetupCompleted(); | 232 virtual void SetSyncSetupCompleted(); |
232 | 233 |
233 // ProfileSyncServiceBase implementation. | 234 // ProfileSyncServiceBase implementation. |
234 virtual bool HasSyncSetupCompleted() const OVERRIDE; | 235 virtual bool HasSyncSetupCompleted() const OVERRIDE; |
235 virtual bool ShouldPushChanges() OVERRIDE; | 236 virtual bool ShouldPushChanges() OVERRIDE; |
236 virtual syncer::ModelTypeSet GetPreferredDataTypes() const OVERRIDE; | 237 virtual syncer::ModelTypeSet GetActiveDataTypes() const OVERRIDE; |
237 virtual void AddObserver(Observer* observer) OVERRIDE; | 238 virtual void AddObserver(Observer* observer) OVERRIDE; |
238 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 239 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
239 virtual bool HasObserver(Observer* observer) const OVERRIDE; | 240 virtual bool HasObserver(Observer* observer) const OVERRIDE; |
240 | 241 |
241 void RegisterAuthNotifications(); | 242 void RegisterAuthNotifications(); |
242 | 243 |
243 // Returns true if sync is enabled/not suppressed and the user is logged in. | 244 // Returns true if sync is enabled/not suppressed and the user is logged in. |
244 // (being logged in does not mean that tokens are available - tokens may | 245 // (being logged in does not mean that tokens are available - tokens may |
245 // be missing because they have not loaded yet, or because they were deleted | 246 // be missing because they have not loaded yet, or because they were deleted |
246 // due to http://crbug.com/121755). | 247 // due to http://crbug.com/121755). |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 const content::NotificationSource& source, | 493 const content::NotificationSource& source, |
493 const content::NotificationDetails& details) OVERRIDE; | 494 const content::NotificationDetails& details) OVERRIDE; |
494 | 495 |
495 // Changes which data types we're going to be syncing to |preferred_types|. | 496 // Changes which data types we're going to be syncing to |preferred_types|. |
496 // If it is running, the DataTypeManager will be instructed to reconfigure | 497 // If it is running, the DataTypeManager will be instructed to reconfigure |
497 // the sync backend so that exactly these datatypes are actively synced. See | 498 // the sync backend so that exactly these datatypes are actively synced. See |
498 // class comment for more on what it means for a datatype to be Preferred. | 499 // class comment for more on what it means for a datatype to be Preferred. |
499 virtual void ChangePreferredDataTypes( | 500 virtual void ChangePreferredDataTypes( |
500 syncer::ModelTypeSet preferred_types); | 501 syncer::ModelTypeSet preferred_types); |
501 | 502 |
| 503 // Returns the set of types which are preferred for enabling. This is a |
| 504 // superset of the active types (see GetActiveTypes()). |
| 505 virtual syncer::ModelTypeSet GetPreferredDataTypes() const; |
| 506 |
502 // Gets the set of all data types that could be allowed (the set that | 507 // Gets the set of all data types that could be allowed (the set that |
503 // should be advertised to the user). These will typically only change | 508 // should be advertised to the user). These will typically only change |
504 // via a command-line option. See class comment for more on what it means | 509 // via a command-line option. See class comment for more on what it means |
505 // for a datatype to be Registered. | 510 // for a datatype to be Registered. |
506 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; | 511 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; |
507 | 512 |
508 // Checks whether the Cryptographer is ready to encrypt and decrypt updates | 513 // Checks whether the Cryptographer is ready to encrypt and decrypt updates |
509 // for sensitive data types. Caller must be holding a | 514 // for sensitive data types. Caller must be holding a |
510 // syncapi::BaseTransaction to ensure thread safety. | 515 // syncapi::BaseTransaction to ensure thread safety. |
511 virtual bool IsCryptographerReady( | 516 virtual bool IsCryptographerReady( |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; | 955 syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
951 | 956 |
952 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 957 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
953 }; | 958 }; |
954 | 959 |
955 bool ShouldShowActionOnUI( | 960 bool ShouldShowActionOnUI( |
956 const syncer::SyncProtocolError& error); | 961 const syncer::SyncProtocolError& error); |
957 | 962 |
958 | 963 |
959 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 964 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |