| 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/browser/extensions/extension_prefs.h" | 12 #include "chrome/browser/extensions/extension_prefs.h" |
| 13 #include "chrome/common/extensions/extension_file_util.h" | 13 #include "chrome/common/extensions/extension_file_util.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.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(new RuntimeData); |
| 80 lazy_background_task_queue_.reset( | 82 lazy_background_task_queue_.reset( |
| 81 new LazyBackgroundTaskQueue(browser_context_)); | 83 new LazyBackgroundTaskQueue(browser_context_)); |
| 82 event_router_.reset( | 84 event_router_.reset( |
| 83 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); | 85 new EventRouter(browser_context_, ExtensionPrefs::Get(browser_context_))); |
| 84 process_manager_.reset(ProcessManager::Create(browser_context_)); | 86 process_manager_.reset(ProcessManager::Create(browser_context_)); |
| 85 } | 87 } |
| 86 | 88 |
| 87 ExtensionService* ShellExtensionSystem::extension_service() { | 89 ExtensionService* ShellExtensionSystem::extension_service() { |
| 88 return NULL; | 90 return NULL; |
| 89 } | 91 } |
| 90 | 92 |
| 93 RuntimeData* ShellExtensionSystem::runtime_data() { |
| 94 return runtime_data_.get(); |
| 95 } |
| 96 |
| 91 ManagementPolicy* ShellExtensionSystem::management_policy() { | 97 ManagementPolicy* ShellExtensionSystem::management_policy() { |
| 92 return NULL; | 98 return NULL; |
| 93 } | 99 } |
| 94 | 100 |
| 95 UserScriptMaster* ShellExtensionSystem::user_script_master() { | 101 UserScriptMaster* ShellExtensionSystem::user_script_master() { |
| 96 return NULL; | 102 return NULL; |
| 97 } | 103 } |
| 98 | 104 |
| 99 ProcessManager* ShellExtensionSystem::process_manager() { | 105 ProcessManager* ShellExtensionSystem::process_manager() { |
| 100 return process_manager_.get(); | 106 return process_manager_.get(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( | 156 void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( |
| 151 const std::string& extension_id, | 157 const std::string& extension_id, |
| 152 const UnloadedExtensionInfo::Reason reason) { | 158 const UnloadedExtensionInfo::Reason reason) { |
| 153 } | 159 } |
| 154 | 160 |
| 155 const OneShotEvent& ShellExtensionSystem::ready() const { | 161 const OneShotEvent& ShellExtensionSystem::ready() const { |
| 156 return ready_; | 162 return ready_; |
| 157 } | 163 } |
| 158 | 164 |
| 159 } // namespace extensions | 165 } // namespace extensions |
| OLD | NEW |