| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/common/extensions/manifest_handler.h" | 9 #include "chrome/common/extensions/manifest_handler.h" |
| 10 | 10 |
| 11 namespace policy { | 11 namespace policy { |
| 12 class PolicySchema; | 12 class SchemaOwner; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 // Handles the "storage.managed_schema" manifest key. | 17 // Handles the "storage.managed_schema" manifest key. |
| 18 class StorageSchemaManifestHandler : public ManifestHandler { | 18 class StorageSchemaManifestHandler : public ManifestHandler { |
| 19 public: | 19 public: |
| 20 StorageSchemaManifestHandler(); | 20 StorageSchemaManifestHandler(); |
| 21 virtual ~StorageSchemaManifestHandler(); | 21 virtual ~StorageSchemaManifestHandler(); |
| 22 | 22 |
| 23 // Returns the managed storage schema defined for |extension|. | 23 // Returns the managed storage schema defined for |extension|. |
| 24 // If the schema is invalid then NULL is returned, and the failure reason | 24 // If the schema is invalid then NULL is returned, and the failure reason |
| 25 // is stored in |error|. | 25 // is stored in |error|. |
| 26 // This function does file I/O and must be called on a thread that allows I/O. | 26 // This function does file I/O and must be called on a thread that allows I/O. |
| 27 static scoped_ptr<policy::PolicySchema> GetSchema(const Extension* extension, | 27 static scoped_ptr<policy::SchemaOwner> GetSchema(const Extension* extension, |
| 28 std::string* error); | 28 std::string* error); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 // ManifestHandler implementation: | 31 // ManifestHandler implementation: |
| 32 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; | 32 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| 33 virtual bool Validate(const Extension* extension, | 33 virtual bool Validate(const Extension* extension, |
| 34 std::string* error, | 34 std::string* error, |
| 35 std::vector<InstallWarning>* warnings) const OVERRIDE; | 35 std::vector<InstallWarning>* warnings) const OVERRIDE; |
| 36 virtual const std::vector<std::string> Keys() const OVERRIDE; | 36 virtual const std::vector<std::string> Keys() const OVERRIDE; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(StorageSchemaManifestHandler); | 38 DISALLOW_COPY_AND_ASSIGN(StorageSchemaManifestHandler); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace extensions | 41 } // namespace extensions |
| 42 | 42 |
| 43 #endif // CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_
H_ | 43 #endif // CHROME_COMMON_EXTENSIONS_API_STORAGE_STORAGE_SCHEMA_MANIFEST_HANDLER_
H_ |
| OLD | NEW |