Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: apps/shell/browser/shell_extension_system.cc

Issue 182253010: Register a Service Worker when an extension is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to r261176 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/DEPS » ('j') | extensions/browser/extension_host.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/DEPS » ('j') | extensions/browser/extension_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698