| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_restore_service.h" | 5 #include "apps/app_restore_service.h" |
| 6 #include "apps/app_restore_service_factory.h" | 6 #include "apps/app_restore_service_factory.h" |
| 7 #include "apps/saved_files_service.h" | 7 #include "apps/saved_files_service.h" |
| 8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 SavedFilesService* saved_files_service = SavedFilesService::Get(profile()); | 129 SavedFilesService* saved_files_service = SavedFilesService::Get(profile()); |
| 130 std::vector<SavedFileEntry> file_entries = | 130 std::vector<SavedFileEntry> file_entries = |
| 131 saved_files_service->GetAllFileEntries(extension->id()); | 131 saved_files_service->GetAllFileEntries(extension->id()); |
| 132 extension_suspended.Wait(); | 132 extension_suspended.Wait(); |
| 133 | 133 |
| 134 // Simulate a restart by populating the preferences as if the browser didn't | 134 // Simulate a restart by populating the preferences as if the browser didn't |
| 135 // get time to clean itself up. | 135 // get time to clean itself up. |
| 136 extension_prefs->SetExtensionRunning(extension->id(), true); | 136 extension_prefs->SetExtensionRunning(extension->id(), true); |
| 137 for (std::vector<SavedFileEntry>::const_iterator it = file_entries.begin(); | 137 for (std::vector<SavedFileEntry>::const_iterator it = file_entries.begin(); |
| 138 it != file_entries.end(); ++it) { | 138 it != file_entries.end(); ++it) { |
| 139 saved_files_service->RegisterFileEntry(extension->id(), it->id, it->path); | 139 saved_files_service->RegisterFileEntry( |
| 140 extension->id(), it->id, it->path, it->is_directory); |
| 140 } | 141 } |
| 141 | 142 |
| 142 apps::AppRestoreServiceFactory::GetForProfile(browser()->profile())-> | 143 apps::AppRestoreServiceFactory::GetForProfile(browser()->profile())-> |
| 143 HandleStartup(true); | 144 HandleStartup(true); |
| 144 | 145 |
| 145 access_ok_listener.WaitUntilSatisfied(); | 146 access_ok_listener.WaitUntilSatisfied(); |
| 146 } | 147 } |
| 147 | 148 |
| 148 } // namespace apps | 149 } // namespace apps |
| OLD | NEW |