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

Unified Diff: chrome/browser/sync/sessions/session_data_type_controller.h

Issue 367153005: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed scoped_ptr issue in ProfileSyncService constructor Created 6 years, 5 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/sessions/session_data_type_controller.h
diff --git a/chrome/browser/sync/sessions/session_data_type_controller.h b/chrome/browser/sync/sessions/session_data_type_controller.h
index d5ede141b661db68f2759a702abe97d4f4c63572..846c23f79b12269afcca4d52b3bd130f008ade9a 100644
--- a/chrome/browser/sync/sessions/session_data_type_controller.h
+++ b/chrome/browser/sync/sessions/session_data_type_controller.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_
#define CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_
+#include "chrome/browser/sync/glue/local_device_info_provider.h"
#include "components/sync_driver/ui_data_type_controller.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -13,13 +14,18 @@ class Profile;
namespace browser_sync {
+class SyncedWindowDelegatesGetter;
+
// Overrides StartModels to avoid sync contention with sessions during
-// a session restore operation at startup.
+// a session restore operation at startup and to wait for the local
+// device info to become available.
class SessionDataTypeController : public UIDataTypeController,
public content::NotificationObserver {
public:
SessionDataTypeController(SyncApiComponentFactory* factory,
Profile* profile,
+ SyncedWindowDelegatesGetter* synced_window_getter,
+ LocalDeviceInfoProvider* local_device,
const DisableTypeCallback& disable_callback);
// NotificationObserver interface.
@@ -33,8 +39,22 @@ class SessionDataTypeController : public UIDataTypeController,
virtual void StopModels() OVERRIDE;
private:
+ bool IsWaiting();
+ void MaybeCompleteLoading();
+ void OnLocalDeviceInfoInitialized();
+
Profile* const profile_;
+
+ SyncedWindowDelegatesGetter* synced_window_getter_;
content::NotificationRegistrar notification_registrar_;
+
+ LocalDeviceInfoProvider* const local_device_;
+ scoped_ptr<LocalDeviceInfoProvider::Subscription> subscription_;
+
+ // Flags that indicate the reason for pending loading models.
+ bool waiting_on_session_restore_;
+ bool waiting_on_local_device_info_;
+
DISALLOW_COPY_AND_ASSIGN(SessionDataTypeController);
};
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/sync/sessions/session_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698