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

Side by Side Diff: chrome/browser/extensions/app_restore_service.h

Issue 10875027: Restart running apps when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments, rebase Created 8 years, 3 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
OLDNEW
(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_EXTENSIONS_APP_RESTORE_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_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 {
Mihai Parparita -not on Chrome 2012/09/04 17:47:14 The whole class should be in the extensions namesp
koz (OOO until 15th September) 2012/09/05 06:21:33 Done.
20 class ExtensionHost;
21 }
22
23 // Tracks what apps need to be restarted when the browser restarts.
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 static void RegisterUserPrefs(PrefService* prefService);
34
35 private:
36 // content::NotificationObserver.
37 virtual void Observe(int type,
38 const content::NotificationSource& source,
39 const content::NotificationDetails& details) OVERRIDE;
40
41 void RecordAppStart(const std::string& extension_id);
42 void RecordAppStop(const std::string& extension_id);
43 void RestoreApp(const std::string& extension_id);
44
45 content::NotificationRegistrar registrar_;
46 Profile* profile_;
47 };
48
49 #endif // CHROME_BROWSER_EXTENSIONS_APP_RESTORE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698