Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / athena / content / public / app_registry.h
blob095beba24851775485e849603bd581c49454e3b8
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_
8 #include <string>
9 #include <vector>
11 #include "athena/athena_export.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
15 namespace content {
16 class BrowserContext;
19 namespace athena {
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 {
29 public:
30 // Creates the AppRegistry instance.
31 static void Create();
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
40 // |browser_context|.
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;
48 protected:
49 // Only the |AppActivityRegistry| can remove itself.
50 friend AppActivityRegistry;
52 // Removes an activity registry for an application from the list of known
53 // applications.
54 virtual void RemoveAppActivityRegistry(AppActivityRegistry* registry) = 0;
56 // Constructor and destructor can only be called by the implementing class.
57 AppRegistry();
58 virtual ~AppRegistry();
61 } // namespace athena
63 #endif // ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_