Index: mojo/services/catalog/store.h |
diff --git a/mojo/services/catalog/store.h b/mojo/services/catalog/store.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..74309b687f22c82c6ea4dacfb7a1d9a7d2e465b2 |
--- /dev/null |
+++ b/mojo/services/catalog/store.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2016 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 MOJO_SERVICES_CATALOG_STORE_H_ |
+#define MOJO_SERVICES_CATALOG_STORE_H_ |
+ |
+#include "base/values.h" |
+ |
+namespace catalog { |
+ |
+// Implemented by an object that provides storage for the application catalog |
+// (e.g. in Chrome, preferences). The Catalog is the canonical owner of the |
+// contents of the store, so no one else must modify its contents. |
+class Store { |
+ public: |
+ // Value is a string. |
+ static const char kNameKey[]; |
+ // Value is a string. |
+ static const char kQualifierKey[]; |
+ // Value is a string. |
+ static const char kDisplayNameKey[]; |
+ // Value is a dictionary that maps from the filter to a list of string |
+ // interfaces. |
+ static const char kCapabilitiesKey[]; |
+ |
+ virtual ~Store() {} |
+ |
+ // Called during initialization to construct the Catalog's catalog. |
+ // Returns a serialized list of the apps. Each entry in the returned list |
+ // corresponds to an app (as a dictionary). Each dictionary has a name, |
+ // display name and capabilities. The return value is owned by the caller. |
+ virtual const base::ListValue* GetStore() = 0; |
+ |
+ // Write the catalog to the store. Called when the Catalog learns of a newly |
+ // encountered application. |
+ virtual void UpdateStore(scoped_ptr<base::ListValue> store) = 0; |
+}; |
+ |
+} // namespace catalog |
+ |
+#endif // MOJO_SERVICES_CATALOG_STORE_H_ |