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/shell_extension_system.h" | 5 #include "apps/shell/shell_extension_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/common/extensions/extension_file_util.h" | 12 #include "chrome/common/extensions/extension_file_util.h" |
13 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
17 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
18 #include "extensions/browser/event_router.h" | 18 #include "extensions/browser/event_router.h" |
19 #include "extensions/browser/extension_prefs.h" | 19 #include "extensions/browser/extension_prefs.h" |
20 #include "extensions/browser/extension_registry.h" | 20 #include "extensions/browser/extension_registry.h" |
21 #include "extensions/browser/info_map.h" | 21 #include "extensions/browser/info_map.h" |
22 #include "extensions/browser/lazy_background_task_queue.h" | 22 #include "extensions/browser/lazy_background_task_queue.h" |
23 #include "extensions/browser/process_manager.h" | 23 #include "extensions/browser/process_manager.h" |
| 24 #include "extensions/browser/runtime_data.h" |
24 | 25 |
25 using content::BrowserContext; | 26 using content::BrowserContext; |
26 using content::BrowserThread; | 27 using content::BrowserThread; |
27 | 28 |
28 namespace extensions { | 29 namespace extensions { |
29 | 30 |
30 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context) | 31 ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context) |
31 : browser_context_(browser_context) { | 32 : browser_context_(browser_context) { |
32 } | 33 } |
33 | 34 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 content::Source<BrowserContext>(browser_context_), | 71 content::Source<BrowserContext>(browser_context_), |
71 content::NotificationService::NoDetails()); | 72 content::NotificationService::NoDetails()); |
72 | 73 |
73 return true; | 74 return true; |
74 } | 75 } |
75 | 76 |
76 void ShellExtensionSystem::Shutdown() { | 77 void ShellExtensionSystem::Shutdown() { |
77 } | 78 } |
78 | 79 |
79 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { | 80 void ShellExtensionSystem::InitForRegularProfile(bool extensions_enabled) { |
| 81 runtime_data_.reset( |
| 82 new RuntimeData(ExtensionRegistry::Get(browser_context_))); |
80 lazy_background_task_queue_.reset( | 83 lazy_background_task_queue_.reset( |
81 new LazyBackgroundTaskQueue(browser_context_)); | 84 new LazyBackgroundTaskQueue(browser_context_)); |
82 event_router_.reset( | 85 event_router_.reset( |
83 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); | 86 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); |
84 process_manager_.reset(ProcessManager::Create(browser_context_)); | 87 process_manager_.reset(ProcessManager::Create(browser_context_)); |
85 } | 88 } |
86 | 89 |
87 ExtensionService* ShellExtensionSystem::extension_service() { | 90 ExtensionService* ShellExtensionSystem::extension_service() { |
88 return NULL; | 91 return NULL; |
89 } | 92 } |
90 | 93 |
| 94 RuntimeData* ShellExtensionSystem::runtime_data() { |
| 95 return runtime_data_.get(); |
| 96 } |
| 97 |
91 ManagementPolicy* ShellExtensionSystem::management_policy() { | 98 ManagementPolicy* ShellExtensionSystem::management_policy() { |
92 return NULL; | 99 return NULL; |
93 } | 100 } |
94 | 101 |
95 UserScriptMaster* ShellExtensionSystem::user_script_master() { | 102 UserScriptMaster* ShellExtensionSystem::user_script_master() { |
96 return NULL; | 103 return NULL; |
97 } | 104 } |
98 | 105 |
99 ProcessManager* ShellExtensionSystem::process_manager() { | 106 ProcessManager* ShellExtensionSystem::process_manager() { |
100 return process_manager_.get(); | 107 return process_manager_.get(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( | 157 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( |
151 const std::string& extension_id, | 158 const std::string& extension_id, |
152 const UnloadedExtensionInfo::Reason reason) { | 159 const UnloadedExtensionInfo::Reason reason) { |
153 } | 160 } |
154 | 161 |
155 const OneShotEvent& ShellExtensionSystem::ready() const { | 162 const OneShotEvent& ShellExtensionSystem::ready() const { |
156 return ready_; | 163 return ready_; |
157 } | 164 } |
158 | 165 |
159 } // namespace extensions | 166 } // namespace extensions |
OLD | NEW |