| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // data. Returns true on success. | 52 // data. Returns true on success. |
| 53 static bool ReadImagesFromFile(const FilePath& extension_path, | 53 static bool ReadImagesFromFile(const FilePath& extension_path, |
| 54 DecodedImages* images); | 54 DecodedImages* images); |
| 55 | 55 |
| 56 // Read the decoded message catalogs back from the file we saved them to. | 56 // Read the decoded message catalogs back from the file we saved them to. |
| 57 // |extension_path| is the path to the extension we unpacked that wrote the | 57 // |extension_path| is the path to the extension we unpacked that wrote the |
| 58 // data. Returns true on success. | 58 // data. Returns true on success. |
| 59 static bool ReadMessageCatalogsFromFile(const FilePath& extension_path, | 59 static bool ReadMessageCatalogsFromFile(const FilePath& extension_path, |
| 60 base::DictionaryValue* catalogs); | 60 base::DictionaryValue* catalogs); |
| 61 | 61 |
| 62 const std::string& error_message() { return error_message_; } | 62 const string16& error_message() { return error_message_; } |
| 63 base::DictionaryValue* parsed_manifest() { | 63 base::DictionaryValue* parsed_manifest() { |
| 64 return parsed_manifest_.get(); | 64 return parsed_manifest_.get(); |
| 65 } | 65 } |
| 66 const DecodedImages& decoded_images() { return decoded_images_; } | 66 const DecodedImages& decoded_images() { return decoded_images_; } |
| 67 base::DictionaryValue* parsed_catalogs() { return parsed_catalogs_.get(); } | 67 base::DictionaryValue* parsed_catalogs() { return parsed_catalogs_.get(); } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // Parse the manifest.json file inside the extension (not in the header). | 70 // Parse the manifest.json file inside the extension (not in the header). |
| 71 // Caller takes ownership of return value. | 71 // Caller takes ownership of return value. |
| 72 base::DictionaryValue* ReadManifest(); | 72 base::DictionaryValue* ReadManifest(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 102 | 102 |
| 103 // A list of decoded images and the paths where those images came from. Paths | 103 // A list of decoded images and the paths where those images came from. Paths |
| 104 // are relative to the manifest file. | 104 // are relative to the manifest file. |
| 105 DecodedImages decoded_images_; | 105 DecodedImages decoded_images_; |
| 106 | 106 |
| 107 // Dictionary of relative paths and catalogs per path. Paths are in the form | 107 // Dictionary of relative paths and catalogs per path. Paths are in the form |
| 108 // of _locales/locale, without messages.json base part. | 108 // of _locales/locale, without messages.json base part. |
| 109 scoped_ptr<base::DictionaryValue> parsed_catalogs_; | 109 scoped_ptr<base::DictionaryValue> parsed_catalogs_; |
| 110 | 110 |
| 111 // The last error message that was set. Empty if there were no errors. | 111 // The last error message that was set. Empty if there were no errors. |
| 112 std::string error_message_; | 112 string16 error_message_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); | 114 DISALLOW_COPY_AND_ASSIGN(ExtensionUnpacker); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ | 117 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_ |
| OLD | NEW |