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

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: Roughly wire things up and add a test Created 6 years, 9 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
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 "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/DEPS » ('j') | chrome/browser/extensions/service_worker_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698