| 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 68f5d89e9b8f4c76cc95b242cfaa248a3a7b9f32..39c835bd6d11c4844b468d4fac803799cbac6598 100644
|
| --- a/chrome/browser/sync/profile_sync_service.h
|
| +++ b/chrome/browser/sync/profile_sync_service.h
|
| @@ -31,6 +31,7 @@
|
| #include "chrome/browser/sync/glue/synced_device_tracker.h"
|
| #include "chrome/browser/sync/profile_sync_service_base.h"
|
| #include "chrome/browser/sync/profile_sync_service_observer.h"
|
| +#include "chrome/browser/sync/sessions2/sessions_sync_manager.h"
|
| #include "chrome/browser/sync/sync_prefs.h"
|
| #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
|
| #include "content/public/browser/notification_observer.h"
|
| @@ -58,7 +59,9 @@ class BackendMigrator;
|
| class ChangeProcessor;
|
| class DataTypeManager;
|
| class DeviceInfo;
|
| +class FaviconCache;
|
| class JsController;
|
| +class OpenTabsUIDelegate;
|
| class SessionModelAssociator;
|
|
|
| namespace sessions {
|
| @@ -76,6 +79,8 @@ namespace sync_pb {
|
| class EncryptedData;
|
| } // namespace sync_pb
|
|
|
| +using browser_sync::SessionsSyncManager;
|
| +
|
| // ProfileSyncService is the layer between browser subsystems like bookmarks,
|
| // and the sync backend. Each subsystem is logically thought of as being
|
| // a sync datatype.
|
| @@ -159,16 +164,18 @@ class EncryptedData;
|
| // tell the sync engine that setup is completed and it can begin downloading
|
| // data from the sync server.
|
| //
|
| -class ProfileSyncService : public ProfileSyncServiceBase,
|
| - public browser_sync::SyncFrontend,
|
| - public browser_sync::SyncPrefObserver,
|
| - public browser_sync::DataTypeManagerObserver,
|
| - public syncer::UnrecoverableErrorHandler,
|
| - public content::NotificationObserver,
|
| - public BrowserContextKeyedService,
|
| - public browser_sync::DataTypeEncryptionHandler,
|
| - public OAuth2TokenService::Consumer,
|
| - public OAuth2TokenService::Observer {
|
| +class ProfileSyncService
|
| + : public ProfileSyncServiceBase,
|
| + public browser_sync::SyncFrontend,
|
| + public browser_sync::SyncPrefObserver,
|
| + public browser_sync::DataTypeManagerObserver,
|
| + public syncer::UnrecoverableErrorHandler,
|
| + public content::NotificationObserver,
|
| + public BrowserContextKeyedService,
|
| + public browser_sync::DataTypeEncryptionHandler,
|
| + public OAuth2TokenService::Consumer,
|
| + public OAuth2TokenService::Observer,
|
| + public SessionsSyncManager::SyncInternalApiDelegate {
|
| public:
|
| typedef browser_sync::SyncBackendHost::Status Status;
|
|
|
| @@ -299,13 +306,34 @@ class ProfileSyncService : public ProfileSyncServiceBase,
|
| // Returns the session model associator associated with this type, but only if
|
| // the associator is running. If it is doing anything else, it will return
|
| // null.
|
| - // TODO(zea): Figure out a better way to expose this to the UI elements that
|
| - // need it.
|
| - virtual browser_sync::SessionModelAssociator* GetSessionModelAssociator();
|
| + //
|
| + // *** DONT USE THIS ANYMORE! ***
|
| + // If you think you want to use this, think again! Can you use
|
| + // GetOpenTabsUIDelegate instead?
|
| + // TODO(tim): Remove this method.
|
| + virtual browser_sync::SessionModelAssociator*
|
| + GetSessionModelAssociatorDeprecated();
|
| +
|
| + // Return the active OpenTabsUIDelegate. If sessions is not enabled or not
|
| + // currently syncing, returns NULL.
|
| + virtual browser_sync::OpenTabsUIDelegate* GetOpenTabsUIDelegate();
|
|
|
| + // Returns the SyncableService for syncer::SESSIONS.
|
| + virtual syncer::SyncableService* GetSessionsSyncableService();
|
| +
|
| + // SyncInternalApiDelegate implementation.
|
| + //
|
| // Returns sync's representation of the local device info.
|
| // Return value is an empty scoped_ptr if the device info is unavailable.
|
| - virtual scoped_ptr<browser_sync::DeviceInfo> GetLocalDeviceInfo() const;
|
| + virtual scoped_ptr<browser_sync::DeviceInfo> GetLocalDeviceInfo()
|
| + const OVERRIDE;
|
| +
|
| + // Gets the guid for the local device. Can be used by other layers to
|
| + // to distinguish sync data that belongs to the local device vs data
|
| + // that belongs to remote devices. Returns empty string if sync is not
|
| + // initialized. The GUID is not persistent across Chrome signout/signin.
|
| + // If you sign out of Chrome and sign in, a new GUID is generated.
|
| + virtual std::string GetLocalSyncCacheGUID() const OVERRIDE;
|
|
|
| // Returns sync's representation of the device info for a client identified
|
| // by |client_id|. Return value is an empty scoped ptr if the device info
|
| @@ -317,12 +345,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
|
| // with this profile.
|
| virtual ScopedVector<browser_sync::DeviceInfo> GetAllSignedInDevices() const;
|
|
|
| - // Gets the partnership guid for the local device. Can be used by other
|
| - // layers to distinguish sync data that belongs to the local device vs
|
| - // data that belong to remote devices. Returns null if sync is not
|
| - // initialized.
|
| - virtual std::string GetLocalDeviceGUID() const;
|
| -
|
| // Notifies the observer of any device info changes.
|
| virtual void AddObserverForDeviceInfoChange(
|
| browser_sync::SyncedDeviceTracker::Observer* observer);
|
| @@ -675,6 +697,8 @@ class ProfileSyncService : public ProfileSyncServiceBase,
|
| // Return sync token status.
|
| SyncTokenStatus GetSyncTokenStatus() const;
|
|
|
| + browser_sync::FaviconCache* GetFaviconCache();
|
| +
|
| protected:
|
| // Used by test classes that derive from ProfileSyncService.
|
| virtual browser_sync::SyncBackendHost* GetBackendForTest();
|
| @@ -1014,6 +1038,8 @@ class ProfileSyncService : public ProfileSyncServiceBase,
|
| GoogleServiceAuthError last_get_token_error_;
|
| base::Time next_token_request_time_;
|
|
|
| + scoped_ptr<SessionsSyncManager> sessions_sync_manager_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
|
| };
|
|
|
|
|