| 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 | |
| 55 // Parse the manifest.json file inside the extension (not in the header). | 51 // Parse the manifest.json file inside the extension (not in the header). |
| 56 // Caller takes ownership of return value. | 52 // Caller takes ownership of return value. |
| 57 DictionaryValue* ReadManifest(); | 53 DictionaryValue* ReadManifest(); |
| 58 | 54 |
| 59 // Decodes the image at the given path and puts it in our list of decoded | 55 // Decodes the image at the given path and puts it in our list of decoded |
| 60 // images. | 56 // images. |
| 61 bool AddDecodedImage(const FilePath& path); | 57 bool AddDecodedImage(const FilePath& path); |
| 62 | 58 |
| 63 // Set the error message. | 59 // Set the error message. |
| 64 void SetError(const std::string& error); | 60 void SetError(const std::string& error); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 76 // are relative to the manifest file. | 72 // are relative to the manifest file. |
| 77 DecodedImages decoded_images_; | 73 DecodedImages decoded_images_; |
| 78 | 74 |
| 79 // The last error message that was set. Empty if there were no errors. | 75 // The last error message that was set. Empty if there were no errors. |
| 80 std::string error_message_; | 76 std::string error_message_; |
| 81 | 77 |
| 82 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); | 78 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); |
| 83 }; | 79 }; |
| 84 | 80 |
| 85 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ | 81 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ |
| OLD | NEW |