| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/keyed_service/core/keyed_service.h" |
| 16 #include "components/sync/base/model_type.h" | 17 #include "components/sync/base/model_type.h" |
| 17 #include "components/sync/driver/data_type_encryption_handler.h" | 18 #include "components/sync/driver/data_type_encryption_handler.h" |
| 18 #include "components/sync/driver/sync_service_observer.h" | 19 #include "components/sync/driver/sync_service_observer.h" |
| 19 #include "components/sync/engine/connection_status.h" | 20 #include "components/sync/engine/connection_status.h" |
| 20 #include "google_apis/gaia/google_service_auth_error.h" | 21 #include "google_apis/gaia/google_service_auth_error.h" |
| 21 | 22 |
| 22 class GoogleServiceAuthError; | 23 class GoogleServiceAuthError; |
| 23 class SigninManagerBase; | 24 class SigninManagerBase; |
| 24 | 25 |
| 25 namespace sync_sessions { | 26 namespace sync_sessions { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // UIs should not construct this directly, but instead call | 66 // UIs should not construct this directly, but instead call |
| 66 // SyncService::GetSetupInProgress(). | 67 // SyncService::GetSetupInProgress(). |
| 67 explicit SyncSetupInProgressHandle(base::Closure on_destroy); | 68 explicit SyncSetupInProgressHandle(base::Closure on_destroy); |
| 68 | 69 |
| 69 ~SyncSetupInProgressHandle(); | 70 ~SyncSetupInProgressHandle(); |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 base::Closure on_destroy_; | 73 base::Closure on_destroy_; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 class SyncService : public DataTypeEncryptionHandler { | 76 class SyncService : public DataTypeEncryptionHandler, public KeyedService { |
| 76 public: | 77 public: |
| 77 // Used to specify the kind of passphrase with which sync data is encrypted. | 78 // Used to specify the kind of passphrase with which sync data is encrypted. |
| 78 enum PassphraseType { | 79 enum PassphraseType { |
| 79 IMPLICIT, // The user did not provide a custom passphrase for encryption. | 80 IMPLICIT, // The user did not provide a custom passphrase for encryption. |
| 80 // We implicitly use the GAIA password in such cases. | 81 // We implicitly use the GAIA password in such cases. |
| 81 EXPLICIT, // The user selected the "use custom passphrase" radio button | 82 EXPLICIT, // The user selected the "use custom passphrase" radio button |
| 82 // during sync setup and provided a passphrase. | 83 // during sync setup and provided a passphrase. |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 // Passed as an argument to RequestStop to control whether or not the sync | 86 // Passed as an argument to RequestStop to control whether or not the sync |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 protected: | 356 protected: |
| 356 SyncService() {} | 357 SyncService() {} |
| 357 | 358 |
| 358 private: | 359 private: |
| 359 DISALLOW_COPY_AND_ASSIGN(SyncService); | 360 DISALLOW_COPY_AND_ASSIGN(SyncService); |
| 360 }; | 361 }; |
| 361 | 362 |
| 362 } // namespace syncer | 363 } // namespace syncer |
| 363 | 364 |
| 364 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ | 365 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_H_ |
| OLD | NEW |