| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   85   SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); |   87   SyncAppHelper* instance = Singleton<SyncAppHelper>::get(); | 
|   86   instance->SetupIfNecessary(sync_datatype_helper::test()); |   88   instance->SetupIfNecessary(sync_datatype_helper::test()); | 
|   87   return instance; |   89   return instance; | 
|   88 } |   90 } | 
|   89  |   91  | 
|   90 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { |   92 void SyncAppHelper::SetupIfNecessary(SyncTest* test) { | 
|   91   if (setup_completed_) |   93   if (setup_completed_) | 
|   92     return; |   94     return; | 
|   93  |   95  | 
|   94   for (int i = 0; i < test->num_clients(); ++i) { |   96   for (int i = 0; i < test->num_clients(); ++i) { | 
|   95     test->GetProfile(i)->InitExtensions(true); |   97     ExtensionSystemFactory::GetForProfile(test->GetProfile(i))->Init(true); | 
|   96   } |   98   } | 
|   97   test->verifier()->InitExtensions(true); |   99   ExtensionSystemFactory::GetForProfile(test->verifier())->Init(true); | 
|   98  |  100  | 
|   99   setup_completed_ = true; |  101   setup_completed_ = true; | 
|  100 } |  102 } | 
|  101  |  103  | 
|  102 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { |  104 bool SyncAppHelper::AppStatesMatch(Profile* profile1, Profile* profile2) { | 
|  103   if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( |  105   if (!SyncExtensionHelper::GetInstance()->ExtensionStatesMatch( | 
|  104           profile1, profile2)) |  106           profile1, profile2)) | 
|  105     return false; |  107     return false; | 
|  106  |  108  | 
|  107   const AppStateMap& state_map1 = GetAppStates(profile1); |  109   const AppStateMap& state_map1 = GetAppStates(profile1); | 
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  170 } |  172 } | 
|  171  |  173  | 
|  172 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { |  174 void SyncAppHelper::FixNTPOrdinalCollisions(Profile* profile) { | 
|  173   profile->GetExtensionService()->extension_prefs()->extension_sorting()-> |  175   profile->GetExtensionService()->extension_prefs()->extension_sorting()-> | 
|  174       FixNTPOrdinalCollisions(); |  176       FixNTPOrdinalCollisions(); | 
|  175 } |  177 } | 
|  176  |  178  | 
|  177 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} |  179 SyncAppHelper::SyncAppHelper() : setup_completed_(false) {} | 
|  178  |  180  | 
|  179 SyncAppHelper::~SyncAppHelper() {} |  181 SyncAppHelper::~SyncAppHelper() {} | 
| OLD | NEW |