Index: extensions/common/features/simple_feature.cc |
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc |
index 762730b1f38f5c69d162ae5c05b88341a3d86778..c4c7be8e2c130cf295be238a8fac0857c15c383b 100644 |
--- a/extensions/common/features/simple_feature.cc |
+++ b/extensions/common/features/simple_feature.cc |
@@ -291,6 +291,9 @@ std::string SimpleFeature::Parse(const base::DictionaryValue* value) { |
return name() + ": Allowing web_page contexts requires supplying a value " + |
"for matches."; |
} |
+ if (!matches_.is_empty() && contexts_.count(WEB_PAGE_CONTEXT) == 0) { |
+ return name() + ": \"matches\" only makes sense for web page contexts"; |
+ } |
for (FilterList::iterator filter_iter = filters_.begin(); |
filter_iter != filters_.end(); |
@@ -395,7 +398,7 @@ Feature::Availability SimpleFeature::IsAvailableToContext( |
if (!contexts_.empty() && contexts_.find(context) == contexts_.end()) |
return CreateAvailability(INVALID_CONTEXT, context); |
- if (!matches_.is_empty() && !matches_.MatchesURL(url)) |
+ if (context == WEB_PAGE_CONTEXT && !matches_.MatchesURL(url)) |
not at google - send to devlin
2014/07/07 22:25:05
it's either this change or plumbing through the UR
Ken Rockot(use gerrit already)
2014/07/09 16:24:16
this seems fair to me
|
return CreateAvailability(INVALID_URL, url); |
for (FilterList::const_iterator filter_iter = filters_.begin(); |
@@ -502,10 +505,6 @@ Feature::Availability SimpleFeature::CreateAvailability( |
context)); |
} |
-std::set<Feature::Context>* SimpleFeature::GetContexts() { |
- return &contexts_; |
-} |
- |
bool SimpleFeature::IsInternal() const { |
return false; |
} |