OLD | NEW |
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 "chrome/browser/sync/test/integration/sync_app_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_system.h" | |
9 #include "chrome/browser/extensions/extension_system_factory.h" | |
10 #include "chrome/browser/extensions/extension_sorting.h" | 8 #include "chrome/browser/extensions/extension_sorting.h" |
11 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/sync/test/integration/extensions_helper.h" | 10 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
13 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 11 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
14 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" | 12 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
15 #include "chrome/common/string_ordinal.h" | 13 #include "chrome/common/string_ordinal.h" |
16 | 14 |
17 namespace { | 15 namespace { |
18 | 16 |
19 struct AppState { | 17 struct AppState { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); | 83 SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); |
86 instance->SetupIfNecessary(sync_datatype_helper::test()); | 84 instance->SetupIfNecessary(sync_datatype_helper::test()); |
87 return instance; | 85 return instance; |
88 } | 86 } |
89 | 87 |
90 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { | 88 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { |
91 if (setup_completed_) | 89 if (setup_completed_) |
92 return; | 90 return; |
93 | 91 |
94 for (int i = 0; i < test->num_clients(); ++i) { | 92 for (int i = 0; i < test->num_clients(); ++i) { |
95 ExtensionSystemFactory::GetForProfile(test->GetProfile(i))->Init(true); | 93 test->GetProfile(i)->InitExtensions(true); |
96 } | 94 } |
97 ExtensionSystemFactory::GetForProfile(test->verifier())->Init(true); | 95 test->verifier()->InitExtensions(true); |
98 | 96 |
99 setup_completed_ = true; | 97 setup_completed_ = true; |
100 } | 98 } |
101 | 99 |
102 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { | 100 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { |
103 if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( | 101 if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( |
104 profile1, profile2)) | 102 profile1, profile2)) |
105 return false; | 103 return false; |
106 | 104 |
107 const AppStateMap& state_map1 = GetAppStates(profile1); | 105 const AppStateMap& state_map1 = GetAppStates(profile1); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 167 } |
170 | 168 |
171 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { | 169 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { |
172 profile->GetExtensionService()->extension_prefs()-> | 170 profile->GetExtensionService()->extension_prefs()-> |
173 extension_sorting()->FixNTPOrdinalCollisions(); | 171 extension_sorting()->FixNTPOrdinalCollisions(); |
174 } | 172 } |
175 | 173 |
176 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} | 174 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} |
177 | 175 |
178 SyncAppHelper::~SyncAppHelper() {} | 176 SyncAppHelper::~SyncAppHelper() {} |
OLD | NEW |