| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/shell/browser/shell_extension_system.h" | 5 #include "apps/shell/browser/shell_extension_system.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
| 10 #include "apps/browser/api/app_runtime/app_runtime_api.h" | 10 #include "apps/browser/api/app_runtime/app_runtime_api.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // * Create a PermissionsUpdater. | 56 // * Create a PermissionsUpdater. |
| 57 // * Call PermissionsUpdater::GrantActivePermissions(). | 57 // * Call PermissionsUpdater::GrantActivePermissions(). |
| 58 // * Call ExtensionService::SatisfyImports(). | 58 // * Call ExtensionService::SatisfyImports(). |
| 59 // * Call ExtensionPrefs::OnExtensionInstalled(). | 59 // * Call ExtensionPrefs::OnExtensionInstalled(). |
| 60 // * Send NOTIFICATION_EXTENSION_INSTALLED. | 60 // * Send NOTIFICATION_EXTENSION_INSTALLED. |
| 61 | 61 |
| 62 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension); | 62 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension); |
| 63 | 63 |
| 64 RegisterExtensionWithRequestContexts(extension); | 64 RegisterExtensionWithRequestContexts(extension); |
| 65 | 65 |
| 66 if (BackgroundInfo::HasServiceWorker(extension)) |
| 67 ServiceWorkerManager::Get(browser_context_)->RegisterExtension(extension); |
| 68 |
| 66 content::NotificationService::current()->Notify( | 69 content::NotificationService::current()->Notify( |
| 67 chrome::NOTIFICATION_EXTENSION_LOADED, | 70 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 68 content::Source<BrowserContext>(browser_context_), | 71 content::Source<BrowserContext>(browser_context_), |
| 69 content::Details<const Extension>(extension)); | 72 content::Details<const Extension>(extension)); |
| 70 | 73 |
| 71 // Inform the rest of the extensions system to start. | 74 // Inform the rest of the extensions system to start. |
| 72 ready_.Signal(); | 75 ready_.Signal(); |
| 73 content::NotificationService::current()->Notify( | 76 content::NotificationService::current()->Notify( |
| 74 chrome::NOTIFICATION_EXTENSIONS_READY, | 77 chrome::NOTIFICATION_EXTENSIONS_READY, |
| 75 content::Source<BrowserContext>(browser_context_), | 78 content::Source<BrowserContext>(browser_context_), |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( | 177 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( |
| 175 const std::string& extension_id, | 178 const std::string& extension_id, |
| 176 const UnloadedExtensionInfo::Reason reason) { | 179 const UnloadedExtensionInfo::Reason reason) { |
| 177 } | 180 } |
| 178 | 181 |
| 179 const OneShotEvent& ShellExtensionSystem::ready() const { | 182 const OneShotEvent& ShellExtensionSystem::ready() const { |
| 180 return ready_; | 183 return ready_; |
| 181 } | 184 } |
| 182 | 185 |
| 183 } // namespace extensions | 186 } // namespace extensions |
| OLD | NEW |