| 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/extensions/test_extension_system.h" | 5 #include "chrome/browser/extensions/test_extension_system.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "extensions/browser/extension_registry.h" | 21 #include "extensions/browser/extension_registry.h" |
| 22 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
| 23 #include "extensions/browser/extensions_browser_client.h" | 23 #include "extensions/browser/extensions_browser_client.h" |
| 24 #include "extensions/browser/info_map.h" | 24 #include "extensions/browser/info_map.h" |
| 25 #include "extensions/browser/management_policy.h" | 25 #include "extensions/browser/management_policy.h" |
| 26 #include "extensions/browser/quota_service.h" | 26 #include "extensions/browser/quota_service.h" |
| 27 #include "extensions/browser/runtime_data.h" | 27 #include "extensions/browser/runtime_data.h" |
| 28 #include "extensions/browser/state_store.h" | 28 #include "extensions/browser/state_store.h" |
| 29 #include "extensions/browser/value_store/test_value_store_factory.h" | 29 #include "extensions/browser/value_store/test_value_store_factory.h" |
| 30 #include "extensions/browser/value_store/testing_value_store.h" | 30 #include "extensions/browser/value_store/testing_value_store.h" |
| 31 #if defined(OS_CHROMEOS) | |
| 32 #include "components/user_manager/user_manager.h" | |
| 33 #endif | |
| 34 | 31 |
| 35 using content::BrowserThread; | 32 using content::BrowserThread; |
| 36 | 33 |
| 37 namespace extensions { | 34 namespace extensions { |
| 38 | 35 |
| 39 TestExtensionSystem::TestExtensionSystem(Profile* profile) | 36 TestExtensionSystem::TestExtensionSystem(Profile* profile) |
| 40 : profile_(profile), | 37 : profile_(profile), |
| 41 store_factory_(new TestValueStoreFactory()), | 38 store_factory_(new TestValueStoreFactory()), |
| 42 info_map_(new InfoMap()), | 39 info_map_(new InfoMap()), |
| 43 quota_service_(new QuotaService()), | 40 quota_service_(new QuotaService()), |
| 44 app_sorting_(new ChromeAppSorting(profile_)) { | 41 app_sorting_(new ChromeAppSorting(profile_)) {} |
| 45 #if defined(OS_CHROMEOS) | |
| 46 if (!user_manager::UserManager::IsInitialized()) | |
| 47 test_user_manager_.reset(new chromeos::ScopedTestUserManager); | |
| 48 #endif | |
| 49 } | |
| 50 | 42 |
| 51 TestExtensionSystem::~TestExtensionSystem() { | 43 TestExtensionSystem::~TestExtensionSystem() { |
| 52 } | 44 } |
| 53 | 45 |
| 54 void TestExtensionSystem::Shutdown() { | 46 void TestExtensionSystem::Shutdown() { |
| 55 if (extension_service_) | 47 if (extension_service_) |
| 56 extension_service_->Shutdown(); | 48 extension_service_->Shutdown(); |
| 57 } | 49 } |
| 58 | 50 |
| 59 ExtensionService* TestExtensionSystem::CreateExtensionService( | 51 ExtensionService* TestExtensionSystem::CreateExtensionService( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 content::BrowserContext* profile) { | 144 content::BrowserContext* profile) { |
| 153 return base::WrapUnique( | 145 return base::WrapUnique( |
| 154 new TestExtensionSystem(static_cast<Profile*>(profile))); | 146 new TestExtensionSystem(static_cast<Profile*>(profile))); |
| 155 } | 147 } |
| 156 | 148 |
| 157 void TestExtensionSystem::RecreateAppSorting() { | 149 void TestExtensionSystem::RecreateAppSorting() { |
| 158 app_sorting_.reset(new ChromeAppSorting(profile_)); | 150 app_sorting_.reset(new ChromeAppSorting(profile_)); |
| 159 } | 151 } |
| 160 | 152 |
| 161 } // namespace extensions | 153 } // namespace extensions |
| OLD | NEW |