| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/extensions/blacklist.h" | 9 #include "chrome/browser/extensions/blacklist.h" |
| 10 #include "chrome/browser/extensions/extension_management.h" | 10 #include "chrome/browser/extensions/extension_management.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 quota_service_(new QuotaService()) {} | 42 quota_service_(new QuotaService()) {} |
| 43 | 43 |
| 44 TestExtensionSystem::~TestExtensionSystem() { | 44 TestExtensionSystem::~TestExtensionSystem() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 void TestExtensionSystem::Shutdown() { | 47 void TestExtensionSystem::Shutdown() { |
| 48 if (extension_service_) | 48 if (extension_service_) |
| 49 extension_service_->Shutdown(); | 49 extension_service_->Shutdown(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TestExtensionSystem::CreateLazyBackgroundTaskQueue() { | |
| 53 lazy_background_task_queue_.reset(new LazyBackgroundTaskQueue(profile_)); | |
| 54 } | |
| 55 | |
| 56 ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( | 52 ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( |
| 57 const base::CommandLine* command_line, | 53 const base::CommandLine* command_line, |
| 58 const base::FilePath& install_directory) { | 54 const base::FilePath& install_directory) { |
| 59 bool extensions_disabled = | 55 bool extensions_disabled = |
| 60 command_line && command_line->HasSwitch(switches::kDisableExtensions); | 56 command_line && command_line->HasSwitch(switches::kDisableExtensions); |
| 61 | 57 |
| 62 // Note that the GetPrefs() creates a TestingPrefService, therefore | 58 // Note that the GetPrefs() creates a TestingPrefService, therefore |
| 63 // the extension controlled pref values set in ExtensionPrefs | 59 // the extension controlled pref values set in ExtensionPrefs |
| 64 // are not reflected in the pref service. One would need to | 60 // are not reflected in the pref service. One would need to |
| 65 // inject a new ExtensionPrefStore(extension_pref_value_map, false). | 61 // inject a new ExtensionPrefStore(extension_pref_value_map, false). |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 StateStore* TestExtensionSystem::state_store() { | 133 StateStore* TestExtensionSystem::state_store() { |
| 138 return state_store_.get(); | 134 return state_store_.get(); |
| 139 } | 135 } |
| 140 | 136 |
| 141 StateStore* TestExtensionSystem::rules_store() { | 137 StateStore* TestExtensionSystem::rules_store() { |
| 142 return state_store_.get(); | 138 return state_store_.get(); |
| 143 } | 139 } |
| 144 | 140 |
| 145 InfoMap* TestExtensionSystem::info_map() { return info_map_.get(); } | 141 InfoMap* TestExtensionSystem::info_map() { return info_map_.get(); } |
| 146 | 142 |
| 147 LazyBackgroundTaskQueue* | |
| 148 TestExtensionSystem::lazy_background_task_queue() { | |
| 149 return lazy_background_task_queue_.get(); | |
| 150 } | |
| 151 | |
| 152 void TestExtensionSystem::SetEventRouter(scoped_ptr<EventRouter> event_router) { | 143 void TestExtensionSystem::SetEventRouter(scoped_ptr<EventRouter> event_router) { |
| 153 event_router_.reset(event_router.release()); | 144 event_router_.reset(event_router.release()); |
| 154 } | 145 } |
| 155 | 146 |
| 156 EventRouter* TestExtensionSystem::event_router() { return event_router_.get(); } | 147 EventRouter* TestExtensionSystem::event_router() { return event_router_.get(); } |
| 157 | 148 |
| 158 InstallVerifier* TestExtensionSystem::install_verifier() { | 149 InstallVerifier* TestExtensionSystem::install_verifier() { |
| 159 return install_verifier_.get(); | 150 return install_verifier_.get(); |
| 160 } | 151 } |
| 161 | 152 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 176 return extension_service()->shared_module_service()->GetDependentExtensions( | 167 return extension_service()->shared_module_service()->GetDependentExtensions( |
| 177 extension); | 168 extension); |
| 178 } | 169 } |
| 179 | 170 |
| 180 // static | 171 // static |
| 181 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { | 172 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { |
| 182 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 173 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
| 183 } | 174 } |
| 184 | 175 |
| 185 } // namespace extensions | 176 } // namespace extensions |
| OLD | NEW |