| 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/extension_prefs.h" | 17 #include "extensions/browser/extension_prefs.h" |
| 18 #include "extensions/browser/extension_registry.h" | 18 #include "extensions/browser/extension_registry.h" |
| 19 #include "extensions/browser/info_map.h" | 19 #include "extensions/browser/info_map.h" |
| 20 #include "extensions/browser/notification_types.h" | 20 #include "extensions/browser/notification_types.h" |
| 21 #include "extensions/browser/null_app_sorting.h" |
| 21 #include "extensions/browser/quota_service.h" | 22 #include "extensions/browser/quota_service.h" |
| 22 #include "extensions/browser/runtime_data.h" | 23 #include "extensions/browser/runtime_data.h" |
| 23 #include "extensions/common/constants.h" | 24 #include "extensions/common/constants.h" |
| 24 #include "extensions/common/file_util.h" | 25 #include "extensions/common/file_util.h" |
| 25 | 26 |
| 26 using content::BrowserContext; | 27 using content::BrowserContext; |
| 27 using content::BrowserThread; | 28 using content::BrowserThread; |
| 28 | 29 |
| 29 namespace extensions { | 30 namespace extensions { |
| 30 | 31 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 browser_context_, extension, extensions::SOURCE_UNTRACKED); | 91 browser_context_, extension, extensions::SOURCE_UNTRACKED); |
| 91 } | 92 } |
| 92 | 93 |
| 93 void ShellExtensionSystem::Shutdown() { | 94 void ShellExtensionSystem::Shutdown() { |
| 94 } | 95 } |
| 95 | 96 |
| 96 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { | 97 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { |
| 97 runtime_data_.reset( | 98 runtime_data_.reset( |
| 98 new RuntimeData(ExtensionRegistry::Get(browser_context_))); | 99 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
| 99 quota_service_.reset(new QuotaService); | 100 quota_service_.reset(new QuotaService); |
| 101 app_sorting_.reset(new NullAppSorting); |
| 100 } | 102 } |
| 101 | 103 |
| 102 ExtensionService* ShellExtensionSystem::extension_service() { | 104 ExtensionService* ShellExtensionSystem::extension_service() { |
| 103 return nullptr; | 105 return nullptr; |
| 104 } | 106 } |
| 105 | 107 |
| 106 RuntimeData* ShellExtensionSystem::runtime_data() { | 108 RuntimeData* ShellExtensionSystem::runtime_data() { |
| 107 return runtime_data_.get(); | 109 return runtime_data_.get(); |
| 108 } | 110 } |
| 109 | 111 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 126 InfoMap* ShellExtensionSystem::info_map() { | 128 InfoMap* ShellExtensionSystem::info_map() { |
| 127 if (!info_map_.get()) | 129 if (!info_map_.get()) |
| 128 info_map_ = new InfoMap; | 130 info_map_ = new InfoMap; |
| 129 return info_map_.get(); | 131 return info_map_.get(); |
| 130 } | 132 } |
| 131 | 133 |
| 132 QuotaService* ShellExtensionSystem::quota_service() { | 134 QuotaService* ShellExtensionSystem::quota_service() { |
| 133 return quota_service_.get(); | 135 return quota_service_.get(); |
| 134 } | 136 } |
| 135 | 137 |
| 138 AppSorting* ShellExtensionSystem::app_sorting() { |
| 139 return app_sorting_.get(); |
| 140 } |
| 141 |
| 136 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( | 142 void ShellExtensionSystem::RegisterExtensionWithRequestContexts( |
| 137 const Extension* extension) { | 143 const Extension* extension) { |
| 138 BrowserThread::PostTask(BrowserThread::IO, | 144 BrowserThread::PostTask(BrowserThread::IO, |
| 139 FROM_HERE, | 145 FROM_HERE, |
| 140 base::Bind(&InfoMap::AddExtension, | 146 base::Bind(&InfoMap::AddExtension, |
| 141 info_map(), | 147 info_map(), |
| 142 make_scoped_refptr(extension), | 148 make_scoped_refptr(extension), |
| 143 base::Time::Now(), | 149 base::Time::Now(), |
| 144 false, | 150 false, |
| 145 false)); | 151 false)); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 157 ContentVerifier* ShellExtensionSystem::content_verifier() { | 163 ContentVerifier* ShellExtensionSystem::content_verifier() { |
| 158 return nullptr; | 164 return nullptr; |
| 159 } | 165 } |
| 160 | 166 |
| 161 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( | 167 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( |
| 162 const Extension* extension) { | 168 const Extension* extension) { |
| 163 return make_scoped_ptr(new ExtensionSet()); | 169 return make_scoped_ptr(new ExtensionSet()); |
| 164 } | 170 } |
| 165 | 171 |
| 166 } // namespace extensions | 172 } // namespace extensions |
| OLD | NEW |