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

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

Issue 74653002: sync: Add --enable-sync-sessions-v2 and necessary plumbing to use SessionsSyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup components factory Created 7 years, 1 month 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 68f5d89e9b8f4c76cc95b242cfaa248a3a7b9f32..a1c30ddd1732ad46f5b1d57f6687e1954bc0d0de 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,33 @@ 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! ***
rlarocque 2013/11/18 23:20:08 That's a pretty strong comment. nit: Could you be
tim (not reviewing) 2013/11/20 18:38:57 Yeah, I want to be a bit scary :) I'll be removin
+ // 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.
+ virtual std::string GetLocalDeviceGUID() const OVERRIDE;
rlarocque 2013/11/18 23:20:08 Is this the sync cache GUID? If so, could you ren
tim (not reviewing) 2013/11/20 18:38:57 Good point. I actually had it called CacheGuid (s
// 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 +344,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 +696,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 +1037,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);
};

Powered by Google App Engine
This is Rietveld 408576698