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.
5 #ifndef ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
6 #define ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
11 #include "athena/athena_export.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
21 class AppActivityRegistry
;
22 class AppRegistryImpl
;
24 // This class holds for each application, held by a user, a list of activities.
25 // The list of activities can be retrieved as |AppActivityRegistry|. It is used
26 // to associate activities with applications and allow the resource manager to
27 // (re)start and stop applications.
28 class ATHENA_EXPORT AppRegistry
{
30 // Creates the AppRegistry instance.
33 // Gets the instance of the controller.
34 static AppRegistry
* Get();
36 // Shuts down the registry (all applications should be shut down by then).
37 static void ShutDown();
39 // Returns an |AppActivityRegistry| for a given activity |app_id| and
41 virtual AppActivityRegistry
* GetAppActivityRegistry(
42 const std::string
& app_id
,
43 content::BrowserContext
* browser_context
) = 0;
45 // Returns the number of registered applications.
46 virtual int NumberOfApplications() const = 0;
49 // Only the |AppActivityRegistry| can remove itself.
50 friend AppActivityRegistry
;
52 // Removes an activity registry for an application from the list of known
54 virtual void RemoveAppActivityRegistry(AppActivityRegistry
* registry
) = 0;
56 // Constructor and destructor can only be called by the implementing class.
58 virtual ~AppRegistry();
63 #endif // ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_