Chromium Code Reviews| Index: chrome/browser/extensions/api/storage/storage_schema_manifest_handler.h |
| diff --git a/chrome/browser/extensions/api/storage/storage_schema_manifest_handler.h b/chrome/browser/extensions/api/storage/storage_schema_manifest_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a69b186de364e590860d68c7ff93f3f712e38034 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/storage/storage_schema_manifest_handler.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 2013 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 CHROME_BROWSER_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "chrome/common/extensions/manifest_handler.h" |
| + |
| +namespace policy { |
| +class PolicySchema; |
| +} |
| + |
| +namespace extensions { |
| + |
| +// Handles the "storage.managed_schema" manifest key. |
| +class StorageSchemaManifestHandler : public ManifestHandler { |
| + public: |
| + StorageSchemaManifestHandler(); |
| + virtual ~StorageSchemaManifestHandler(); |
| + |
| + // Returns the managed storage schema defined for |extension|. |
| + // If the schema is invalid then NULL is returned, and the failure reason |
| + // is stored in |error|. |
|
not at google - send to devlin
2013/05/25 00:50:57
must be called on FILE thread?
Joao da Silva
2013/05/27 12:13:11
Done.
|
| + static scoped_ptr<policy::PolicySchema> GetSchema(const Extension* extension, |
| + std::string* error); |
| + |
| + private: |
| + // ManifestHandler implementation: |
| + virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| + virtual bool Validate(const Extension* extension, |
| + std::string* error, |
| + std::vector<InstallWarning>* warnings) const OVERRIDE; |
| + virtual const std::vector<std::string> Keys() const OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(StorageSchemaManifestHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ |