| 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 "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // * Create a PermissionsUpdater. | 55 // * Create a PermissionsUpdater. |
| 56 // * Call PermissionsUpdater::GrantActivePermissions(). | 56 // * Call PermissionsUpdater::GrantActivePermissions(). |
| 57 // * Call ExtensionService::SatisfyImports(). | 57 // * Call ExtensionService::SatisfyImports(). |
| 58 // * Call ExtensionPrefs::OnExtensionInstalled(). | 58 // * Call ExtensionPrefs::OnExtensionInstalled(). |
| 59 // * Send NOTIFICATION_EXTENSION_INSTALLED. | 59 // * Send NOTIFICATION_EXTENSION_INSTALLED. |
| 60 | 60 |
| 61 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension); | 61 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension); |
| 62 | 62 |
| 63 RegisterExtensionWithRequestContexts(extension); | 63 RegisterExtensionWithRequestContexts(extension); |
| 64 | 64 |
| 65 if (BackgroundInfo::HasServiceWorker(extension)) |
| 66 ServiceWorkerManager::Get(browser_context_)->RegisterExtension(extension); |
| 67 |
| 65 content::NotificationService::current()->Notify( | 68 content::NotificationService::current()->Notify( |
| 66 chrome::NOTIFICATION_EXTENSION_LOADED, | 69 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 67 content::Source<BrowserContext>(browser_context_), | 70 content::Source<BrowserContext>(browser_context_), |
| 68 content::Details<const Extension>(extension)); | 71 content::Details<const Extension>(extension)); |
| 69 | 72 |
| 70 // Inform the rest of the extensions system to start. | 73 // Inform the rest of the extensions system to start. |
| 71 ready_.Signal(); | 74 ready_.Signal(); |
| 72 content::NotificationService::current()->Notify( | 75 content::NotificationService::current()->Notify( |
| 73 chrome::NOTIFICATION_EXTENSIONS_READY, | 76 chrome::NOTIFICATION_EXTENSIONS_READY, |
| 74 content::Source<BrowserContext>(browser_context_), | 77 content::Source<BrowserContext>(browser_context_), |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( | 184 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( |
| 182 const std::string& extension_id, | 185 const std::string& extension_id, |
| 183 const UnloadedExtensionInfo::Reason reason) { | 186 const UnloadedExtensionInfo::Reason reason) { |
| 184 } | 187 } |
| 185 | 188 |
| 186 const OneShotEvent& ShellExtensionSystem::ready() const { | 189 const OneShotEvent& ShellExtensionSystem::ready() const { |
| 187 return ready_; | 190 return ready_; |
| 188 } | 191 } |
| 189 | 192 |
| 190 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |