| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index 4f3aaf7c94cda355d97901b7c8153717b59e785c..6dd482eddb8178f0d659c9aaecc691d203fc0f8b 100644
|
| --- a/chrome/common/extensions/extension.cc
|
| +++ b/chrome/common/extensions/extension.cc
|
| @@ -504,6 +504,18 @@ bool Extension::is_theme() const {
|
| return manifest()->is_theme();
|
| }
|
|
|
| +bool Extension::is_content_pack() const {
|
| + return manifest()->is_content_pack();
|
| +}
|
| +
|
| +FilePath Extension::GetContentPackSiteList() const {
|
| + if (content_pack_site_list_.empty())
|
| + return FilePath();
|
| +
|
| + // TODO(bauerb): Use ExtensionResource?
|
| + return path().Append(content_pack_site_list_);
|
| +}
|
| +
|
| GURL Extension::GetBackgroundURL() const {
|
| if (!background_scripts_.empty()) {
|
| return GetResourceURL(
|
| @@ -2886,6 +2898,35 @@ bool Extension::LoadThemeDisplayProperties(const DictionaryValue* theme_value,
|
| return true;
|
| }
|
|
|
| +bool Extension::LoadManagedModeFeatures(string16* error) {
|
| + if (!manifest_->HasKey(keys::kContentPack))
|
| + return true;
|
| + DictionaryValue* content_pack_value = NULL;
|
| + if (!manifest_->GetDictionary(keys::kContentPack, &content_pack_value)) {
|
| + *error = ASCIIToUTF16(errors::kInvalidContentPack);
|
| + return false;
|
| + }
|
| + if (!LoadManagedModeSites(content_pack_value, error))
|
| + return false;
|
| +
|
| + return true;
|
| +}
|
| +
|
| +bool Extension::LoadManagedModeSites(
|
| + const DictionaryValue* content_pack_value,
|
| + string16* error) {
|
| + if (!content_pack_value->HasKey(keys::kContentPackSites))
|
| + return true;
|
| +
|
| + if (!content_pack_value->GetString(keys::kContentPackSites,
|
| + &content_pack_site_list_)) {
|
| + *error = ASCIIToUTF16(errors::kInvalidContentPackSites);
|
| + return false;
|
| + }
|
| +
|
| + return true;
|
| +}
|
| +
|
| // static
|
| bool Extension::IsTrustedId(const std::string& id) {
|
| // See http://b/4946060 for more details.
|
| @@ -3154,6 +3195,9 @@ bool Extension::InitFromValue(int flags, string16* error) {
|
| if (!LoadThemeFeatures(error))
|
| return false;
|
|
|
| + if (!LoadManagedModeFeatures(error))
|
| + return false;
|
| +
|
| if (HasMultipleUISurfaces()) {
|
| *error = ASCIIToUTF16(errors::kOneUISurfaceOnly);
|
| return false;
|
|
|