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

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 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 <string>
13
14 class Profile;
15
16 namespace extensions {
17
18 // Tracks what apps need to be restarted when the browser restarts.
19 class AppRestoreService : public ProfileKeyedService,
20 public content::NotificationObserver {
21 public:
22 explicit AppRestoreService(Profile* profile);
23
24 // Dispatches the app.runtime.onRestarted event to apps that were running in
25 // the last session.
26 void RestoreApps();
27
28 private:
29 // content::NotificationObserver.
30 virtual void Observe(int type,
31 const content::NotificationSource& source,
32 const content::NotificationDetails& details) OVERRIDE;
33
34 void RecordAppStart(const std::string& extension_id);
35 void RecordAppStop(const std::string& extension_id);
36 void RestoreApp(const std::string& extension_id);
37
38 content::NotificationRegistrar registrar_;
39 Profile* profile_;
40 };
41
42 } // namespace extensions
43
44 #endif // CHROME_BROWSER_EXTENSIONS_APP_RESTORE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698