| 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 SERVICES_CATALOG_STORE_H_ | 5 #ifndef SERVICES_CATALOG_STORE_H_ |
| 6 #define SERVICES_CATALOG_STORE_H_ | 6 #define SERVICES_CATALOG_STORE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
| 9 #include "base/values.h" | 10 #include "base/values.h" |
| 10 | 11 |
| 11 namespace catalog { | 12 namespace catalog { |
| 12 | 13 |
| 13 // Implemented by an object that provides storage for the application catalog | 14 // Implemented by an object that provides storage for the application catalog |
| 14 // (e.g. in Chrome, preferences). The Catalog is the canonical owner of the | 15 // (e.g. in Chrome, preferences). The Catalog is the canonical owner of the |
| 15 // contents of the store, so no one else must modify its contents. | 16 // contents of the store, so no one else must modify its contents. |
| 16 class Store { | 17 class Store { |
| 17 public: | 18 public: |
| 18 // Value is an integer. | 19 // Value is an integer. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 virtual ~Store() {} | 40 virtual ~Store() {} |
| 40 | 41 |
| 41 // Called during initialization to construct the Catalog's catalog. | 42 // Called during initialization to construct the Catalog's catalog. |
| 42 // Returns a serialized list of the apps. Each entry in the returned list | 43 // Returns a serialized list of the apps. Each entry in the returned list |
| 43 // corresponds to an app (as a dictionary). Each dictionary has a name, | 44 // corresponds to an app (as a dictionary). Each dictionary has a name, |
| 44 // display name and capabilities. The return value is owned by the caller. | 45 // display name and capabilities. The return value is owned by the caller. |
| 45 virtual const base::ListValue* GetStore() = 0; | 46 virtual const base::ListValue* GetStore() = 0; |
| 46 | 47 |
| 47 // Write the catalog to the store. Called when the Catalog learns of a newly | 48 // Write the catalog to the store. Called when the Catalog learns of a newly |
| 48 // encountered application. | 49 // encountered application. |
| 49 virtual void UpdateStore(scoped_ptr<base::ListValue> store) = 0; | 50 virtual void UpdateStore(std::unique_ptr<base::ListValue> store) = 0; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace catalog | 53 } // namespace catalog |
| 53 | 54 |
| 54 #endif // SERVICES_CATALOG_STORE_H_ | 55 #endif // SERVICES_CATALOG_STORE_H_ |
| OLD | NEW |