| 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 "apps/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/api/file_handlers/app_file_handler_util.h" | 8 #include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h" |
| 9 #include "chrome/browser/extensions/event_router.h" | 9 #include "chrome/browser/extensions/event_router.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/platform_app_launcher.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
| 15 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
| 16 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" |
| 19 | 20 |
| 20 using extensions::AppEventRouter; | 21 using extensions::AppEventRouter; |
| 21 using extensions::Extension; | 22 using extensions::Extension; |
| 22 using extensions::ExtensionHost; | 23 using extensions::ExtensionHost; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void AppRestoreService::RecordAppStop(const std::string& extension_id) { | 97 void AppRestoreService::RecordAppStop(const std::string& extension_id) { |
| 97 ExtensionPrefs* extension_prefs = | 98 ExtensionPrefs* extension_prefs = |
| 98 ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); | 99 ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); |
| 99 extension_prefs->SetExtensionRunning(extension_id, false); | 100 extension_prefs->SetExtensionRunning(extension_id, false); |
| 100 extension_prefs->ClearSavedFileEntries(extension_id); | 101 extension_prefs->ClearSavedFileEntries(extension_id); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void AppRestoreService::RestoreApp( | 104 void AppRestoreService::RestoreApp( |
| 104 const Extension* extension, | 105 const Extension* extension, |
| 105 const std::vector<SavedFileEntry>& file_entries) { | 106 const std::vector<SavedFileEntry>& file_entries) { |
| 106 // TODO(koz): Make |file_entries| available to the newly restarted app. | 107 extensions::RestartPlatformAppWithFileEntries(profile_, |
| 107 AppEventRouter::DispatchOnRestartedEvent(profile_, extension); | 108 extension, |
| 109 file_entries); |
| 108 } | 110 } |
| 109 | 111 |
| 110 } // namespace apps | 112 } // namespace apps |
| OLD | NEW |