Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: apps/app_restore_service.cc

Issue 12391006: Give an app the file entries it had back on restart. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile (chromium style) Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | apps/app_restore_service_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | apps/app_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698