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

Side by Side Diff: components/browser_sync/profile_sync_service.cc

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: [sync] WebContentsObserver based sessions notifications Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <map> 10 #include <map>
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 DCHECK(thread_checker_.CalledOnValidThread()); 218 DCHECK(thread_checker_.CalledOnValidThread());
219 sync_client_->Initialize(); 219 sync_client_->Initialize();
220 220
221 // We don't pass StartupController an Unretained reference to future-proof 221 // We don't pass StartupController an Unretained reference to future-proof
222 // against the controller impl changing to post tasks. 222 // against the controller impl changing to post tasks.
223 startup_controller_ = base::MakeUnique<syncer::StartupController>( 223 startup_controller_ = base::MakeUnique<syncer::StartupController>(
224 &sync_prefs_, 224 &sync_prefs_,
225 base::Bind(&ProfileSyncService::CanEngineStart, base::Unretained(this)), 225 base::Bind(&ProfileSyncService::CanEngineStart, base::Unretained(this)),
226 base::Bind(&ProfileSyncService::StartUpSlowEngineComponents, 226 base::Bind(&ProfileSyncService::StartUpSlowEngineComponents,
227 weak_factory_.GetWeakPtr())); 227 weak_factory_.GetWeakPtr()));
228 std::unique_ptr<sync_sessions::LocalSessionEventRouter> router( 228 sync_sessions::LocalSessionEventRouter* router =
229 sync_client_->GetSyncSessionsClient()->GetLocalSessionEventRouter()); 229 sync_client_->GetSyncSessionsClient()->GetLocalSessionEventRouter();
230 local_device_ = sync_client_->GetSyncApiComponentFactory() 230 local_device_ = sync_client_->GetSyncApiComponentFactory()
231 ->CreateLocalDeviceInfoProvider(); 231 ->CreateLocalDeviceInfoProvider();
232 sync_stopped_reporter_ = base::MakeUnique<syncer::SyncStoppedReporter>( 232 sync_stopped_reporter_ = base::MakeUnique<syncer::SyncStoppedReporter>(
233 sync_service_url_, local_device_->GetSyncUserAgent(), 233 sync_service_url_, local_device_->GetSyncUserAgent(),
234 url_request_context_, syncer::SyncStoppedReporter::ResultCallback()); 234 url_request_context_, syncer::SyncStoppedReporter::ResultCallback());
235 sessions_sync_manager_ = base::MakeUnique<SessionsSyncManager>( 235 sessions_sync_manager_ = base::MakeUnique<SessionsSyncManager>(
236 sync_client_->GetSyncSessionsClient(), &sync_prefs_, local_device_.get(), 236 sync_client_->GetSyncSessionsClient(), &sync_prefs_, local_device_.get(),
237 std::move(router), 237 std::move(router),
238 base::Bind(&ProfileSyncService::NotifyForeignSessionUpdated, 238 base::Bind(&ProfileSyncService::NotifyForeignSessionUpdated,
239 sync_enabled_weak_factory_.GetWeakPtr()), 239 sync_enabled_weak_factory_.GetWeakPtr()),
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 return; 2437 return;
2438 2438
2439 DCHECK(startup_controller_->IsSetupInProgress()); 2439 DCHECK(startup_controller_->IsSetupInProgress());
2440 startup_controller_->SetSetupInProgress(false); 2440 startup_controller_->SetSetupInProgress(false);
2441 2441
2442 if (IsEngineInitialized()) 2442 if (IsEngineInitialized())
2443 ReconfigureDatatypeManager(); 2443 ReconfigureDatatypeManager();
2444 NotifyObservers(); 2444 NotifyObservers();
2445 } 2445 }
2446 } // namespace browser_sync 2446 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698