OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SESSIONS_APP_RESTORE_SERVICE_H_ | |
6 #define CHROME_BROWSER_SESSIONS_APP_RESTORE_SERVICE_H_ | |
7 | |
8 #include "chrome/browser/profiles/profile_keyed_service.h" | |
9 #include "content/public/browser/notification_observer.h" | |
10 #include "content/public/browser/notification_registrar.h" | |
11 | |
12 #include <list> | |
13 #include <string> | |
14 #include <vector> | |
15 | |
16 class PrefService; | |
17 class Profile; | |
18 | |
19 namespace extensions { | |
20 class ExtensionHost; | |
21 } | |
22 | |
23 // Tracks what apps need to be restarted when the browser restarts. | |
Mihai Parparita -not on Chrome
2012/09/04 04:14:48
Does it make sense for this to be in chrome/browse
koz (OOO until 15th September)
2012/09/04 07:10:20
Done.
| |
24 class AppRestoreService : public ProfileKeyedService, | |
25 public content::NotificationObserver { | |
26 public: | |
27 explicit AppRestoreService(Profile* profile); | |
28 | |
29 // Dispatches the app.runtime.onRestarted event to apps that were running in | |
30 // the last session. | |
31 void RestoreApps(); | |
32 | |
33 // Dispatches the app.runtime.onRestarted event to the apps identified by the | |
34 // extension ids in |apps|. | |
35 void RestartApps(std::list<std::string>& apps); | |
Mihai Parparita -not on Chrome
2012/09/04 04:14:48
This appears to be unused/undefined.
koz (OOO until 15th September)
2012/09/04 07:10:20
Done.
| |
36 | |
37 // content::NotificationObserver. | |
38 virtual void Observe(int type, | |
Mihai Parparita -not on Chrome
2012/09/04 04:14:48
Needs OVERRIDE (also, it could be private).
koz (OOO until 15th September)
2012/09/04 07:10:20
Done.
| |
39 const content::NotificationSource& source, | |
40 const content::NotificationDetails& details); | |
41 | |
42 static void RegisterUserPrefs(PrefService* prefService); | |
43 | |
44 private: | |
45 void RecordAppStart(const std::string& extension_id); | |
46 void RecordAppStop(const std::string& extension_id); | |
47 void RestoreApp(const std::string& extension_id); | |
48 | |
49 content::NotificationRegistrar registrar_; | |
50 Profile* profile_; | |
51 }; | |
52 | |
53 #endif // CHROME_BROWSER_SESSIONS_APP_RESTORE_SERVICE_H_ | |
OLD | NEW |