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

Unified Diff: ui/events/platform/platform_event_source.h

Issue 313913004: Block internal PlatformEvents before they are dispatched in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove obsolete comment and unnecessary includes. Created 6 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
Index: ui/events/platform/platform_event_source.h
diff --git a/ui/events/platform/platform_event_source.h b/ui/events/platform/platform_event_source.h
index 87b553197a3b2646d3c6eb035a640c6ae96a6385..42420d511ee771f884e3c02df63af7c07cb65ecb 100644
--- a/ui/events/platform/platform_event_source.h
+++ b/ui/events/platform/platform_event_source.h
@@ -19,6 +19,7 @@ namespace ui {
class Event;
class PlatformEventDispatcher;
+class PlatformEventFilter;
class PlatformEventObserver;
class ScopedEventDispatcher;
@@ -54,6 +55,9 @@ class EVENTS_EXPORT PlatformEventSource {
void AddPlatformEventObserver(PlatformEventObserver* observer);
void RemovePlatformEventObserver(PlatformEventObserver* observer);
+ void AddPlatformEventFilter(PlatformEventFilter* filter);
+ void RemovePlatformEventFilter(PlatformEventFilter* filter);
+
static scoped_ptr<PlatformEventSource> CreateDefault();
protected:
@@ -92,6 +96,12 @@ class EVENTS_EXPORT PlatformEventSource {
// reset and a previous override-dispatcher has been restored.
bool overridden_dispatcher_restored_;
+ // Use an ObserverList<> instead of an std::vector<> to store the list of
+ // filters as well, so that adding/removing filters during event filtering
+ // is well-defined.
+ typedef ObserverList<PlatformEventFilter> PlatformEventFilterList;
+ PlatformEventFilterList filters_;
+
ObserverList<PlatformEventObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(PlatformEventSource);

Powered by Google App Engine
This is Rietveld 408576698