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

Side by Side Diff: apps/app_restore_service.h

Issue 2623273011: Move Chrome terminating notification out of //apps (Closed)
Patch Set: remove DEPS rule Created 3 years, 11 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
« no previous file with comments | « apps/app_lifetime_monitor.cc ('k') | apps/app_restore_service.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 #ifndef APPS_APP_RESTORE_SERVICE_H_ 5 #ifndef APPS_APP_RESTORE_SERVICE_H_
6 #define APPS_APP_RESTORE_SERVICE_H_ 6 #define APPS_APP_RESTORE_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 20 matching lines...) Expand all
31 explicit AppRestoreService(Profile* profile); 31 explicit AppRestoreService(Profile* profile);
32 32
33 // Restart apps that need to be restarted and clear the "running" preference 33 // Restart apps that need to be restarted and clear the "running" preference
34 // from apps to prevent them being restarted in subsequent restarts. 34 // from apps to prevent them being restarted in subsequent restarts.
35 void HandleStartup(bool should_restore_apps); 35 void HandleStartup(bool should_restore_apps);
36 36
37 // Returns whether this extension is running or, at startup, whether it was 37 // Returns whether this extension is running or, at startup, whether it was
38 // running when Chrome was last terminated. 38 // running when Chrome was last terminated.
39 bool IsAppRestorable(const std::string& extension_id); 39 bool IsAppRestorable(const std::string& extension_id);
40 40
41 // Called to notify that the application has begun to exit.
42 void OnApplicationTerminating();
43
41 static AppRestoreService* Get(Profile* profile); 44 static AppRestoreService* Get(Profile* profile);
42 45
43 private: 46 private:
44 // AppLifetimeMonitor::Observer. 47 // AppLifetimeMonitor::Observer.
45 void OnAppStart(Profile* profile, const std::string& app_id) override; 48 void OnAppStart(Profile* profile, const std::string& app_id) override;
46 void OnAppActivated(Profile* profile, const std::string& app_id) override; 49 void OnAppActivated(Profile* profile, const std::string& app_id) override;
47 void OnAppDeactivated(Profile* profile, const std::string& app_id) override; 50 void OnAppDeactivated(Profile* profile, const std::string& app_id) override;
48 void OnAppStop(Profile* profile, const std::string& app_id) override; 51 void OnAppStop(Profile* profile, const std::string& app_id) override;
49 void OnChromeTerminating() override;
50 52
51 // KeyedService. 53 // KeyedService.
52 void Shutdown() override; 54 void Shutdown() override;
53 55
54 void RecordAppStart(const std::string& extension_id); 56 void RecordAppStart(const std::string& extension_id);
55 void RecordAppStop(const std::string& extension_id); 57 void RecordAppStop(const std::string& extension_id);
56 void RecordAppActiveState(const std::string& id, bool is_active); 58 void RecordAppActiveState(const std::string& id, bool is_active);
57 59
58 void RestoreApp(const extensions::Extension* extension); 60 void RestoreApp(const extensions::Extension* extension);
59 61
60 void StartObservingAppLifetime(); 62 void StartObservingAppLifetime();
61 void StopObservingAppLifetime(); 63 void StopObservingAppLifetime();
62 64
63 Profile* profile_; 65 Profile* profile_;
64 66
65 DISALLOW_COPY_AND_ASSIGN(AppRestoreService); 67 DISALLOW_COPY_AND_ASSIGN(AppRestoreService);
66 }; 68 };
67 69
68 } // namespace apps 70 } // namespace apps
69 71
70 #endif // APPS_APP_RESTORE_SERVICE_H_ 72 #endif // APPS_APP_RESTORE_SERVICE_H_
OLDNEW
« no previous file with comments | « apps/app_lifetime_monitor.cc ('k') | apps/app_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698