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/app_lifetime_monitor.h" | 5 #include "apps/app_lifetime_monitor.h" |
6 | 6 |
7 #include "apps/app_window.h" | |
8 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/notification_details.h" | 9 #include "content/public/browser/notification_details.h" |
11 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| 11 #include "extensions/browser/app_window/app_window.h" |
12 #include "extensions/browser/extension_host.h" | 12 #include "extensions/browser/extension_host.h" |
13 #include "extensions/browser/notification_types.h" | 13 #include "extensions/browser/notification_types.h" |
14 #include "extensions/common/extension.h" | 14 #include "extensions/common/extension.h" |
15 | 15 |
16 namespace apps { | 16 namespace apps { |
17 | 17 |
| 18 using extensions::AppWindow; |
| 19 using extensions::AppWindowRegistry; |
18 using extensions::Extension; | 20 using extensions::Extension; |
19 using extensions::ExtensionHost; | 21 using extensions::ExtensionHost; |
20 | 22 |
21 AppLifetimeMonitor::AppLifetimeMonitor(Profile* profile) | 23 AppLifetimeMonitor::AppLifetimeMonitor(Profile* profile) |
22 : profile_(profile) { | 24 : profile_(profile) { |
23 registrar_.Add(this, | 25 registrar_.Add(this, |
24 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, | 26 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, |
25 content::NotificationService::AllSources()); | 27 content::NotificationService::AllSources()); |
26 registrar_.Add(this, | 28 registrar_.Add(this, |
27 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 29 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 134 |
133 void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) { | 135 void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) { |
134 FOR_EACH_OBSERVER(Observer, observers_, OnAppStop(profile_, app_id)); | 136 FOR_EACH_OBSERVER(Observer, observers_, OnAppStop(profile_, app_id)); |
135 } | 137 } |
136 | 138 |
137 void AppLifetimeMonitor::NotifyChromeTerminating() { | 139 void AppLifetimeMonitor::NotifyChromeTerminating() { |
138 FOR_EACH_OBSERVER(Observer, observers_, OnChromeTerminating()); | 140 FOR_EACH_OBSERVER(Observer, observers_, OnChromeTerminating()); |
139 } | 141 } |
140 | 142 |
141 } // namespace apps | 143 } // namespace apps |
OLD | NEW |