| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSION_UNPACKER_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 static bool ReadImagesFromFile(const FilePath& extension_path, | 41 static bool ReadImagesFromFile(const FilePath& extension_path, |
| 42 DecodedImages* images); | 42 DecodedImages* images); |
| 43 | 43 |
| 44 const std::string& error_message() { return error_message_; } | 44 const std::string& error_message() { return error_message_; } |
| 45 DictionaryValue* parsed_manifest() { | 45 DictionaryValue* parsed_manifest() { |
| 46 return parsed_manifest_.get(); | 46 return parsed_manifest_.get(); |
| 47 } | 47 } |
| 48 const DecodedImages& decoded_images() { return decoded_images_; } | 48 const DecodedImages& decoded_images() { return decoded_images_; } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Parse the header on the front of the extension file and return the manifest |
| 52 // inside it. Caller takes ownership of return value. |
| 53 DictionaryValue* ReadPackageHeader(); |
| 54 |
| 51 // Parse the manifest.json file inside the extension (not in the header). | 55 // Parse the manifest.json file inside the extension (not in the header). |
| 52 // Caller takes ownership of return value. | 56 // Caller takes ownership of return value. |
| 53 DictionaryValue* ReadManifest(); | 57 DictionaryValue* ReadManifest(); |
| 54 | 58 |
| 55 // Decodes the image at the given path and puts it in our list of decoded | 59 // Decodes the image at the given path and puts it in our list of decoded |
| 56 // images. | 60 // images. |
| 57 bool AddDecodedImage(const FilePath& path); | 61 bool AddDecodedImage(const FilePath& path); |
| 58 | 62 |
| 59 // Set the error message. | 63 // Set the error message. |
| 60 void SetError(const std::string& error); | 64 void SetError(const std::string& error); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 72 // are relative to the manifest file. | 76 // are relative to the manifest file. |
| 73 DecodedImages decoded_images_; | 77 DecodedImages decoded_images_; |
| 74 | 78 |
| 75 // The last error message that was set. Empty if there were no errors. | 79 // The last error message that was set. Empty if there were no errors. |
| 76 std::string error_message_; | 80 std::string error_message_; |
| 77 | 81 |
| 78 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); | 82 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); |
| 79 }; | 83 }; |
| 80 | 84 |
| 81 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ | 85 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ |
| OLD | NEW |