| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // command-line switches). | 345 // command-line switches). |
| 346 static bool IsSyncEnabled(); | 346 static bool IsSyncEnabled(); |
| 347 | 347 |
| 348 // Returns whether sync is managed, i.e. controlled by configuration | 348 // Returns whether sync is managed, i.e. controlled by configuration |
| 349 // management. If so, the user is not allowed to configure sync. | 349 // management. If so, the user is not allowed to configure sync. |
| 350 bool IsManaged(); | 350 bool IsManaged(); |
| 351 | 351 |
| 352 // UnrecoverableErrorHandler implementation. | 352 // UnrecoverableErrorHandler implementation. |
| 353 virtual void OnUnrecoverableError( | 353 virtual void OnUnrecoverableError( |
| 354 const tracked_objects::Location& from_here, | 354 const tracked_objects::Location& from_here, |
| 355 const std::string& message); | 355 const std::string& message) OVERRIDE; |
| 356 | 356 |
| 357 // The functions below (until ActivateDataType()) should only be | 357 // The functions below (until ActivateDataType()) should only be |
| 358 // called if sync_initialized() is true. | 358 // called if sync_initialized() is true. |
| 359 | 359 |
| 360 // TODO(akalin): This is called mostly by ModelAssociators and | 360 // TODO(akalin): This is called mostly by ModelAssociators and |
| 361 // tests. Figure out how to pass the handle to the ModelAssociators | 361 // tests. Figure out how to pass the handle to the ModelAssociators |
| 362 // directly, figure out how to expose this to tests, and remove this | 362 // directly, figure out how to expose this to tests, and remove this |
| 363 // function. | 363 // function. |
| 364 sync_api::UserShare* GetUserShare() const; | 364 sync_api::UserShare* GetUserShare() const; |
| 365 | 365 |
| 366 // TODO(akalin): These two functions are used only by | 366 // TODO(akalin): These two functions are used only by |
| 367 // ProfileSyncServiceHarness. Figure out a different way to expose | 367 // ProfileSyncServiceHarness. Figure out a different way to expose |
| 368 // this info to that class, and remove these functions. | 368 // this info to that class, and remove these functions. |
| 369 | 369 |
| 370 virtual const browser_sync::sessions::SyncSessionSnapshot* | 370 virtual const browser_sync::sessions::SyncSessionSnapshot* |
| 371 GetLastSessionSnapshot() const; | 371 GetLastSessionSnapshot() const; |
| 372 | 372 |
| 373 // Returns whether or not the underlying sync engine has made any | 373 // Returns whether or not the underlying sync engine has made any |
| 374 // local changes to items that have not yet been synced with the | 374 // local changes to items that have not yet been synced with the |
| 375 // server. | 375 // server. |
| 376 bool HasUnsyncedItems() const; | 376 bool HasUnsyncedItems() const; |
| 377 | 377 |
| 378 // Logs the current unsynced items in the sync database. Useful for debugging. | 378 // Logs the current unsynced items in the sync database. Useful for debugging. |
| 379 void LogUnsyncedItems(int level) const; | 379 void LogUnsyncedItems(int level) const; |
| 380 | 380 |
| 381 // Returns whether or not the sync service is reconfiguring due | 381 // Used by ProfileSyncServiceHarness. May return NULL. |
| 382 // to server-initiated resynchronization. | 382 browser_sync::BackendMigrator* GetBackendMigratorForTest(); |
| 383 bool HasPendingBackendMigration() const; | |
| 384 | 383 |
| 385 // Get the current routing information for all enabled model types. | 384 // Get the current routing information for all enabled model types. |
| 386 // If a model type is not enabled (that is, if the syncer should not | 385 // If a model type is not enabled (that is, if the syncer should not |
| 387 // be trying to sync it), it is not in this map. | 386 // be trying to sync it), it is not in this map. |
| 388 // | 387 // |
| 389 // TODO(akalin): This function is used by | 388 // TODO(akalin): This function is used by |
| 390 // sync_ui_util::ConstructAboutInformation() and by some test | 389 // sync_ui_util::ConstructAboutInformation() and by some test |
| 391 // classes. Figure out a different way to expose this info and | 390 // classes. Figure out a different way to expose this info and |
| 392 // remove this function. | 391 // remove this function. |
| 393 void GetModelSafeRoutingInfo( | 392 void GetModelSafeRoutingInfo( |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 // (OnEncryptionComplete) or the user cancels. | 660 // (OnEncryptionComplete) or the user cancels. |
| 662 syncable::ModelTypeSet pending_types_for_encryption_; | 661 syncable::ModelTypeSet pending_types_for_encryption_; |
| 663 bool set_backend_encrypted_types_; | 662 bool set_backend_encrypted_types_; |
| 664 | 663 |
| 665 scoped_ptr<browser_sync::BackendMigrator> migrator_; | 664 scoped_ptr<browser_sync::BackendMigrator> migrator_; |
| 666 | 665 |
| 667 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 666 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 668 }; | 667 }; |
| 669 | 668 |
| 670 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 669 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |