diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 03:40:08 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 03:40:08 +0000 |
commit | 64804d573437ccefc95c88306523850009fcc516 (patch) | |
tree | 6f82cee566aaa7075cb2726512bdc6b3cba7295d /chrome/browser/extensions/extension_prefs.h | |
parent | ab95315836cae6073fac88174f50653c6b2b0025 (diff) | |
download | chromium_src-64804d573437ccefc95c88306523850009fcc516.zip chromium_src-64804d573437ccefc95c88306523850009fcc516.tar.gz chromium_src-64804d573437ccefc95c88306523850009fcc516.tar.bz2 |
Filtered events.
Makes web_navigation events support filters, eg:
chrome.webNavigation.onBeforeCommitted.addListener(callback, {url: [{hostSuffix: 'google.com'}]});
Now callback will only be called when the event has a URL with a host suffix of google.com.
BUG=121479
Review URL: https://chromiumcodereview.appspot.com/10514013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r-- | chrome/browser/extensions/extension_prefs.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index ae05fd9..0efe0b4 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -275,6 +275,21 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer, void SetRegisteredEvents(const std::string& extension_id, const std::set<std::string>& events); + // Adds a filter to an event. + void AddFilterToEvent(const std::string& event_name, + const std::string& extension_id, + const DictionaryValue* filter); + + // Removes a filter from an event. + void RemoveFilterFromEvent(const std::string& event_name, + const std::string& extension_id, + const DictionaryValue* filter); + + // Returns the dictionary of event filters that the given extension has + // registered. + const DictionaryValue* GetFilteredEvents( + const std::string& extension_id) const; + // Controls the omnibox default suggestion as set by the extension. extensions::ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion( const std::string& extension_id); |