OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/sync/core_impl/test/sync_manager_for_profile_sync_test.h" | |
6 | |
7 #include "components/sync/syncable/directory.h" | |
8 #include "components/sync/syncable/test_user_share.h" | |
9 #include "components/sync/syncable/user_share.h" | |
10 | |
11 namespace syncer { | |
12 | |
13 SyncManagerForProfileSyncTest::SyncManagerForProfileSyncTest( | |
14 std::string name, | |
15 base::Closure init_callback) | |
16 : SyncManagerImpl(name), init_callback_(init_callback) {} | |
17 | |
18 SyncManagerForProfileSyncTest::~SyncManagerForProfileSyncTest() {} | |
19 | |
20 void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() { | |
21 UserShare* user_share = GetUserShare(); | |
22 syncable::Directory* directory = user_share->directory.get(); | |
23 | |
24 if (!init_callback_.is_null()) | |
25 init_callback_.Run(); | |
26 | |
27 ModelTypeSet early_download_types; | |
28 early_download_types.PutAll(ControlTypes()); | |
29 early_download_types.PutAll(PriorityUserTypes()); | |
30 for (ModelTypeSet::Iterator it = early_download_types.First(); it.Good(); | |
31 it.Inc()) { | |
32 if (!directory->InitialSyncEndedForType(it.Get())) { | |
33 TestUserShare::CreateRoot(it.Get(), user_share); | |
34 } | |
35 } | |
36 | |
37 SyncManagerImpl::NotifyInitializationSuccess(); | |
38 } | |
39 | |
40 } // namespace syncer | |
OLD | NEW |