| 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 EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ |
| 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
| 13 #include "extensions/common/manifest_handler.h" | 13 #include "extensions/common/manifest_handler.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 class SharedModuleInfo : public Extension::ManifestData { | 17 class SharedModuleInfo : public Extension::ManifestData { |
| 18 public: | 18 public: |
| 19 SharedModuleInfo(); | 19 SharedModuleInfo(); |
| 20 virtual ~SharedModuleInfo(); | 20 ~SharedModuleInfo() override; |
| 21 | 21 |
| 22 bool Parse(const Extension* extension, base::string16* error); | 22 bool Parse(const Extension* extension, base::string16* error); |
| 23 | 23 |
| 24 struct ImportInfo { | 24 struct ImportInfo { |
| 25 std::string extension_id; | 25 std::string extension_id; |
| 26 std::string minimum_version; | 26 std::string minimum_version; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Utility functions. | 29 // Utility functions. |
| 30 static void ParseImportedPath(const std::string& path, | 30 static void ParseImportedPath(const std::string& path, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 std::set<std::string> export_whitelist_; | 51 std::set<std::string> export_whitelist_; |
| 52 | 52 |
| 53 // Optional list of module imports of other extensions. | 53 // Optional list of module imports of other extensions. |
| 54 std::vector<ImportInfo> imports_; | 54 std::vector<ImportInfo> imports_; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Parses all import/export keys in the manifest. | 57 // Parses all import/export keys in the manifest. |
| 58 class SharedModuleHandler : public ManifestHandler { | 58 class SharedModuleHandler : public ManifestHandler { |
| 59 public: | 59 public: |
| 60 SharedModuleHandler(); | 60 SharedModuleHandler(); |
| 61 virtual ~SharedModuleHandler(); | 61 ~SharedModuleHandler() override; |
| 62 | 62 |
| 63 virtual bool Parse(Extension* extension, base::string16* error) override; | 63 bool Parse(Extension* extension, base::string16* error) override; |
| 64 virtual bool Validate(const Extension* extension, | 64 bool Validate(const Extension* extension, |
| 65 std::string* error, | 65 std::string* error, |
| 66 std::vector<InstallWarning>* warnings) const override; | 66 std::vector<InstallWarning>* warnings) const override; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 virtual const std::vector<std::string> Keys() const override; | 69 const std::vector<std::string> Keys() const override; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace extensions | 72 } // namespace extensions |
| 73 | 73 |
| 74 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ | 74 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_SHARED_MODULE_INFO_H_ |
| OLD | NEW |