Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 // to start up. Virtual to enable mocking in tests. | 293 // to start up. Virtual to enable mocking in tests. |
| 294 virtual bool IsOAuthRefreshTokenAvailable(); | 294 virtual bool IsOAuthRefreshTokenAvailable(); |
| 295 | 295 |
| 296 // Registers a data type controller with the sync service. This | 296 // Registers a data type controller with the sync service. This |
| 297 // makes the data type controller available for use, it does not | 297 // makes the data type controller available for use, it does not |
| 298 // enable or activate the synchronization of the data type (see | 298 // enable or activate the synchronization of the data type (see |
| 299 // ActivateDataType). Takes ownership of the pointer. | 299 // ActivateDataType). Takes ownership of the pointer. |
| 300 void RegisterDataTypeController( | 300 void RegisterDataTypeController( |
| 301 browser_sync::DataTypeController* data_type_controller); | 301 browser_sync::DataTypeController* data_type_controller); |
| 302 | 302 |
| 303 // Registers a type whose sync storage will not be managed by the | |
| 304 // ProfileSyncService. It declares that this sync type may be activated at | |
| 305 // some point in the future. This function call does not enable or activate | |
| 306 // the syncing of this type | |
| 307 void RegisterNonBlockingType(syncer::ModelType type); | |
| 308 | |
| 303 // Returns the session model associator associated with this type, but only if | 309 // Returns the session model associator associated with this type, but only if |
| 304 // the associator is running. If it is doing anything else, it will return | 310 // the associator is running. If it is doing anything else, it will return |
| 305 // null. | 311 // null. |
| 306 // | 312 // |
| 307 // *** DONT USE THIS ANYMORE! *** | 313 // *** DONT USE THIS ANYMORE! *** |
| 308 // If you think you want to use this, think again! Can you use | 314 // If you think you want to use this, think again! Can you use |
| 309 // GetOpenTabsUIDelegate instead? | 315 // GetOpenTabsUIDelegate instead? |
| 310 // TODO(tim): Remove this method. | 316 // TODO(tim): Remove this method. |
| 311 virtual browser_sync::SessionModelAssociator* | 317 virtual browser_sync::SessionModelAssociator* |
| 312 GetSessionModelAssociatorDeprecated(); | 318 GetSessionModelAssociatorDeprecated(); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 // If it is running, the DataTypeManager will be instructed to reconfigure | 577 // If it is running, the DataTypeManager will be instructed to reconfigure |
| 572 // the sync backend so that exactly these datatypes are actively synced. See | 578 // the sync backend so that exactly these datatypes are actively synced. See |
| 573 // class comment for more on what it means for a datatype to be Preferred. | 579 // class comment for more on what it means for a datatype to be Preferred. |
| 574 virtual void ChangePreferredDataTypes( | 580 virtual void ChangePreferredDataTypes( |
| 575 syncer::ModelTypeSet preferred_types); | 581 syncer::ModelTypeSet preferred_types); |
| 576 | 582 |
| 577 // Returns the set of types which are preferred for enabling. This is a | 583 // Returns the set of types which are preferred for enabling. This is a |
| 578 // superset of the active types (see GetActiveDataTypes()). | 584 // superset of the active types (see GetActiveDataTypes()). |
| 579 virtual syncer::ModelTypeSet GetPreferredDataTypes() const; | 585 virtual syncer::ModelTypeSet GetPreferredDataTypes() const; |
| 580 | 586 |
| 587 // Returns the set of directory types which are preferred for enabling. | |
| 588 virtual syncer::ModelTypeSet GetPreferredDirectoryDataTypes() const; | |
| 589 | |
| 590 // Returns the set of off-thread types which are preferred for enabling. | |
| 591 virtual syncer::ModelTypeSet GetPreferredNonBlockingDataTypes() const; | |
| 592 | |
| 581 // Gets the set of all data types that could be allowed (the set that | 593 // Gets the set of all data types that could be allowed (the set that |
| 582 // should be advertised to the user). These will typically only change | 594 // should be advertised to the user). These will typically only change |
| 583 // via a command-line option. See class comment for more on what it means | 595 // via a command-line option. See class comment for more on what it means |
| 584 // for a datatype to be Registered. | 596 // for a datatype to be Registered. |
| 585 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; | 597 virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; |
| 586 | 598 |
| 599 // Gets the set of directory types which could be allowed. | |
| 600 virtual syncer::ModelTypeSet GetRegisteredDirectoryDataTypes() const; | |
| 601 | |
| 602 // Gets the set of off-thread types which could be allowed. | |
| 603 virtual syncer::ModelTypeSet GetRegisteredNonBlockingDataTypes() const; | |
| 604 | |
| 587 // Checks whether the Cryptographer is ready to encrypt and decrypt updates | 605 // Checks whether the Cryptographer is ready to encrypt and decrypt updates |
| 588 // for sensitive data types. Caller must be holding a | 606 // for sensitive data types. Caller must be holding a |
| 589 // syncapi::BaseTransaction to ensure thread safety. | 607 // syncapi::BaseTransaction to ensure thread safety. |
| 590 virtual bool IsCryptographerReady( | 608 virtual bool IsCryptographerReady( |
| 591 const syncer::BaseTransaction* trans) const; | 609 const syncer::BaseTransaction* trans) const; |
| 592 | 610 |
| 593 // Returns true if a secondary (explicit) passphrase is being used. It is not | 611 // Returns true if a secondary (explicit) passphrase is being used. It is not |
| 594 // legal to call this method before the backend is initialized. | 612 // legal to call this method before the backend is initialized. |
| 595 virtual bool IsUsingSecondaryPassphrase() const; | 613 virtual bool IsUsingSecondaryPassphrase() const; |
| 596 | 614 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 883 // OnConfigureDone is called. | 901 // OnConfigureDone is called. |
| 884 base::Time sync_configure_start_time_; | 902 base::Time sync_configure_start_time_; |
| 885 | 903 |
| 886 // Indicates if this is the first time sync is being configured. This value | 904 // Indicates if this is the first time sync is being configured. This value |
| 887 // is equal to !HasSyncSetupCompleted() at the time of OnBackendInitialized(). | 905 // is equal to !HasSyncSetupCompleted() at the time of OnBackendInitialized(). |
| 888 bool is_first_time_sync_configure_; | 906 bool is_first_time_sync_configure_; |
| 889 | 907 |
| 890 // List of available data type controllers. | 908 // List of available data type controllers. |
| 891 browser_sync::DataTypeController::TypeMap data_type_controllers_; | 909 browser_sync::DataTypeController::TypeMap data_type_controllers_; |
| 892 | 910 |
| 911 // List of types that may be synced off-thread. | |
|
Nicolas Zea
2014/04/02 23:19:05
nit: prefer not using off-thread as a term. Direct
rlarocque
2014/04/03 01:03:46
My bad. I think we discussed this in the review f
| |
| 912 syncer::ModelTypeSet off_thread_types_; | |
| 913 | |
| 893 // Whether the SyncBackendHost has been initialized. | 914 // Whether the SyncBackendHost has been initialized. |
| 894 bool backend_initialized_; | 915 bool backend_initialized_; |
| 895 | 916 |
| 896 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents | 917 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents |
| 897 // ProfileSyncService from starting backend till browser restarted or user | 918 // ProfileSyncService from starting backend till browser restarted or user |
| 898 // signed out. | 919 // signed out. |
| 899 bool sync_disabled_by_admin_; | 920 bool sync_disabled_by_admin_; |
| 900 | 921 |
| 901 // Set to true if a signin has completed but we're still waiting for the | 922 // Set to true if a signin has completed but we're still waiting for the |
| 902 // backend to refresh its credentials. | 923 // backend to refresh its credentials. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1012 browser_sync::StartupController startup_controller_; | 1033 browser_sync::StartupController startup_controller_; |
| 1013 | 1034 |
| 1014 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1035 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 1015 }; | 1036 }; |
| 1016 | 1037 |
| 1017 bool ShouldShowActionOnUI( | 1038 bool ShouldShowActionOnUI( |
| 1018 const syncer::SyncProtocolError& error); | 1039 const syncer::SyncProtocolError& error); |
| 1019 | 1040 |
| 1020 | 1041 |
| 1021 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1042 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |