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

Side by Side Diff: chrome/browser/sync/user_event_service_factory.cc

Issue 2958303002: [Sync] Maintain a global_id mapping to update UserEvents that references navigations (Closed)
Patch Set: Rebase Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/sync/user_event_service_factory.h" 5 #include "chrome/browser/sync/user_event_service_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 Profile* profile = Profile::FromBrowserContext(context); 50 Profile* profile = Profile::FromBrowserContext(context);
51 syncer::ModelTypeStoreFactory store_factory = 51 syncer::ModelTypeStoreFactory store_factory =
52 browser_sync::ProfileSyncService::GetModelTypeStoreFactory( 52 browser_sync::ProfileSyncService::GetModelTypeStoreFactory(
53 syncer::USER_EVENTS, profile->GetPath()); 53 syncer::USER_EVENTS, profile->GetPath());
54 syncer::ModelTypeSyncBridge::ChangeProcessorFactory processor_factory = 54 syncer::ModelTypeSyncBridge::ChangeProcessorFactory processor_factory =
55 base::BindRepeating(&syncer::ModelTypeChangeProcessor::Create, 55 base::BindRepeating(&syncer::ModelTypeChangeProcessor::Create,
56 base::BindRepeating(&syncer::ReportUnrecoverableError, 56 base::BindRepeating(&syncer::ReportUnrecoverableError,
57 chrome::GetChannel())); 57 chrome::GetChannel()));
58 syncer::SyncService* sync_service =
59 ProfileSyncServiceFactory::GetForProfile(profile);
58 auto bridge = base::MakeUnique<syncer::UserEventSyncBridge>( 60 auto bridge = base::MakeUnique<syncer::UserEventSyncBridge>(
59 std::move(store_factory), std::move(processor_factory)); 61 std::move(store_factory), std::move(processor_factory),
60 return new syncer::UserEventServiceImpl( 62 sync_service->GetGlobalIdMapper());
61 ProfileSyncServiceFactory::GetForProfile(profile), std::move(bridge)); 63 return new syncer::UserEventServiceImpl(sync_service, std::move(bridge));
62 } 64 }
63 65
64 content::BrowserContext* UserEventServiceFactory::GetBrowserContextToUse( 66 content::BrowserContext* UserEventServiceFactory::GetBrowserContextToUse(
65 content::BrowserContext* context) const { 67 content::BrowserContext* context) const {
66 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 68 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
67 } 69 }
68 70
69 } // namespace browser_sync 71 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | components/browser_sync/profile_sync_service.h » ('j') | components/sync_sessions/sessions_sync_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698