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

Side by Side Diff: apps/app_load_service.h

Issue 15947007: Move application restart and relaunch code out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pafooey Created 7 years, 6 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 | « apps/DEPS ('k') | apps/app_load_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
(Empty)
1 // Copyright 2013 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 APPS_APP_LOAD_SERVICE_H_
6 #define APPS_APP_LOAD_SERVICE_H_
7
8 #include <map>
9 #include <string>
10
11 #include "components/browser_context_keyed_service/browser_context_keyed_service .h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
14
15 class Profile;
16
17 namespace apps {
18
19 // Monitors apps being reloaded and performs app specific actions (like launch
20 // or restart) on them. Also provides an interface to schedule these actions.
21 class AppLoadService : public BrowserContextKeyedService,
22 public content::NotificationObserver {
23 public:
24 explicit AppLoadService(Profile* profile);
25 virtual ~AppLoadService();
26
27 // Reload the application with the given id and then send it the OnRestarted
28 // event.
29 void RestartApplication(const std::string& extension_id);
30
31 // Schedule a launch to happen for the extension with id |extension_id|
32 // when it loads next. This does not cause the extension to be reloaded.
33 void ScheduleLaunchOnLoad(const std::string& extension_id);
34
35 static AppLoadService* Get(Profile* profile);
36
37 private:
38 // content::NotificationObserver.
39 virtual void Observe(int type,
40 const content::NotificationSource& source,
41 const content::NotificationDetails& details) OVERRIDE;
42
43 // Map of extension id to reload action. Absence from the map implies
44 // no action.
45 std::map<std::string, int> reload_actions_;
46 content::NotificationRegistrar registrar_;
47 Profile* profile_;
48
49 DISALLOW_COPY_AND_ASSIGN(AppLoadService);
50 };
51
52 } // namespace apps
53
54 #endif // APPS_APP_LOAD_SERVICE_H_
OLDNEW
« no previous file with comments | « apps/DEPS ('k') | apps/app_load_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698