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

Unified Diff: base/message_loop/message_pump_aurax11.h

Issue 23537016: gtk: Some code cleanup for the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_pump_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_aurax11.h
diff --git a/base/message_loop/message_pump_aurax11.h b/base/message_loop/message_pump_aurax11.h
index 89089ad535cfc62b39fbf2d145ac8598e05d6cf8..52647c30e2ee575e688c49754b793c1143795bdc 100644
--- a/base/message_loop/message_pump_aurax11.h
+++ b/base/message_loop/message_pump_aurax11.h
@@ -58,6 +58,13 @@ class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
void AddDispatcherForRootWindow(MessagePumpDispatcher* dispatcher);
void RemoveDispatcherForRootWindow(MessagePumpDispatcher* dispatcher);
+ // Adds an Observer, which will start receiving notifications immediately.
+ void AddObserver(MessagePumpObserver* observer);
+
+ // Removes an Observer. It is safe to call this method while an Observer is
+ // receiving a notification callback.
+ void RemoveObserver(MessagePumpObserver* observer);
+
// Internal function. Called by the glib source dispatch function. Processes
// all available X events.
bool DispatchXEvents();
@@ -92,6 +99,8 @@ class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
// Returns the Dispatcher based on the event's target window.
MessagePumpDispatcher* GetDispatcherForXEvent(const NativeEvent& xev) const;
+ ObserverList<MessagePumpObserver>& observers() { return observers_; }
+
// Overridden from MessagePumpDispatcher:
virtual bool Dispatch(const NativeEvent& event) OVERRIDE;
@@ -108,6 +117,9 @@ class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
// additions.
ObserverList<MessagePumpDispatcher> root_window_dispatchers_;
+ // List of observers.
+ ObserverList<MessagePumpObserver> observers_;
+
unsigned long x_root_window_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_pump_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698