| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 SigninManager* signin, | 173 SigninManager* signin, |
| 174 StartBehavior start_behavior); | 174 StartBehavior start_behavior); |
| 175 virtual ~ProfileSyncService(); | 175 virtual ~ProfileSyncService(); |
| 176 | 176 |
| 177 // Initializes the object. This should be called every time an object of this | 177 // Initializes the object. This should be called every time an object of this |
| 178 // class is constructed. | 178 // class is constructed. |
| 179 void Initialize(); | 179 void Initialize(); |
| 180 | 180 |
| 181 void RegisterAuthNotifications(); | 181 void RegisterAuthNotifications(); |
| 182 | 182 |
| 183 // Returns true if sync is enabled/not suppressed and the user is logged in. |
| 184 // (being logged in does not mean that tokens are available - tokens may |
| 185 // be missing because they have not loaded yet, or because they were deleted |
| 186 // due to http://crbug.com/121755). |
| 187 // Virtual to enable mocking in tests. |
| 188 virtual bool IsSyncEnabledAndLoggedIn(); |
| 189 |
| 183 // Return whether all sync tokens are loaded and available for the backend to | 190 // Return whether all sync tokens are loaded and available for the backend to |
| 184 // start up. Virtual to enable mocking in tests. | 191 // start up. Virtual to enable mocking in tests. |
| 185 virtual bool AreCredentialsAvailable(); | 192 virtual bool IsSyncTokenAvailable(); |
| 186 | 193 |
| 187 // Registers a data type controller with the sync service. This | 194 // Registers a data type controller with the sync service. This |
| 188 // makes the data type controller available for use, it does not | 195 // makes the data type controller available for use, it does not |
| 189 // enable or activate the synchronization of the data type (see | 196 // enable or activate the synchronization of the data type (see |
| 190 // ActivateDataType). Takes ownership of the pointer. | 197 // ActivateDataType). Takes ownership of the pointer. |
| 191 void RegisterDataTypeController( | 198 void RegisterDataTypeController( |
| 192 browser_sync::DataTypeController* data_type_controller); | 199 browser_sync::DataTypeController* data_type_controller); |
| 193 | 200 |
| 194 // Returns the session model associator associated with this type, but only if | 201 // Returns the session model associator associated with this type, but only if |
| 195 // the associator is running. If it is doing anything else, it will return | 202 // the associator is running. If it is doing anything else, it will return |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 browser_sync::Experiments current_experiments; | 753 browser_sync::Experiments current_experiments; |
| 747 | 754 |
| 748 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 755 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 749 }; | 756 }; |
| 750 | 757 |
| 751 bool ShouldShowActionOnUI( | 758 bool ShouldShowActionOnUI( |
| 752 const browser_sync::SyncProtocolError& error); | 759 const browser_sync::SyncProtocolError& error); |
| 753 | 760 |
| 754 | 761 |
| 755 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 762 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |