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

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

Issue 115595: Have the browser process rewrite manifest.json and theme images that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months 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
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/common/extensions/extension_unpacker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unpacker.h
===================================================================
--- chrome/common/extensions/extension_unpacker.h (revision 16736)
+++ chrome/common/extensions/extension_unpacker.h (working copy)
@@ -6,16 +6,22 @@
#define CHROME_COMMON_EXTENSIONS_EXTENSION_UNPACKER_H_
#include <string>
+#include <vector>
#include "base/file_path.h"
+#include "base/scoped_ptr.h"
+#include "base/tuple.h"
class DictionaryValue;
+class SkBitmap;
// Implements IO for the ExtensionsService.
// TODO(aa): Extract an interface out of this for testing the frontend, once the
// frontend has significant logic to test.
class ExtensionUnpacker {
public:
+ typedef std::vector< Tuple2<SkBitmap, FilePath> > DecodedImages;
+
explicit ExtensionUnpacker(const FilePath& extension_path)
: extension_path_(extension_path) {}
@@ -24,18 +30,40 @@
bool Run();
const std::string& error_message() { return error_message_; }
+ DictionaryValue* parsed_manifest() {
+ return parsed_manifest_.get();
+ }
+ const DecodedImages& decoded_images() { return decoded_images_; }
private:
- // Read the manifest from the front of the extension file.
+ // Parse the header on the front of the extension file and return the manifest
+ // inside it. Caller takes ownership of return value.
+ DictionaryValue* ReadPackageHeader();
+
+ // Parse the manifest.json file inside the extension (not in the header).
// Caller takes ownership of return value.
DictionaryValue* ReadManifest();
+ // Decodes the image at the given path and puts it in our list of decoded
+ // images.
+ bool AddDecodedImage(const FilePath& path);
+
// Set the error message.
void SetError(const std::string& error);
// The extension to unpack.
FilePath extension_path_;
+ // The place we unpacked the extension to.
+ FilePath temp_install_dir_;
+
+ // The parsed version of the manifest JSON contained in the extension.
+ scoped_ptr<DictionaryValue> parsed_manifest_;
+
+ // A list of decoded images and the paths where those images came from. Paths
+ // are relative to the manifest file.
+ DecodedImages decoded_images_;
+
// The last error message that was set. Empty if there were no errors.
std::string error_message_;
« no previous file with comments | « chrome/browser/utility_process_host.cc ('k') | chrome/common/extensions/extension_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698