Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 6375007: [Sync] Refactored ProfileSyncService and remove its backend() function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile failure Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index cefe296666266a23c31296f7eec9e120b804b960..9be44e19d8012de1c9c606b38315b0e3dff1f71a 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -90,6 +90,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
public:
typedef ProfileSyncServiceObserver Observer;
typedef browser_sync::SyncBackendHost::Status Status;
+ typedef browser_sync::SyncBackendHost::UserShareHandle UserShareHandle;
tim (not reviewing) 2011/01/21 18:17:00 ring around the rosie... :(
akalin 2011/01/21 21:21:09 Removed!
enum SyncEventCodes {
MIN_SYNC_EVENT_CODE = 0,
@@ -326,7 +327,35 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
const tracked_objects::Location& from_here,
const std::string& message);
- browser_sync::SyncBackendHost* backend() { return backend_.get(); }
+ // Should only be called if sync_initialized() is true.
+ UserShareHandle GetUserShareHandle() const;
+
+ // The three functions below, used by
+ // sync_ui_util::ConstructAboutInformation(), should only be called
+ // if sync_initialized() is true.
+
+ const browser_sync::sessions::SyncSessionSnapshot*
+ GetLastSessionSnapshot() const;
+
+ bool HasUnsyncedItems() const;
tim (not reviewing) 2011/01/21 18:17:00 The comments should probably have moved too
akalin 2011/01/21 21:21:09 Done.
+
+ void GetModelSafeRoutingInfo(browser_sync::ModelSafeRoutingInfo* out);
+
+ // The autofill migration functions below should only be called if
+ // sync_initialized() is true.
+
+ syncable::AutofillMigrationState
+ GetAutofillMigrationState();
+
+ void SetAutofillMigrationState(
+ syncable::AutofillMigrationState state);
+
+ syncable::AutofillMigrationDebugInfo
+ GetAutofillMigrationDebugInfo();
+
+ void SetAutofillMigrationDebugInfo(
+ syncable::AutofillMigrationDebugInfo::PropertyToSet property_to_set,
+ const syncable::AutofillMigrationDebugInfo& info);
virtual void ActivateDataType(
browser_sync::DataTypeController* data_type_controller,
@@ -402,6 +431,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// so we don't need this hack anymore.
ProfileSyncService();
+ // Used by test classes that derive from ProfileSyncService.
+ browser_sync::SyncBackendHost* GetBackendForTest();
+
// Helper to install and configure a data type manager.
void ConfigureDataTypeManager();
@@ -420,6 +452,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Test need to override this to create backends that allow setting up
// initial conditions, such as populating sync nodes.
+ //
+ // TODO(akalin): Figure out a better way to do this. Ideally, we'd
+ // construct the backend outside this class and pass it in to the
+ // contructor or Initialize().
virtual void CreateBackend();
const browser_sync::DataTypeController::TypeMap& data_type_controllers() {
@@ -454,13 +490,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
bool passphrase_required_for_decryption_;
private:
- friend class ProfileSyncServiceTest;
friend class ProfileSyncServicePasswordTest;
- friend class ProfileSyncServicePreferenceTest;
- friend class ProfileSyncServiceSessionTest;
+ friend class TestProfileSyncService;
FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState);
- FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest,
- UnrecoverableErrorSuspendsService);
// If |delete_sync_data_folder| is true, then this method will delete all
// previous "Sync Data" folders. (useful if the folder is partial/corrupt).

Powered by Google App Engine
This is Rietveld 408576698