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

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: Cleaned up a bit 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
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 about to be loaded from
32 // |extension_path|. This does not cause the extension to be loaded or
33 //
koz (OOO until 15th September) 2013/05/29 08:08:10 missing end of comment
koz (OOO until 15th September) 2013/05/30 00:22:22 Also, there's no |extension_path| parameter.
benwells 2013/05/30 01:47:43 Done.
34 void ScheduleLaunchOnLoad(const std::string& extension_id);
35
36 static AppLoadService* Get(Profile* profile);
37
38 private:
39 // content::NotificationObserver.
40 virtual void Observe(int type,
41 const content::NotificationSource& source,
42 const content::NotificationDetails& details) OVERRIDE;
43
44 // Map of extension id to reload action. Absence from the map implies
45 // no action.
46 std::map<std::string, int> reload_actions_;
47 content::NotificationRegistrar registrar_;
48 Profile* profile_;
49
50 DISALLOW_COPY_AND_ASSIGN(AppLoadService);
51 };
52
53 } // namespace apps
54
55 #endif // APPS_APP_LOAD_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698