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

Unified Diff: chrome/common/extensions/event_filtering_info.h

Issue 10388135: Add common code for extensions event filtering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 | « chrome/common/extensions/event_filter_unittest.cc ('k') | chrome/common/extensions/event_filtering_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/event_filtering_info.h
diff --git a/chrome/common/extensions/event_filtering_info.h b/chrome/common/extensions/event_filtering_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7077f1ba89bb213946d9a06349befbd6819a970
--- /dev/null
+++ b/chrome/common/extensions/event_filtering_info.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_EXTENSIONS_EVENT_FILTERING_INFO_H_
+#define CHROME_COMMON_EXTENSIONS_EVENT_FILTERING_INFO_H_
+#pragma once
+
+#include "googleurl/src/gurl.h"
+
+namespace extensions {
+
+// Extra information about an event that is used in event filtering.
+//
+// This is the information that is matched against criteria specified in JS
+// extension event listeners. Eg:
+//
+// chrome.someApi.onSomeEvent.addListener(cb,
+// {url: [{hostSuffix: 'google.com'}],
+// tabId: 1});
+class EventFilteringInfo {
+ public:
+ EventFilteringInfo();
+ ~EventFilteringInfo();
+ void SetURL(const GURL& url);
+
+ bool has_url() const { return has_url_; }
+ const GURL& url() const { return url_; }
+
+ private:
+ bool has_url_;
+ GURL url_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventFilteringInfo);
+};
+
+} // namespace extensions
+
+#endif // CHROME_COMMON_EXTENSIONS_EVENT_FILTERING_INFO_H_
« no previous file with comments | « chrome/common/extensions/event_filter_unittest.cc ('k') | chrome/common/extensions/event_filtering_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698