OLD | NEW |
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" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/sync/profile_sync_service_factory.h" | 12 #include "chrome/browser/sync/profile_sync_service_factory.h" |
13 #include "chrome/common/channel_info.h" | 13 #include "chrome/common/channel_info.h" |
14 #include "components/browser_sync/profile_sync_service.h" | 14 #include "components/browser_sync/profile_sync_service.h" |
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 15 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
16 #include "components/sync/base/model_type.h" | 16 #include "components/sync/base/model_type.h" |
17 #include "components/sync/base/report_unrecoverable_error.h" | 17 #include "components/sync/base/report_unrecoverable_error.h" |
18 #include "components/sync/user_events/user_event_service.h" | 18 #include "components/sync/user_events/user_event_service_impl.h" |
19 #include "components/sync/user_events/user_event_sync_bridge.h" | 19 #include "components/sync/user_events/user_event_sync_bridge.h" |
20 | 20 |
21 namespace browser_sync { | 21 namespace browser_sync { |
22 | 22 |
23 // static | 23 // static |
24 UserEventServiceFactory* UserEventServiceFactory::GetInstance() { | 24 UserEventServiceFactory* UserEventServiceFactory::GetInstance() { |
25 return base::Singleton<UserEventServiceFactory>::get(); | 25 return base::Singleton<UserEventServiceFactory>::get(); |
26 } | 26 } |
27 | 27 |
28 // static | 28 // static |
(...skipping 15 matching lines...) Expand all Loading... |
44 Profile* profile = Profile::FromBrowserContext(context); | 44 Profile* profile = Profile::FromBrowserContext(context); |
45 syncer::ModelTypeStoreFactory store_factory = | 45 syncer::ModelTypeStoreFactory store_factory = |
46 browser_sync::ProfileSyncService::GetModelTypeStoreFactory( | 46 browser_sync::ProfileSyncService::GetModelTypeStoreFactory( |
47 syncer::USER_EVENTS, profile->GetPath()); | 47 syncer::USER_EVENTS, profile->GetPath()); |
48 syncer::ModelTypeSyncBridge::ChangeProcessorFactory processor_factory = | 48 syncer::ModelTypeSyncBridge::ChangeProcessorFactory processor_factory = |
49 base::BindRepeating(&syncer::ModelTypeChangeProcessor::Create, | 49 base::BindRepeating(&syncer::ModelTypeChangeProcessor::Create, |
50 base::BindRepeating(&syncer::ReportUnrecoverableError, | 50 base::BindRepeating(&syncer::ReportUnrecoverableError, |
51 chrome::GetChannel())); | 51 chrome::GetChannel())); |
52 auto bridge = base::MakeUnique<syncer::UserEventSyncBridge>( | 52 auto bridge = base::MakeUnique<syncer::UserEventSyncBridge>( |
53 std::move(store_factory), std::move(processor_factory)); | 53 std::move(store_factory), std::move(processor_factory)); |
54 return new syncer::UserEventService( | 54 return new syncer::UserEventServiceImpl( |
55 ProfileSyncServiceFactory::GetForProfile(profile), std::move(bridge)); | 55 ProfileSyncServiceFactory::GetForProfile(profile), std::move(bridge)); |
56 } | 56 } |
57 | 57 |
58 } // namespace browser_sync | 58 } // namespace browser_sync |
OLD | NEW |