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" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 void ShellExtensionSystem::LaunchApp(const ExtensionId& extension_id) { | 91 void ShellExtensionSystem::LaunchApp(const ExtensionId& extension_id) { |
92 // Send the onLaunched event. | 92 // Send the onLaunched event. |
93 DCHECK(ExtensionRegistry::Get(browser_context_) | 93 DCHECK(ExtensionRegistry::Get(browser_context_) |
94 ->enabled_extensions() | 94 ->enabled_extensions() |
95 .Contains(extension_id)); | 95 .Contains(extension_id)); |
96 const Extension* extension = ExtensionRegistry::Get(browser_context_) | 96 const Extension* extension = ExtensionRegistry::Get(browser_context_) |
97 ->enabled_extensions() | 97 ->enabled_extensions() |
98 .GetByID(extension_id); | 98 .GetByID(extension_id); |
99 AppRuntimeEventRouter::DispatchOnLaunchedEvent( | 99 AppRuntimeEventRouter::DispatchOnLaunchedEvent(browser_context_, extension, |
100 browser_context_, extension, SOURCE_UNTRACKED, | 100 SOURCE_UNTRACKED, nullptr); |
101 std::unique_ptr<api::app_runtime::ActionData>()); | |
102 } | 101 } |
103 | 102 |
104 void ShellExtensionSystem::Shutdown() { | 103 void ShellExtensionSystem::Shutdown() { |
105 } | 104 } |
106 | 105 |
107 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { | 106 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { |
108 service_worker_manager_.reset(new ServiceWorkerManager(browser_context_)); | 107 service_worker_manager_.reset(new ServiceWorkerManager(browser_context_)); |
109 runtime_data_.reset( | 108 runtime_data_.reset( |
110 new RuntimeData(ExtensionRegistry::Get(browser_context_))); | 109 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
111 quota_service_.reset(new QuotaService); | 110 quota_service_.reset(new QuotaService); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 192 } |
194 | 193 |
195 void ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts( | 194 void ShellExtensionSystem::OnExtensionRegisteredWithRequestContexts( |
196 scoped_refptr<Extension> extension) { | 195 scoped_refptr<Extension> extension) { |
197 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); | 196 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); |
198 registry->AddReady(extension); | 197 registry->AddReady(extension); |
199 registry->TriggerOnReady(extension.get()); | 198 registry->TriggerOnReady(extension.get()); |
200 } | 199 } |
201 | 200 |
202 } // namespace extensions | 201 } // namespace extensions |
OLD | NEW |