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" |
8 #include "chrome/browser/extensions/extension_sorting.h" | 10 #include "chrome/browser/extensions/extension_sorting.h" |
9 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/test/integration/extensions_helper.h" | 12 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
11 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 13 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
12 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" | 14 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
13 #include "chrome/common/string_ordinal.h" | 15 #include "chrome/common/string_ordinal.h" |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 struct AppState { | 19 struct AppState { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); | 80 SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); |
79 instance->SetupIfNecessary(sync_datatype_helper::test()); | 81 instance->SetupIfNecessary(sync_datatype_helper::test()); |
80 return instance; | 82 return instance; |
81 } | 83 } |
82 | 84 |
83 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { | 85 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { |
84 if (setup_completed_) | 86 if (setup_completed_) |
85 return; | 87 return; |
86 | 88 |
87 for (int i = 0; i < test->num_clients(); ++i) { | 89 for (int i = 0; i < test->num_clients(); ++i) { |
88 test->GetProfile(i)->InitExtensions(true); | 90 ExtensionSystemFactory::GetForProfile(test->GetProfile(i))->Init(true); |
89 } | 91 } |
90 test->verifier()->InitExtensions(true); | 92 ExtensionSystemFactory::GetForProfile(test->verifier())->Init(true); |
91 | 93 |
92 setup_completed_ = true; | 94 setup_completed_ = true; |
93 } | 95 } |
94 | 96 |
95 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { | 97 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { |
96 if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( | 98 if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( |
97 profile1, profile2)) | 99 profile1, profile2)) |
98 return false; | 100 return false; |
99 | 101 |
100 const AppStateMap& state_map1 = GetAppStates(profile1); | 102 const AppStateMap& state_map1 = GetAppStates(profile1); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 156 } |
155 | 157 |
156 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { | 158 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { |
157 profile->GetExtensionService()->extension_prefs()-> | 159 profile->GetExtensionService()->extension_prefs()-> |
158 extension_sorting()->FixNTPOrdinalCollisions(); | 160 extension_sorting()->FixNTPOrdinalCollisions(); |
159 } | 161 } |
160 | 162 |
161 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} | 163 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} |
162 | 164 |
163 SyncAppHelper::~SyncAppHelper() {} | 165 SyncAppHelper::~SyncAppHelper() {} |
OLD | NEW |