OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_SERVICES_CATALOG_STORE_H_ |
| 6 #define MOJO_SERVICES_CATALOG_STORE_H_ |
| 7 |
| 8 #include "base/values.h" |
| 9 |
| 10 namespace catalog { |
| 11 |
| 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 |
| 14 // contents of the store, so no one else must modify its contents. |
| 15 class Store { |
| 16 public: |
| 17 // Value is a string. |
| 18 static const char kNameKey[]; |
| 19 // Value is a string. |
| 20 static const char kQualifierKey[]; |
| 21 // Value is a string. |
| 22 static const char kDisplayNameKey[]; |
| 23 // Value is a dictionary that maps from the filter to a list of string |
| 24 // interfaces. |
| 25 static const char kCapabilitiesKey[]; |
| 26 |
| 27 virtual ~Store() {} |
| 28 |
| 29 // Called during initialization to construct the Catalog's catalog. |
| 30 // 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, |
| 32 // display name and capabilities. The return value is owned by the caller. |
| 33 virtual const base::ListValue* GetStore() = 0; |
| 34 |
| 35 // Write the catalog to the store. Called when the Catalog learns of a newly |
| 36 // encountered application. |
| 37 virtual void UpdateStore(scoped_ptr<base::ListValue> store) = 0; |
| 38 }; |
| 39 |
| 40 } // namespace catalog |
| 41 |
| 42 #endif // MOJO_SERVICES_CATALOG_STORE_H_ |
OLD | NEW |