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

Side by Side Diff: athena/content/public/app_registry.h

Issue 477523002: Athena: Adding basic resource management framework (un-/re-loading) of V2 applications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 6 years, 4 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 2014 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 ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
6 #define ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "athena/athena_export.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14
15 namespace content {
16 class BrowserContext;
17 }
18
19 namespace athena {
20
21 class AppActivityRegistry;
22 class AppContentControlDelegate;
23 class AppRegistryImpl;
24
25 // This class holds for each application, held by a user, a list of activities.
26 // The list of activities can be retrieved as |AppActivityRegistry|. It is used
27 // to associate activities with applications and allow the resource manager to
28 // (re)start and stop applications.
29 class ATHENA_EXPORT AppRegistry {
30 public:
31 // Creates the AppRegistry instance.
32 static void Create();
33
34 // Gets the instance of the controller.
35 static AppRegistry* Get();
36
37 // Shuts down the registry (all applications should be shut down by then).
38 static void ShutDown();
39
40 // Overrides the used AppContentDelegate. This function will own it
41 // afterwards. A value of NULL is invalid.
42 virtual void SetDelegate(AppContentControlDelegate* delegate) = 0;
43
44 // Retrieves the application content delegate. The ownership remains with this
45 // class.
46 virtual AppContentControlDelegate* GetDelegate() = 0;
47
48 // Returns an |AppActivityRegistry| for a given activity |app_id| and
49 // |browser_context|.
50 virtual AppActivityRegistry* GetAppActivityRegistry(
51 const std::string& app_id,
52 content::BrowserContext* browser_context) = 0;
53
54 // Returns the number of registered applications.
55 virtual int NumberOfApplications() const = 0;
56
57 protected:
58 // Only the |AppActivityRegistry| can remove itself.
59 friend AppActivityRegistry;
60
61 // Removes an activity registry for an application from the list of known
62 // applications.
63 virtual void RemoveAppActivityRegistry(AppActivityRegistry* registry) = 0;
64
65 // Constructor and destructor can only be called by the implementing class.
66 AppRegistry();
67 virtual ~AppRegistry();
68
69 private:
70 DISALLOW_COPY_AND_ASSIGN(AppRegistry);
oshima 2014/08/19 21:22:25 fyi: you can omit this in pure interface class (li
Mr4D (OOO till 08-26) 2014/08/20 14:34:40 In deed. I thought I have removed all of them. Too
71 };
72
73 } // namespace athena
74
75 #endif // ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698