OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual void SetSyncSetupCompleted(); | 178 virtual void SetSyncSetupCompleted(); |
179 | 179 |
180 // SyncFrontend implementation. | 180 // SyncFrontend implementation. |
181 virtual void OnBackendInitialized(); | 181 virtual void OnBackendInitialized(); |
182 virtual void OnSyncCycleCompleted(); | 182 virtual void OnSyncCycleCompleted(); |
183 virtual void OnAuthError(); | 183 virtual void OnAuthError(); |
184 virtual void OnStopSyncingPermanently(); | 184 virtual void OnStopSyncingPermanently(); |
185 virtual void OnClearServerDataFailed(); | 185 virtual void OnClearServerDataFailed(); |
186 virtual void OnClearServerDataTimeout(); | 186 virtual void OnClearServerDataTimeout(); |
187 virtual void OnClearServerDataSucceeded(); | 187 virtual void OnClearServerDataSucceeded(); |
| 188 virtual void OnPassphraseRequired(bool for_decryption); |
| 189 virtual void OnPassphraseAccepted(); |
188 | 190 |
189 // Called when a user enters credentials through UI. | 191 // Called when a user enters credentials through UI. |
190 virtual void OnUserSubmittedAuth(const std::string& username, | 192 virtual void OnUserSubmittedAuth(const std::string& username, |
191 const std::string& password, | 193 const std::string& password, |
192 const std::string& captcha, | 194 const std::string& captcha, |
193 const std::string& access_code); | 195 const std::string& access_code); |
194 | 196 |
195 // Update the last auth error and notify observers of error state. | 197 // Update the last auth error and notify observers of error state. |
196 void UpdateAuthErrorState(const GoogleServiceAuthError& error); | 198 void UpdateAuthErrorState(const GoogleServiceAuthError& error); |
197 | 199 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 // If |delete_sync_data_folder| is true, then this method will delete all | 460 // If |delete_sync_data_folder| is true, then this method will delete all |
459 // previous "Sync Data" folders. (useful if the folder is partial/corrupt). | 461 // previous "Sync Data" folders. (useful if the folder is partial/corrupt). |
460 void InitializeBackend(bool delete_sync_data_folder); | 462 void InitializeBackend(bool delete_sync_data_folder); |
461 | 463 |
462 // Initializes the various settings from the command line. | 464 // Initializes the various settings from the command line. |
463 void InitSettings(); | 465 void InitSettings(); |
464 | 466 |
465 // Sets the last synced time to the current time. | 467 // Sets the last synced time to the current time. |
466 void UpdateLastSyncedTime(); | 468 void UpdateLastSyncedTime(); |
467 | 469 |
| 470 void NotifyObservers(); |
| 471 |
468 static const char* GetPrefNameForDataType(syncable::ModelType data_type); | 472 static const char* GetPrefNameForDataType(syncable::ModelType data_type); |
469 | 473 |
470 // Time at which we begin an attempt a GAIA authorization. | 474 // Time at which we begin an attempt a GAIA authorization. |
471 base::TimeTicks auth_start_time_; | 475 base::TimeTicks auth_start_time_; |
472 | 476 |
473 // Time at which error UI is presented for the new tab page. | 477 // Time at which error UI is presented for the new tab page. |
474 base::TimeTicks auth_error_time_; | 478 base::TimeTicks auth_error_time_; |
475 | 479 |
476 // Factory used to create various dependent objects. | 480 // Factory used to create various dependent objects. |
477 ProfileSyncFactory* factory_; | 481 ProfileSyncFactory* factory_; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // and is necessary because the nudge sync framework can drop nudges for | 573 // and is necessary because the nudge sync framework can drop nudges for |
570 // a wide variety of sync-related conditions (throttling, connections issues, | 574 // a wide variety of sync-related conditions (throttling, connections issues, |
571 // syncer paused, etc.). It can only be removed correctly when the framework | 575 // syncer paused, etc.). It can only be removed correctly when the framework |
572 // is reworked to allow one-shot commands like clearing server data. | 576 // is reworked to allow one-shot commands like clearing server data. |
573 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; | 577 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; |
574 | 578 |
575 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 579 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
576 }; | 580 }; |
577 | 581 |
578 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 582 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |