Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chrome/common/extensions/extension_unpacker.h

Issue 390019: Parse messages.json in ExtensionUnpacker (like we do for manifest).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_unpacker.h
===================================================================
--- chrome/common/extensions/extension_unpacker.h (revision 32098)
+++ chrome/common/extensions/extension_unpacker.h (working copy)
@@ -46,16 +46,24 @@
return parsed_manifest_.get();
}
const DecodedImages& decoded_images() { return decoded_images_; }
+ DictionaryValue* parsed_catalogs() { return parsed_catalogs_.get(); }
private:
// Parse the manifest.json file inside the extension (not in the header).
// Caller takes ownership of return value.
DictionaryValue* ReadManifest();
+ // Parse all _locales/*/messages.json files inside the extension.
+ bool ReadAllMessageCatalogs(const std::string& default_locale);
+
// Decodes the image at the given path and puts it in our list of decoded
// images.
bool AddDecodedImage(const FilePath& path);
+ // Parses the catalog at the given path and puts it in our list of parsed
+ // catalogs.
+ bool ReadMessageCatalog(const FilePath& message_path);
+
// Set the error message.
void SetError(const std::string& error);
@@ -72,6 +80,10 @@
// are relative to the manifest file.
DecodedImages decoded_images_;
+ // Dictionary of relative paths and catalogs per path. Paths are in the form
+ // of _locales/locale, without messages.json base part.
+ scoped_ptr<DictionaryValue> parsed_catalogs_;
+
// The last error message that was set. Empty if there were no errors.
std::string error_message_;

Powered by Google App Engine
This is Rietveld 408576698