OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/platform_app_service.h" | 5 #include "chrome/browser/platform_apps/platform_app_service.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/common/chrome_notification_types.h" | 8 #include "chrome/common/chrome_notification_types.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
11 #include "content/public/browser/notification_details.h" | 11 #include "content/public/browser/notification_details.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
14 | 14 |
15 namespace extensions { | 15 namespace platform_apps { |
16 | 16 |
17 PlatformAppService::PlatformAppService(Profile* profile) { | 17 PlatformAppService::PlatformAppService(Profile* profile) { |
18 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 18 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
19 content::Source<content::BrowserContext>(profile)); | 19 content::Source<content::BrowserContext>(profile)); |
20 } | 20 } |
21 | 21 |
22 PlatformAppService::~PlatformAppService() {} | 22 PlatformAppService::~PlatformAppService() {} |
23 | 23 |
24 void PlatformAppService::Observe(int type, | 24 void PlatformAppService::Observe(int type, |
25 const content::NotificationSource& source, | 25 const content::NotificationSource& source, |
26 const content::NotificationDetails& details) { | 26 const content::NotificationDetails& details) { |
27 switch (type) { | 27 switch (type) { |
28 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: { | 28 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: { |
29 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); | 29 extensions::ExtensionHost* host = |
| 30 content::Details<extensions::ExtensionHost>(details).ptr(); |
30 if (host->extension()->is_platform_app()) | 31 if (host->extension()->is_platform_app()) |
31 host->SetKeepsBrowserProcessAlive(); | 32 host->SetKeepsBrowserProcessAlive(); |
32 break; | 33 break; |
33 } | 34 } |
34 default: | 35 default: |
35 NOTREACHED(); | 36 NOTREACHED(); |
36 } | 37 } |
37 } | 38 } |
38 | 39 |
39 } // namespace extensions | 40 } // namespace platform_apps |
OLD | NEW |