Index: chrome/common/extensions/features/simple_feature.cc |
diff --git a/chrome/common/extensions/features/simple_feature.cc b/chrome/common/extensions/features/simple_feature.cc |
index 2d20787282b4ab89a20f2fff0c67849f45753734..56807ca12bef509aa3010fa000951cda7b9213a1 100644 |
--- a/chrome/common/extensions/features/simple_feature.cc |
+++ b/chrome/common/extensions/features/simple_feature.cc |
@@ -141,6 +141,7 @@ void ParseURLPatterns(const DictionaryValue* value, |
URLPatternSet* set) { |
const ListValue* matches = NULL; |
if (value->GetList(key, &matches)) { |
+ set->ClearPatterns(); |
for (size_t i = 0; i < matches->GetSize(); ++i) { |
std::string pattern; |
CHECK(matches->GetString(i, &pattern)); |
@@ -187,7 +188,8 @@ SimpleFeature::SimpleFeature() |
platform_(UNSPECIFIED_PLATFORM), |
min_manifest_version_(0), |
max_manifest_version_(0), |
- channel_(VersionInfo::CHANNEL_UNKNOWN) { |
+ channel_(VersionInfo::CHANNEL_UNKNOWN), |
+ has_parent_(false) { |
} |
SimpleFeature::SimpleFeature(const SimpleFeature& other) |
@@ -199,7 +201,8 @@ SimpleFeature::SimpleFeature(const SimpleFeature& other) |
platform_(other.platform_), |
min_manifest_version_(other.min_manifest_version_), |
max_manifest_version_(other.max_manifest_version_), |
- channel_(other.channel_) { |
+ channel_(other.channel_), |
+ has_parent_(other.has_parent_) { |
} |
SimpleFeature::~SimpleFeature() { |
@@ -214,7 +217,8 @@ bool SimpleFeature::Equals(const SimpleFeature& other) const { |
platform_ == other.platform_ && |
min_manifest_version_ == other.min_manifest_version_ && |
max_manifest_version_ == other.max_manifest_version_ && |
- channel_ == other.channel_; |
+ channel_ == other.channel_ && |
+ has_parent_ == other.has_parent_; |
} |
std::string SimpleFeature::Parse(const DictionaryValue* value) { |
@@ -238,6 +242,7 @@ std::string SimpleFeature::Parse(const DictionaryValue* value) { |
return name() + ": Allowing web_page contexts requires supplying a value " + |
"for matches."; |
} |
+ has_parent_ = value->HasKey("parent"); |
return std::string(); |
} |
@@ -288,7 +293,7 @@ Feature::Availability SimpleFeature::IsAvailableToManifest( |
if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_) |
return CreateAvailability(INVALID_MAX_MANIFEST_VERSION, type); |
- if (channel_ < Feature::GetCurrentChannel()) |
+ if (dependencies_.empty() && channel_ < Feature::GetCurrentChannel()) |
not at google - send to devlin
2013/05/24 19:09:18
why this change? if we're merging in our parent's
cduvall
2013/05/30 00:50:51
This is different than the parent features. This i
not at google - send to devlin
2013/05/30 16:38:51
Oh ok. I think I made a comment like this earlier
cduvall
2013/06/12 01:22:19
Done.
|
return CreateAvailability(UNSUPPORTED_CHANNEL, type); |
return CreateAvailability(IS_AVAILABLE, type); |
@@ -423,6 +428,10 @@ bool SimpleFeature::IsInternal() const { |
return false; |
} |
+bool SimpleFeature::HasParent() const { |
+ return has_parent_; |
+} |
+ |
bool SimpleFeature::IsIdInWhitelist(const std::string& extension_id) const { |
// Belt-and-suspenders philosophy here. We should be pretty confident by this |
// point that we've validated the extension ID format, but in case something |