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

Side by Side Diff: chrome/common/extensions/event_matcher.cc

Issue 12208078: Move chrome/common/extensions/event_* to extensions/common/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: v8 Created 7 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/event_matcher.h ('k') | chrome/renderer/extensions/dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/event_matcher.h"
6 #include "chrome/common/extensions/event_filtering_info.h"
7
8 namespace {
9 const char kUrlFiltersKey[] = "url";
10 }
11
12 namespace extensions {
13
14 EventMatcher::EventMatcher(scoped_ptr<base::DictionaryValue> filter)
15 : filter_(filter.Pass()) {
16 }
17
18 EventMatcher::~EventMatcher() {
19 }
20
21 bool EventMatcher::MatchNonURLCriteria(
22 const EventFilteringInfo& event_info) const {
23 // There is currently no criteria apart from URL criteria.
24 return true;
25 }
26
27 int EventMatcher::GetURLFilterCount() const {
28 base::ListValue* url_filters = NULL;
29 if (filter_->GetList(kUrlFiltersKey, &url_filters))
30 return url_filters->GetSize();
31 return 0;
32 }
33
34 bool EventMatcher::GetURLFilter(int i, base::DictionaryValue** url_filter_out) {
35 base::ListValue* url_filters = NULL;
36 if (filter_->GetList(kUrlFiltersKey, &url_filters)) {
37 return url_filters->GetDictionary(i, url_filter_out);
38 }
39 return false;
40 }
41
42 int EventMatcher::HasURLFilters() const {
43 return GetURLFilterCount() != 0;
44 }
45
46 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/event_matcher.h ('k') | chrome/renderer/extensions/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698