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

Unified 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: Forgot two files 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 side-by-side diff with in-line comments
Download patch
Index: athena/content/public/app_registry.h
diff --git a/athena/content/public/app_registry.h b/athena/content/public/app_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe01b37b5eb199d219c0bfe901d97c455928a285
--- /dev/null
+++ b/athena/content/public/app_registry.h
@@ -0,0 +1,75 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
+#define ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_
+
+#include <string>
+#include <vector>
+
+#include "athena/athena_export.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace athena {
+
+class AppActivityRegistry;
+class AppContentDelegate;
+class AppRegistryImpl;
+
+// This class holds for each application, held by a user, a list of activities.
+// The list of activities can be retrieved as |AppActivityRegistry|. It is used
+// to associate activities with applications and allow the resource manager to
+// (re)start and stop applications.
+class ATHENA_EXPORT AppRegistry {
+ public:
+ // Creates the AppRegistry instance.
+ static void Create();
+
+ // Gets the instance of the controller.
+ static AppRegistry* Get();
+
+ // Shuts down the registry (all applications should be shut down by then).
+ static void ShutDown();
+
+ // Overrides the used AppContentDelegate. This function will own it
+ // afterwards. A value of NULL is invalid.
+ virtual void SetDelegate(AppContentDelegate* delegate) = 0;
+
+ // Retrieves the application content delegate. The ownership remains with this
+ // class.
+ virtual AppContentDelegate* GetDelegate() = 0;
+
+ // Returns an |AppActivityRegistry| for a given activity |app_id| and
+ // |browser_context|.
+ virtual AppActivityRegistry* GetAppActivityRegistry(
+ const std::string& app_id,
+ content::BrowserContext* browser_context) = 0;
+
+ // Returns the number of registered applications.
+ virtual int NumberOfApplications() const = 0;
+
+ protected:
+ // Only the |AppActivityRegistry| can remove itself.
+ friend AppActivityRegistry;
oshima 2014/08/18 23:14:02 friend class ? (I didn't know you can omit class,
+
+ // Removes an activity registry for an application from the list of known
+ // applications.
+ virtual void RemoveAppActivityRegistry(AppActivityRegistry* registry) = 0;
+
+ // Constructor and destructor can only be called by the implementing class.
+ AppRegistry();
+ virtual ~AppRegistry();
oshima 2014/08/18 23:14:02 move the ctor/dtor after friend.
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(AppRegistry);
+};
+
+} // namespace athena
+
+#endif // ATHENA_CONTENT_PUBLIC_APP_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698