| 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" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 new RuntimeData(ExtensionRegistry::Get(browser_context_))); | 93 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
| 94 lazy_background_task_queue_.reset( | 94 lazy_background_task_queue_.reset( |
| 95 new LazyBackgroundTaskQueue(browser_context_)); | 95 new LazyBackgroundTaskQueue(browser_context_)); |
| 96 event_router_.reset( | 96 event_router_.reset( |
| 97 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); | 97 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); |
| 98 process_manager_.reset(ProcessManager::Create(browser_context_)); | 98 process_manager_.reset(ProcessManager::Create(browser_context_)); |
| 99 quota_service_.reset(new QuotaService); | 99 quota_service_.reset(new QuotaService); |
| 100 } | 100 } |
| 101 | 101 |
| 102 ExtensionService* ShellExtensionSystem::extension_service() { | 102 ExtensionService* ShellExtensionSystem::extension_service() { |
| 103 return NULL; | 103 return nullptr; |
| 104 } | 104 } |
| 105 | 105 |
| 106 RuntimeData* ShellExtensionSystem::runtime_data() { | 106 RuntimeData* ShellExtensionSystem::runtime_data() { |
| 107 return runtime_data_.get(); | 107 return runtime_data_.get(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 ManagementPolicy* ShellExtensionSystem::management_policy() { | 110 ManagementPolicy* ShellExtensionSystem::management_policy() { |
| 111 return NULL; | 111 return nullptr; |
| 112 } | 112 } |
| 113 | 113 |
| 114 SharedUserScriptMaster* ShellExtensionSystem::shared_user_script_master() { | 114 SharedUserScriptMaster* ShellExtensionSystem::shared_user_script_master() { |
| 115 return NULL; | 115 return nullptr; |
| 116 } | 116 } |
| 117 | 117 |
| 118 ProcessManager* ShellExtensionSystem::process_manager() { | 118 ProcessManager* ShellExtensionSystem::process_manager() { |
| 119 return process_manager_.get(); | 119 return process_manager_.get(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 StateStore* ShellExtensionSystem::state_store() { | 122 StateStore* ShellExtensionSystem::state_store() { |
| 123 return NULL; | 123 return nullptr; |
| 124 } | 124 } |
| 125 | 125 |
| 126 StateStore* ShellExtensionSystem::rules_store() { | 126 StateStore* ShellExtensionSystem::rules_store() { |
| 127 return NULL; | 127 return nullptr; |
| 128 } | 128 } |
| 129 | 129 |
| 130 InfoMap* ShellExtensionSystem::info_map() { | 130 InfoMap* ShellExtensionSystem::info_map() { |
| 131 if (!info_map_.get()) | 131 if (!info_map_.get()) |
| 132 info_map_ = new InfoMap; | 132 info_map_ = new InfoMap; |
| 133 return info_map_.get(); | 133 return info_map_.get(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 LazyBackgroundTaskQueue* ShellExtensionSystem::lazy_background_task_queue() { | 136 LazyBackgroundTaskQueue* ShellExtensionSystem::lazy_background_task_queue() { |
| 137 return lazy_background_task_queue_.get(); | 137 return lazy_background_task_queue_.get(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 EventRouter* ShellExtensionSystem::event_router() { | 140 EventRouter* ShellExtensionSystem::event_router() { |
| 141 return event_router_.get(); | 141 return event_router_.get(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 WarningService* ShellExtensionSystem::warning_service() { | 144 WarningService* ShellExtensionSystem::warning_service() { |
| 145 return NULL; | 145 return nullptr; |
| 146 } | 146 } |
| 147 | 147 |
| 148 Blacklist* ShellExtensionSystem::blacklist() { | 148 Blacklist* ShellExtensionSystem::blacklist() { |
| 149 return NULL; | 149 return nullptr; |
| 150 } | 150 } |
| 151 | 151 |
| 152 ErrorConsole* ShellExtensionSystem::error_console() { | 152 ErrorConsole* ShellExtensionSystem::error_console() { |
| 153 return NULL; | 153 return nullptr; |
| 154 } | 154 } |
| 155 | 155 |
| 156 InstallVerifier* ShellExtensionSystem::install_verifier() { | 156 InstallVerifier* ShellExtensionSystem::install_verifier() { |
| 157 return NULL; | 157 return nullptr; |
| 158 } | 158 } |
| 159 | 159 |
| 160 QuotaService* ShellExtensionSystem::quota_service() { | 160 QuotaService* ShellExtensionSystem::quota_service() { |
| 161 return quota_service_.get(); | 161 return quota_service_.get(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( | 164 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( |
| 165 const Extension* extension) { | 165 const Extension* extension) { |
| 166 BrowserThread::PostTask(BrowserThread::IO, | 166 BrowserThread::PostTask(BrowserThread::IO, |
| 167 FROM_HERE, | 167 FROM_HERE, |
| 168 base::Bind(&InfoMap::AddExtension, | 168 base::Bind(&InfoMap::AddExtension, |
| 169 info_map(), | 169 info_map(), |
| 170 make_scoped_refptr(extension), | 170 make_scoped_refptr(extension), |
| 171 base::Time::Now(), | 171 base::Time::Now(), |
| 172 false, | 172 false, |
| 173 false)); | 173 false)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( | 176 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( |
| 177 const std::string& extension_id, | 177 const std::string& extension_id, |
| 178 const UnloadedExtensionInfo::Reason reason) { | 178 const UnloadedExtensionInfo::Reason reason) { |
| 179 } | 179 } |
| 180 | 180 |
| 181 const OneShotEvent& ShellExtensionSystem::ready() const { | 181 const OneShotEvent& ShellExtensionSystem::ready() const { |
| 182 return ready_; | 182 return ready_; |
| 183 } | 183 } |
| 184 | 184 |
| 185 ContentVerifier* ShellExtensionSystem::content_verifier() { | 185 ContentVerifier* ShellExtensionSystem::content_verifier() { |
| 186 return NULL; | 186 return nullptr; |
| 187 } | 187 } |
| 188 | 188 |
| 189 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( | 189 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( |
| 190 const Extension* extension) { | 190 const Extension* extension) { |
| 191 scoped_ptr<ExtensionSet> empty(new ExtensionSet()); | 191 scoped_ptr<ExtensionSet> empty(new ExtensionSet()); |
| 192 return empty.PassAs<ExtensionSet>(); | 192 return empty.PassAs<ExtensionSet>(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 DeclarativeUserScriptMaster* | 195 DeclarativeUserScriptMaster* |
| 196 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension( | 196 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension( |
| 197 const ExtensionId& extension_id) { | 197 const ExtensionId& extension_id) { |
| 198 return NULL; | 198 return nullptr; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace extensions | 201 } // namespace extensions |
| OLD | NEW |