Index: chrome/browser/sync/sessions/session_data_type_controller.cc |
diff --git a/chrome/browser/sync/sessions/session_data_type_controller.cc b/chrome/browser/sync/sessions/session_data_type_controller.cc |
index 6717f7551d3f9b32c614cab9fce32fd89cf3f242..25578b633782bf2008e974d58bf050517b1536ee 100644 |
--- a/chrome/browser/sync/sessions/session_data_type_controller.cc |
+++ b/chrome/browser/sync/sessions/session_data_type_controller.cc |
@@ -8,7 +8,6 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
#include "chrome/browser/sync/glue/synced_window_delegate.h" |
-#include "chrome/browser/sync/sessions/synced_window_delegates_getter.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
@@ -21,8 +20,6 @@ |
SessionDataTypeController::SessionDataTypeController( |
SyncApiComponentFactory* sync_factory, |
Profile* profile, |
- SyncedWindowDelegatesGetter* synced_window_getter, |
- LocalDeviceInfoProvider* local_device, |
const DisableTypeCallback& disable_callback) |
: UIDataTypeController( |
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
@@ -30,12 +27,7 @@ |
disable_callback, |
syncer::SESSIONS, |
sync_factory), |
- profile_(profile), |
- synced_window_getter_(synced_window_getter), |
- local_device_(local_device), |
- waiting_on_session_restore_(false), |
- waiting_on_local_device_info_(false) { |
- DCHECK(local_device_); |
+ profile_(profile) { |
} |
SessionDataTypeController::~SessionDataTypeController() {} |
@@ -43,7 +35,7 @@ |
bool SessionDataTypeController::StartModels() { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
std::set<browser_sync::SyncedWindowDelegate*> window = |
- synced_window_getter_->GetSyncedWindowDelegates(); |
+ browser_sync::SyncedWindowDelegate::GetSyncedWindowDelegates(); |
for (std::set<browser_sync::SyncedWindowDelegate*>::const_iterator i = |
window.begin(); i != window.end(); ++i) { |
if ((*i)->IsSessionRestoreInProgress()) { |
@@ -51,33 +43,14 @@ |
this, |
chrome::NOTIFICATION_SESSION_RESTORE_COMPLETE, |
content::Source<Profile>(profile_)); |
- waiting_on_session_restore_ = true; |
- break; |
+ return false; |
} |
} |
- |
- if (!local_device_->GetLocalDeviceInfo()) { |
- subscription_ = local_device_->RegisterOnInitializedCallback( |
- base::Bind(&SessionDataTypeController::OnLocalDeviceInfoInitialized, |
- this)); |
- waiting_on_local_device_info_ = true; |
- } |
- |
- return !IsWaiting(); |
+ return true; |
} |
void SessionDataTypeController::StopModels() { |
notification_registrar_.RemoveAll(); |
-} |
- |
-bool SessionDataTypeController::IsWaiting() { |
- return waiting_on_session_restore_ || waiting_on_local_device_info_; |
-} |
- |
-void SessionDataTypeController::MaybeCompleteLoading() { |
- if (state_ == MODEL_STARTING && !IsWaiting()) { |
- OnModelLoaded(); |
- } |
} |
void SessionDataTypeController::Observe( |
@@ -88,17 +61,7 @@ |
DCHECK_EQ(chrome::NOTIFICATION_SESSION_RESTORE_COMPLETE, type); |
DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
notification_registrar_.RemoveAll(); |
- |
- waiting_on_session_restore_ = false; |
- MaybeCompleteLoading(); |
-} |
- |
-void SessionDataTypeController::OnLocalDeviceInfoInitialized() { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- subscription_.reset(); |
- |
- waiting_on_local_device_info_ = false; |
- MaybeCompleteLoading(); |
+ OnModelLoaded(); |
} |
} // namespace browser_sync |