| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_SERVICES_CATALOG_STORE_H_ | 5 #ifndef MOJO_SERVICES_CATALOG_STORE_H_ |
| 6 #define MOJO_SERVICES_CATALOG_STORE_H_ | 6 #define MOJO_SERVICES_CATALOG_STORE_H_ |
| 7 | 7 |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 namespace catalog { | 10 namespace catalog { |
| 11 | 11 |
| 12 // Implemented by an object that provides storage for the application catalog | 12 // Implemented by an object that provides storage for the application catalog |
| 13 // (e.g. in Chrome, preferences). The Catalog is the canonical owner of the | 13 // (e.g. in Chrome, preferences). The Catalog is the canonical owner of the |
| 14 // contents of the store, so no one else must modify its contents. | 14 // contents of the store, so no one else must modify its contents. |
| 15 class Store { | 15 class Store { |
| 16 public: | 16 public: |
| 17 // Value is an integer. |
| 18 static const char kManifestVersionKey[]; |
| 17 // Value is a string. | 19 // Value is a string. |
| 18 static const char kNameKey[]; | 20 static const char kNameKey[]; |
| 19 // Value is a string. | 21 // Value is a string. |
| 20 static const char kQualifierKey[]; | 22 static const char kQualifierKey[]; |
| 21 // Value is a string. | 23 // Value is a string. |
| 22 static const char kDisplayNameKey[]; | 24 static const char kDisplayNameKey[]; |
| 23 // Value is a dictionary that maps from the filter to a list of string | 25 // Value is a dictionary. |
| 24 // interfaces. | |
| 25 static const char kCapabilitiesKey[]; | 26 static const char kCapabilitiesKey[]; |
| 27 // Value is a dictionary. |
| 28 static const char kCapabilities_ProvidedKey[]; |
| 29 // Value is a dictionary. |
| 30 static const char kCapabilities_RequiredKey[]; |
| 31 // Value is a list. |
| 32 static const char kCapabilities_ClassesKey[]; |
| 33 // Value is a list. |
| 34 static const char kCapabilities_InterfacesKey[]; |
| 26 | 35 |
| 27 virtual ~Store() {} | 36 virtual ~Store() {} |
| 28 | 37 |
| 29 // Called during initialization to construct the Catalog's catalog. | 38 // Called during initialization to construct the Catalog's catalog. |
| 30 // Returns a serialized list of the apps. Each entry in the returned list | 39 // Returns a serialized list of the apps. Each entry in the returned list |
| 31 // corresponds to an app (as a dictionary). Each dictionary has a name, | 40 // corresponds to an app (as a dictionary). Each dictionary has a name, |
| 32 // display name and capabilities. The return value is owned by the caller. | 41 // display name and capabilities. The return value is owned by the caller. |
| 33 virtual const base::ListValue* GetStore() = 0; | 42 virtual const base::ListValue* GetStore() = 0; |
| 34 | 43 |
| 35 // Write the catalog to the store. Called when the Catalog learns of a newly | 44 // Write the catalog to the store. Called when the Catalog learns of a newly |
| 36 // encountered application. | 45 // encountered application. |
| 37 virtual void UpdateStore(scoped_ptr<base::ListValue> store) = 0; | 46 virtual void UpdateStore(scoped_ptr<base::ListValue> store) = 0; |
| 38 }; | 47 }; |
| 39 | 48 |
| 40 } // namespace catalog | 49 } // namespace catalog |
| 41 | 50 |
| 42 #endif // MOJO_SERVICES_CATALOG_STORE_H_ | 51 #endif // MOJO_SERVICES_CATALOG_STORE_H_ |
| OLD | NEW |