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

Unified Diff: extensions/common/event_matcher.cc

Issue 2937623002: [Extensions] Simplify EventFilteringInfo (Closed)
Patch Set: karan's Created 3 years, 6 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 | « extensions/common/event_matcher.h ('k') | extensions/renderer/api_event_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/event_matcher.cc
diff --git a/extensions/common/event_matcher.cc b/extensions/common/event_matcher.cc
index 3876b899cf1c7034de25112236883202b7962ff4..1d5f832ed38cb55243611e2d4bf3d7bad56dfd14 100644
--- a/extensions/common/event_matcher.cc
+++ b/extensions/common/event_matcher.cc
@@ -27,33 +27,34 @@ EventMatcher::~EventMatcher() {
bool EventMatcher::MatchNonURLCriteria(
const EventFilteringInfo& event_info) const {
- if (event_info.has_instance_id()) {
- return event_info.instance_id() == GetInstanceID();
+ if (event_info.instance_id) {
+ return *event_info.instance_id == GetInstanceID();
}
- if (event_info.has_window_type()) {
+ if (event_info.window_type) {
int window_type_count = GetWindowTypeCount();
for (int i = 0; i < window_type_count; i++) {
std::string window_type;
if (GetWindowType(i, &window_type) &&
- window_type == event_info.window_type()) {
+ window_type == *event_info.window_type) {
return true;
}
}
return false;
}
- if (event_info.has_window_exposed_by_default()) {
+ if (event_info.window_exposed_by_default) {
// An event with a |window_exposed_by_default| set is only
// relevant to the listener if no window type filter is set.
if (HasWindowTypes())
return false;
- return event_info.window_exposed_by_default();
+ return *event_info.window_exposed_by_default;
}
const std::string& service_type_filter = GetServiceTypeFilter();
return service_type_filter.empty() ||
- service_type_filter == event_info.service_type();
+ (event_info.service_type &&
+ service_type_filter == *event_info.service_type);
}
int EventMatcher::GetURLFilterCount() const {
« no previous file with comments | « extensions/common/event_matcher.h ('k') | extensions/renderer/api_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698