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/app_restore_service.h" | 5 #include "apps/app_restore_service.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" | 7 #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" |
8 #include "chrome/browser/extensions/event_router.h" | 8 #include "chrome/browser/extensions/event_router.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/browser/prefs/scoped_user_pref_update.h" | |
14 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
15 #include "chrome/common/extensions/extension_set.h" | 14 #include "chrome/common/extensions/extension_set.h" |
16 #include "chrome/common/chrome_notification_types.h" | |
17 #include "chrome/common/pref_names.h" | |
18 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
19 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
20 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
21 | 18 |
22 namespace extensions { | 19 using extensions::AppEventRouter; |
| 20 using extensions::Extension; |
| 21 using extensions::ExtensionHost; |
| 22 using extensions::ExtensionPrefs; |
| 23 using extensions::ExtensionSystem; |
| 24 |
| 25 namespace apps { |
23 | 26 |
24 AppRestoreService::AppRestoreService(Profile* profile) | 27 AppRestoreService::AppRestoreService(Profile* profile) |
25 : profile_(profile) { | 28 : profile_(profile) { |
26 registrar_.Add( | 29 registrar_.Add( |
27 this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, | 30 this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, |
28 content::NotificationService::AllSources()); | 31 content::NotificationService::AllSources()); |
29 registrar_.Add( | 32 registrar_.Add( |
30 this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 33 this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
31 content::NotificationService::AllSources()); | 34 content::NotificationService::AllSources()); |
32 registrar_.Add( | 35 registrar_.Add( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void AppRestoreService::RecordAppStop(const std::string& extension_id) { | 93 void AppRestoreService::RecordAppStop(const std::string& extension_id) { |
91 ExtensionPrefs* extension_prefs = | 94 ExtensionPrefs* extension_prefs = |
92 ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); | 95 ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); |
93 extension_prefs->SetExtensionRunning(extension_id, false); | 96 extension_prefs->SetExtensionRunning(extension_id, false); |
94 } | 97 } |
95 | 98 |
96 void AppRestoreService::RestoreApp(const Extension* extension) { | 99 void AppRestoreService::RestoreApp(const Extension* extension) { |
97 AppEventRouter::DispatchOnRestartedEvent(profile_, extension); | 100 AppEventRouter::DispatchOnRestartedEvent(profile_, extension); |
98 } | 101 } |
99 | 102 |
100 } // namespace extensions | 103 } // namespace apps |
OLD | NEW |