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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "chrome/browser/chrome_notification_types.h" | |
12 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
13 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
15 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
16 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
17 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 16 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
18 #include "extensions/browser/event_router.h" | 17 #include "extensions/browser/event_router.h" |
19 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
20 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
21 #include "extensions/browser/info_map.h" | 20 #include "extensions/browser/info_map.h" |
22 #include "extensions/browser/lazy_background_task_queue.h" | 21 #include "extensions/browser/lazy_background_task_queue.h" |
| 22 #include "extensions/browser/notification_types.h" |
23 #include "extensions/browser/process_manager.h" | 23 #include "extensions/browser/process_manager.h" |
24 #include "extensions/browser/quota_service.h" | 24 #include "extensions/browser/quota_service.h" |
25 #include "extensions/browser/runtime_data.h" | 25 #include "extensions/browser/runtime_data.h" |
26 #include "extensions/common/file_util.h" | 26 #include "extensions/common/file_util.h" |
27 #include "extensions/shell/browser/api/shell/shell_api.h" | 27 #include "extensions/shell/browser/api/shell/shell_api.h" |
28 | 28 |
29 using content::BrowserContext; | 29 using content::BrowserContext; |
30 using content::BrowserThread; | 30 using content::BrowserThread; |
31 | 31 |
32 namespace extensions { | 32 namespace extensions { |
(...skipping 26 matching lines...) Expand all Loading... |
59 // * Call PermissionsUpdater::GrantActivePermissions(). | 59 // * Call PermissionsUpdater::GrantActivePermissions(). |
60 // * Call ExtensionService::SatisfyImports(). | 60 // * Call ExtensionService::SatisfyImports(). |
61 // * Call ExtensionPrefs::OnExtensionInstalled(). | 61 // * Call ExtensionPrefs::OnExtensionInstalled(). |
62 // * Send NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED. | 62 // * Send NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED. |
63 | 63 |
64 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension_); | 64 ExtensionRegistry::Get(browser_context_)->AddEnabled(extension_); |
65 | 65 |
66 RegisterExtensionWithRequestContexts(extension_); | 66 RegisterExtensionWithRequestContexts(extension_); |
67 | 67 |
68 content::NotificationService::current()->Notify( | 68 content::NotificationService::current()->Notify( |
69 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 69 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
70 content::Source<BrowserContext>(browser_context_), | 70 content::Source<BrowserContext>(browser_context_), |
71 content::Details<const Extension>(extension_)); | 71 content::Details<const Extension>(extension_)); |
72 | 72 |
73 // Inform the rest of the extensions system to start. | 73 // Inform the rest of the extensions system to start. |
74 ready_.Signal(); | 74 ready_.Signal(); |
75 content::NotificationService::current()->Notify( | 75 content::NotificationService::current()->Notify( |
76 chrome::NOTIFICATION_EXTENSIONS_READY, | 76 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, |
77 content::Source<BrowserContext>(browser_context_), | 77 content::Source<BrowserContext>(browser_context_), |
78 content::NotificationService::NoDetails()); | 78 content::NotificationService::NoDetails()); |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 void ShellExtensionSystem::LaunchApp() { | 82 void ShellExtensionSystem::LaunchApp() { |
83 // Send the onLaunched event. | 83 // Send the onLaunched event. |
84 DCHECK(extension_.get()); | 84 DCHECK(extension_.get()); |
85 AppRuntimeEventRouter::DispatchOnLaunchedEvent(browser_context_, | 85 AppRuntimeEventRouter::DispatchOnLaunchedEvent(browser_context_, |
86 extension_.get()); | 86 extension_.get()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return NULL; | 187 return NULL; |
188 } | 188 } |
189 | 189 |
190 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( | 190 scoped_ptr<ExtensionSet> ShellExtensionSystem::GetDependentExtensions( |
191 const Extension* extension) { | 191 const Extension* extension) { |
192 scoped_ptr<ExtensionSet> empty(new ExtensionSet()); | 192 scoped_ptr<ExtensionSet> empty(new ExtensionSet()); |
193 return empty.PassAs<ExtensionSet>(); | 193 return empty.PassAs<ExtensionSet>(); |
194 } | 194 } |
195 | 195 |
196 } // namespace extensions | 196 } // namespace extensions |
OLD | NEW |