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 30 matching lines...) Expand all Loading... |
41 quota_service_(new QuotaService()) {} | 41 quota_service_(new QuotaService()) {} |
42 | 42 |
43 TestExtensionSystem::~TestExtensionSystem() { | 43 TestExtensionSystem::~TestExtensionSystem() { |
44 } | 44 } |
45 | 45 |
46 void TestExtensionSystem::Shutdown() { | 46 void TestExtensionSystem::Shutdown() { |
47 if (extension_service_) | 47 if (extension_service_) |
48 extension_service_->Shutdown(); | 48 extension_service_->Shutdown(); |
49 } | 49 } |
50 | 50 |
51 void TestExtensionSystem::CreateLazyBackgroundTaskQueue() { | |
52 lazy_background_task_queue_.reset(new LazyBackgroundTaskQueue(profile_)); | |
53 } | |
54 | |
55 ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( | 51 ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( |
56 const base::CommandLine* command_line, | 52 const base::CommandLine* command_line, |
57 const base::FilePath& install_directory) { | 53 const base::FilePath& install_directory) { |
58 bool extensions_disabled = | 54 bool extensions_disabled = |
59 command_line && command_line->HasSwitch(switches::kDisableExtensions); | 55 command_line && command_line->HasSwitch(switches::kDisableExtensions); |
60 | 56 |
61 // Note that the GetPrefs() creates a TestingPrefService, therefore | 57 // Note that the GetPrefs() creates a TestingPrefService, therefore |
62 // the extension controlled pref values set in ExtensionPrefs | 58 // the extension controlled pref values set in ExtensionPrefs |
63 // are not reflected in the pref service. One would need to | 59 // are not reflected in the pref service. One would need to |
64 // inject a new ExtensionPrefStore(extension_pref_value_map, false). | 60 // inject a new ExtensionPrefStore(extension_pref_value_map, false). |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 StateStore* TestExtensionSystem::state_store() { | 123 StateStore* TestExtensionSystem::state_store() { |
128 return state_store_.get(); | 124 return state_store_.get(); |
129 } | 125 } |
130 | 126 |
131 StateStore* TestExtensionSystem::rules_store() { | 127 StateStore* TestExtensionSystem::rules_store() { |
132 return state_store_.get(); | 128 return state_store_.get(); |
133 } | 129 } |
134 | 130 |
135 InfoMap* TestExtensionSystem::info_map() { return info_map_.get(); } | 131 InfoMap* TestExtensionSystem::info_map() { return info_map_.get(); } |
136 | 132 |
137 LazyBackgroundTaskQueue* | |
138 TestExtensionSystem::lazy_background_task_queue() { | |
139 return lazy_background_task_queue_.get(); | |
140 } | |
141 | |
142 void TestExtensionSystem::SetEventRouter(scoped_ptr<EventRouter> event_router) { | 133 void TestExtensionSystem::SetEventRouter(scoped_ptr<EventRouter> event_router) { |
143 event_router_.reset(event_router.release()); | 134 event_router_.reset(event_router.release()); |
144 } | 135 } |
145 | 136 |
146 EventRouter* TestExtensionSystem::event_router() { return event_router_.get(); } | 137 EventRouter* TestExtensionSystem::event_router() { return event_router_.get(); } |
147 | 138 |
148 QuotaService* TestExtensionSystem::quota_service() { | 139 QuotaService* TestExtensionSystem::quota_service() { |
149 return quota_service_.get(); | 140 return quota_service_.get(); |
150 } | 141 } |
151 | 142 |
(...skipping 10 matching lines...) Expand all Loading... |
162 return extension_service()->shared_module_service()->GetDependentExtensions( | 153 return extension_service()->shared_module_service()->GetDependentExtensions( |
163 extension); | 154 extension); |
164 } | 155 } |
165 | 156 |
166 // static | 157 // static |
167 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { | 158 KeyedService* TestExtensionSystem::Build(content::BrowserContext* profile) { |
168 return new TestExtensionSystem(static_cast<Profile*>(profile)); | 159 return new TestExtensionSystem(static_cast<Profile*>(profile)); |
169 } | 160 } |
170 | 161 |
171 } // namespace extensions | 162 } // namespace extensions |
OLD | NEW |