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" |
11 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
14 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
15 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
17 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
18 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
19 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
20 #include "extensions/browser/info_map.h" | 20 #include "extensions/browser/info_map.h" |
21 #include "extensions/browser/lazy_background_task_queue.h" | 21 #include "extensions/browser/lazy_background_task_queue.h" |
22 #include "extensions/browser/notification_types.h" | 22 #include "extensions/browser/notification_types.h" |
23 #include "extensions/browser/quota_service.h" | 23 #include "extensions/browser/quota_service.h" |
24 #include "extensions/browser/runtime_data.h" | 24 #include "extensions/browser/runtime_data.h" |
| 25 #include "extensions/common/constants.h" |
25 #include "extensions/common/file_util.h" | 26 #include "extensions/common/file_util.h" |
26 | 27 |
27 using content::BrowserContext; | 28 using content::BrowserContext; |
28 using content::BrowserThread; | 29 using content::BrowserThread; |
29 | 30 |
30 namespace extensions { | 31 namespace extensions { |
31 | 32 |
32 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context) | 33 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context) |
33 : browser_context_(browser_context) { | 34 : browser_context_(browser_context) { |
34 } | 35 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 81 } |
81 | 82 |
82 void ShellExtensionSystem::LaunchApp(const ExtensionId& extension_id) { | 83 void ShellExtensionSystem::LaunchApp(const ExtensionId& extension_id) { |
83 // Send the onLaunched event. | 84 // Send the onLaunched event. |
84 DCHECK(ExtensionRegistry::Get(browser_context_) | 85 DCHECK(ExtensionRegistry::Get(browser_context_) |
85 ->enabled_extensions() | 86 ->enabled_extensions() |
86 .Contains(extension_id)); | 87 .Contains(extension_id)); |
87 const Extension* extension = ExtensionRegistry::Get(browser_context_) | 88 const Extension* extension = ExtensionRegistry::Get(browser_context_) |
88 ->enabled_extensions() | 89 ->enabled_extensions() |
89 .GetByID(extension_id); | 90 .GetByID(extension_id); |
90 AppRuntimeEventRouter::DispatchOnLaunchedEvent(browser_context_, extension); | 91 AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
| 92 browser_context_, extension, extensions::SOURCE_UNTRACKED); |
91 } | 93 } |
92 | 94 |
93 void ShellExtensionSystem::Shutdown() { | 95 void ShellExtensionSystem::Shutdown() { |
94 } | 96 } |
95 | 97 |
96 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { | 98 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { |
97 runtime_data_.reset( | 99 runtime_data_.reset( |
98 new RuntimeData(ExtensionRegistry::Get(browser_context_))); | 100 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
99 lazy_background_task_queue_.reset( | 101 lazy_background_task_queue_.reset( |
100 new LazyBackgroundTaskQueue(browser_context_)); | 102 new LazyBackgroundTaskQueue(browser_context_)); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return make_scoped_ptr(new ExtensionSet()); | 193 return make_scoped_ptr(new ExtensionSet()); |
192 } | 194 } |
193 | 195 |
194 DeclarativeUserScriptMaster* | 196 DeclarativeUserScriptMaster* |
195 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension( | 197 ShellExtensionSystem::GetDeclarativeUserScriptMasterByExtension( |
196 const ExtensionId& extension_id) { | 198 const ExtensionId& extension_id) { |
197 return NULL; | 199 return NULL; |
198 } | 200 } |
199 | 201 |
200 } // namespace extensions | 202 } // namespace extensions |
OLD | NEW |