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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 // ProfileSyncService uses this to determine if it's OK to start syncing, or | 483 // ProfileSyncService uses this to determine if it's OK to start syncing, or |
484 // if the user is still setting up the initial sync configuration. | 484 // if the user is still setting up the initial sync configuration. |
485 virtual bool FirstSetupInProgress() const; | 485 virtual bool FirstSetupInProgress() const; |
486 | 486 |
487 // Called by the UI to notify the ProfileSyncService that UI is visible so it | 487 // Called by the UI to notify the ProfileSyncService that UI is visible so it |
488 // will not start syncing. This tells sync whether it's safe to start | 488 // will not start syncing. This tells sync whether it's safe to start |
489 // downloading data types yet (we don't start syncing until after sync setup | 489 // downloading data types yet (we don't start syncing until after sync setup |
490 // is complete). The UI calls this as soon as any part of the signin wizard is | 490 // is complete). The UI calls this as soon as any part of the signin wizard is |
491 // displayed (even just the login UI). | 491 // displayed (even just the login UI). |
492 // If |setup_in_progress| is false, this also kicks the sync engine to ensure | 492 // If |setup_in_progress| is false, this also kicks the sync engine to ensure |
493 // that data download starts. | 493 // that data download starts. |
Nicolas Zea
2014/09/29 17:50:32
nit: comment that this will trigger ReconfigureDat
| |
494 virtual void SetSetupInProgress(bool setup_in_progress); | 494 virtual void SetSetupInProgress(bool setup_in_progress); |
495 | 495 |
496 // Reconfigures the data type manager with the latest enabled types. | |
497 // Note: Does not initialize the backend if it is not already initialized. | |
498 // This function needs to be called only after sync has been initialized | |
499 // (i.e.,only for reconfigurations). The reason we don't initialize the | |
500 // backend is because if we had encountered an unrecoverable error we don't | |
501 // want to startup once more. | |
502 virtual void ReconfigureDatatypeManager(); | |
503 | |
496 // Returns true if the SyncBackendHost has told us it's ready to accept | 504 // Returns true if the SyncBackendHost has told us it's ready to accept |
497 // changes. | 505 // changes. |
498 // [REMARK] - it is safe to call this function only from the ui thread. | 506 // [REMARK] - it is safe to call this function only from the ui thread. |
499 // because the variable is not thread safe and should only be accessed from | 507 // because the variable is not thread safe and should only be accessed from |
500 // single thread. If we want multiple threads to access this(and there is | 508 // single thread. If we want multiple threads to access this(and there is |
501 // currently no need to do so) we need to protect this with a lock. | 509 // currently no need to do so) we need to protect this with a lock. |
502 // TODO(timsteele): What happens if the bookmark model is loaded, a change | 510 // TODO(timsteele): What happens if the bookmark model is loaded, a change |
503 // takes place, and the backend isn't initialized yet? | 511 // takes place, and the backend isn't initialized yet? |
504 virtual bool sync_initialized() const; | 512 virtual bool sync_initialized() const; |
505 | 513 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
908 virtual void StartUpSlowBackendComponents(BackendMode mode); | 916 virtual void StartUpSlowBackendComponents(BackendMode mode); |
909 | 917 |
910 // About-flags experiment names for datatypes that aren't enabled by default | 918 // About-flags experiment names for datatypes that aren't enabled by default |
911 // yet. | 919 // yet. |
912 static std::string GetExperimentNameForDataType( | 920 static std::string GetExperimentNameForDataType( |
913 syncer::ModelType data_type); | 921 syncer::ModelType data_type); |
914 | 922 |
915 // Create and register a new datatype controller. | 923 // Create and register a new datatype controller. |
916 void RegisterNewDataType(syncer::ModelType data_type); | 924 void RegisterNewDataType(syncer::ModelType data_type); |
917 | 925 |
918 // Reconfigures the data type manager with the latest enabled types. | |
919 // Note: Does not initialize the backend if it is not already initialized. | |
920 // This function needs to be called only after sync has been initialized | |
921 // (i.e.,only for reconfigurations). The reason we don't initialize the | |
922 // backend is because if we had encountered an unrecoverable error we don't | |
923 // want to startup once more. | |
924 virtual void ReconfigureDatatypeManager(); | |
925 | |
926 // Collects preferred sync data types from |preference_providers_|. | 926 // Collects preferred sync data types from |preference_providers_|. |
927 syncer::ModelTypeSet GetDataTypesFromPreferenceProviders() const; | 927 syncer::ModelTypeSet GetDataTypesFromPreferenceProviders() const; |
928 | 928 |
929 // Called when the user changes the sync configuration, to update the UMA | 929 // Called when the user changes the sync configuration, to update the UMA |
930 // stats. | 930 // stats. |
931 void UpdateSelectedTypesHistogram( | 931 void UpdateSelectedTypesHistogram( |
932 bool sync_everything, | 932 bool sync_everything, |
933 const syncer::ModelTypeSet chosen_types) const; | 933 const syncer::ModelTypeSet chosen_types) const; |
934 | 934 |
935 #if defined(OS_CHROMEOS) | 935 #if defined(OS_CHROMEOS) |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1156 scoped_ptr<base::Time> last_backup_time_; | 1156 scoped_ptr<base::Time> last_backup_time_; |
1157 | 1157 |
1158 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1158 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
1159 }; | 1159 }; |
1160 | 1160 |
1161 bool ShouldShowActionOnUI( | 1161 bool ShouldShowActionOnUI( |
1162 const syncer::SyncProtocolError& error); | 1162 const syncer::SyncProtocolError& error); |
1163 | 1163 |
1164 | 1164 |
1165 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1165 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |