| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void RegisterAuthNotifications(); | 157 void RegisterAuthNotifications(); |
| 158 | 158 |
| 159 // Return whether all sync tokens are loaded and | 159 // Return whether all sync tokens are loaded and |
| 160 // available for the backend to start up. | 160 // available for the backend to start up. |
| 161 bool AreCredentialsAvailable(); | 161 bool AreCredentialsAvailable(); |
| 162 | 162 |
| 163 // Registers a data type controller with the sync service. This | 163 // Registers a data type controller with the sync service. This |
| 164 // makes the data type controller available for use, it does not | 164 // makes the data type controller available for use, it does not |
| 165 // enable or activate the synchronization of the data type (see | 165 // enable or activate the synchronization of the data type (see |
| 166 // ActivateDataType). Takes ownership of the pointer. | 166 // ActivateDataType). Takes ownership of the pointer. |
| 167 void RegisterDataTypeController( | 167 virtual void RegisterDataTypeController( |
| 168 browser_sync::DataTypeController* data_type_controller); | 168 browser_sync::DataTypeController* data_type_controller); |
| 169 | 169 |
| 170 // Returns the session model associator associated with this type, but only if | 170 // Returns the session model associator associated with this type, but only if |
| 171 // the associator is running. If it is doing anything else, it will return | 171 // the associator is running. If it is doing anything else, it will return |
| 172 // null. | 172 // null. |
| 173 browser_sync::SessionModelAssociator* GetSessionModelAssociator(); | 173 browser_sync::SessionModelAssociator* GetSessionModelAssociator(); |
| 174 | 174 |
| 175 // Maintain state of where we are in a server clear operation. | 175 // Maintain state of where we are in a server clear operation. |
| 176 void ResetClearServerDataState(); | 176 void ResetClearServerDataState(); |
| 177 ClearServerDataState GetClearServerDataState(); | 177 ClearServerDataState GetClearServerDataState(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 200 virtual void OnStopSyncingPermanently() OVERRIDE; | 200 virtual void OnStopSyncingPermanently() OVERRIDE; |
| 201 virtual void OnClearServerDataFailed() OVERRIDE; | 201 virtual void OnClearServerDataFailed() OVERRIDE; |
| 202 virtual void OnClearServerDataSucceeded() OVERRIDE; | 202 virtual void OnClearServerDataSucceeded() OVERRIDE; |
| 203 virtual void OnPassphraseRequired( | 203 virtual void OnPassphraseRequired( |
| 204 sync_api::PassphraseRequiredReason reason) OVERRIDE; | 204 sync_api::PassphraseRequiredReason reason) OVERRIDE; |
| 205 virtual void OnPassphraseAccepted() OVERRIDE; | 205 virtual void OnPassphraseAccepted() OVERRIDE; |
| 206 virtual void OnEncryptionComplete( | 206 virtual void OnEncryptionComplete( |
| 207 const syncable::ModelTypeSet& encrypted_types) OVERRIDE; | 207 const syncable::ModelTypeSet& encrypted_types) OVERRIDE; |
| 208 virtual void OnMigrationNeededForTypes( | 208 virtual void OnMigrationNeededForTypes( |
| 209 const syncable::ModelTypeSet& types) OVERRIDE; | 209 const syncable::ModelTypeSet& types) OVERRIDE; |
| 210 virtual void OnDataTypesChanged( |
| 211 const syncable::ModelTypeSet& to_add) OVERRIDE; |
| 210 | 212 |
| 211 void OnClearServerDataTimeout(); | 213 void OnClearServerDataTimeout(); |
| 212 | 214 |
| 213 // Called when a user enters credentials through UI. | 215 // Called when a user enters credentials through UI. |
| 214 virtual void OnUserSubmittedAuth(const std::string& username, | 216 virtual void OnUserSubmittedAuth(const std::string& username, |
| 215 const std::string& password, | 217 const std::string& password, |
| 216 const std::string& captcha, | 218 const std::string& captcha, |
| 217 const std::string& access_code); | 219 const std::string& access_code); |
| 218 | 220 |
| 219 // Update the last auth error and notify observers of error state. | 221 // Update the last auth error and notify observers of error state. |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // Initializes the various settings from the command line. | 545 // Initializes the various settings from the command line. |
| 544 void InitSettings(); | 546 void InitSettings(); |
| 545 | 547 |
| 546 // Sets the last synced time to the current time. | 548 // Sets the last synced time to the current time. |
| 547 void UpdateLastSyncedTime(); | 549 void UpdateLastSyncedTime(); |
| 548 | 550 |
| 549 void NotifyObservers(); | 551 void NotifyObservers(); |
| 550 | 552 |
| 551 static const char* GetPrefNameForDataType(syncable::ModelType data_type); | 553 static const char* GetPrefNameForDataType(syncable::ModelType data_type); |
| 552 | 554 |
| 555 // About-flags experiment names for datatypes that aren't enabled by default |
| 556 // yet. |
| 557 static std::string GetExperimentNameForDataType( |
| 558 syncable::ModelType data_type); |
| 559 |
| 560 // Create and register a new datatype controller. |
| 561 void RegisterNewDataType(syncable::ModelType data_type); |
| 562 |
| 553 // Time at which we begin an attempt a GAIA authorization. | 563 // Time at which we begin an attempt a GAIA authorization. |
| 554 base::TimeTicks auth_start_time_; | 564 base::TimeTicks auth_start_time_; |
| 555 | 565 |
| 556 // Time at which error UI is presented for the new tab page. | 566 // Time at which error UI is presented for the new tab page. |
| 557 base::TimeTicks auth_error_time_; | 567 base::TimeTicks auth_error_time_; |
| 558 | 568 |
| 559 // Factory used to create various dependent objects. | 569 // Factory used to create various dependent objects. |
| 560 ProfileSyncFactory* factory_; | 570 ProfileSyncFactory* factory_; |
| 561 | 571 |
| 562 // The profile whose data we are synchronizing. | 572 // The profile whose data we are synchronizing. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // and cached until the syncer either finishes encryption | 659 // and cached until the syncer either finishes encryption |
| 650 // (OnEncryptionComplete) or the user cancels. | 660 // (OnEncryptionComplete) or the user cancels. |
| 651 syncable::ModelTypeSet pending_types_for_encryption_; | 661 syncable::ModelTypeSet pending_types_for_encryption_; |
| 652 | 662 |
| 653 scoped_ptr<browser_sync::BackendMigrator> migrator_; | 663 scoped_ptr<browser_sync::BackendMigrator> migrator_; |
| 654 | 664 |
| 655 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 665 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 656 }; | 666 }; |
| 657 | 667 |
| 658 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 668 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |