summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/sandboxed_extension_unpacker.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 08:58:12 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 08:58:12 +0000
commit7d8867df6c96bf76c040042a834af04a8ab319bc (patch)
tree3e0914651dc6093502fc65fb89631bd34031528e /chrome/browser/extensions/sandboxed_extension_unpacker.cc
parent6145198177d58f79e7ed1b44fee883ea074fc5fa (diff)
downloadchromium_src-7d8867df6c96bf76c040042a834af04a8ab319bc.zip
chromium_src-7d8867df6c96bf76c040042a834af04a8ab319bc.tar.gz
chromium_src-7d8867df6c96bf76c040042a834af04a8ab319bc.tar.bz2
Refactor app-related manifest properties so that they don't
include the name 'app'. I think these will be useful for normal extensions, too. Also extract an ExtensionExtent class out of Extension. I think this will be useful for passing by value to the IO thread. Review URL: http://codereview.chromium.org/1025006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/sandboxed_extension_unpacker.cc')
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 1cbd932..427b864 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -255,16 +255,18 @@ DictionaryValue* SandboxedExtensionUnpacker::RewriteManifestFile(
static_cast<DictionaryValue*>(manifest.DeepCopy()));
final_manifest->SetString(extension_manifest_keys::kPublicKey, public_key_);
- // Override the app origin if appropriate.
- DictionaryValue* app = NULL;
- if (final_manifest->GetDictionary(extension_manifest_keys::kApp, &app) &&
- !app_origin_override_.is_empty()) {
- if (app->HasKey(extension_manifest_keys::kAppOrigin)) {
- ReportFailure("Unexpected 'origin' key in manifest.");
+ // Override the origin if appropriate.
+ bool web_content_enabled = false;
+ if (final_manifest->GetBoolean(extension_manifest_keys::kWebContentEnabled,
+ &web_content_enabled) &&
+ web_content_enabled &&
+ web_origin_.is_valid()) {
+ if (final_manifest->HasKey(extension_manifest_keys::kWebOrigin)) {
+ ReportFailure("Unexpected 'web_content.origin' key in manifest.");
return NULL;
}
- app->SetString(extension_manifest_keys::kAppOrigin,
- app_origin_override_.spec());
+ final_manifest->SetString(extension_manifest_keys::kWebOrigin,
+ web_origin_.spec());
}
std::string manifest_json;