OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_extension_system.h" | 5 #include "extensions/shell/browser/shell_extension_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
14 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
15 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
17 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
18 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
19 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
20 #include "extensions/browser/info_map.h" | 20 #include "extensions/browser/info_map.h" |
21 #include "extensions/browser/lazy_background_task_queue.h" | |
22 #include "extensions/browser/notification_types.h" | 21 #include "extensions/browser/notification_types.h" |
23 #include "extensions/browser/quota_service.h" | 22 #include "extensions/browser/quota_service.h" |
24 #include "extensions/browser/runtime_data.h" | 23 #include "extensions/browser/runtime_data.h" |
25 #include "extensions/common/constants.h" | 24 #include "extensions/common/constants.h" |
26 #include "extensions/common/file_util.h" | 25 #include "extensions/common/file_util.h" |
27 | 26 |
28 using content::BrowserContext; | 27 using content::BrowserContext; |
29 using content::BrowserThread; | 28 using content::BrowserThread; |
30 | 29 |
31 namespace extensions { | 30 namespace extensions { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 AppRuntimeEventRouter::DispatchOnLaunchedEvent( | 90 AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
92 browser_context_, extension, extensions::SOURCE_UNTRACKED); | 91 browser_context_, extension, extensions::SOURCE_UNTRACKED); |
93 } | 92 } |
94 | 93 |
95 void ShellExtensionSystem::Shutdown() { | 94 void ShellExtensionSystem::Shutdown() { |
96 } | 95 } |
97 | 96 |
98 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { | 97 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { |
99 runtime_data_.reset( | 98 runtime_data_.reset( |
100 new RuntimeData(ExtensionRegistry::Get(browser_context_))); | 99 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
101 lazy_background_task_queue_.reset( | |
102 new LazyBackgroundTaskQueue(browser_context_)); | |
103 event_router_.reset( | 100 event_router_.reset( |
104 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); | 101 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); |
105 quota_service_.reset(new QuotaService); | 102 quota_service_.reset(new QuotaService); |
106 } | 103 } |
107 | 104 |
108 ExtensionService* ShellExtensionSystem::extension_service() { | 105 ExtensionService* ShellExtensionSystem::extension_service() { |
109 return nullptr; | 106 return nullptr; |
110 } | 107 } |
111 | 108 |
112 RuntimeData* ShellExtensionSystem::runtime_data() { | 109 RuntimeData* ShellExtensionSystem::runtime_data() { |
(...skipping 15 matching lines...) Expand all Loading... |
128 StateStore* ShellExtensionSystem::rules_store() { | 125 StateStore* ShellExtensionSystem::rules_store() { |
129 return nullptr; | 126 return nullptr; |
130 } | 127 } |
131 | 128 |
132 InfoMap* ShellExtensionSystem::info_map() { | 129 InfoMap* ShellExtensionSystem::info_map() { |
133 if (!info_map_.get()) | 130 if (!info_map_.get()) |
134 info_map_ = new InfoMap; | 131 info_map_ = new InfoMap; |
135 return info_map_.get(); | 132 return info_map_.get(); |
136 } | 133 } |
137 | 134 |
138 LazyBackgroundTaskQueue* ShellExtensionSystem::lazy_background_task_queue() { | |
139 return lazy_background_task_queue_.get(); | |
140 } | |
141 | |
142 EventRouter* ShellExtensionSystem::event_router() { | 135 EventRouter* ShellExtensionSystem::event_router() { |
143 return event_router_.get(); | 136 return event_router_.get(); |
144 } | 137 } |
145 | 138 |
146 QuotaService* ShellExtensionSystem::quota_service() { | 139 QuotaService* ShellExtensionSystem::quota_service() { |
147 return quota_service_.get(); | 140 return quota_service_.get(); |
148 } | 141 } |
149 | 142 |
150 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( | 143 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( |
151 const Extension* extension) { | 144 const Extension* extension) { |
(...skipping 19 matching lines...) Expand all Loading... |
171 ContentVerifier* ShellExtensionSystem::content_verifier() { | 164 ContentVerifier* ShellExtensionSystem::content_verifier() { |
172 return nullptr; | 165 return nullptr; |
173 } | 166 } |
174 | 167 |
175 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( | 168 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( |
176 const Extension* extension) { | 169 const Extension* extension) { |
177 return make_scoped_ptr(new ExtensionSet()); | 170 return make_scoped_ptr(new ExtensionSet()); |
178 } | 171 } |
179 | 172 |
180 } // namespace extensions | 173 } // namespace extensions |
OLD | NEW |