summaryrefslogtreecommitdiffstats
path: root/base/message_pump_glib.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-18 18:32:45 +0000
committerBen Murdoch <benm@google.com>2010-11-18 18:38:07 +0000
commit513209b27ff55e2841eac0e4120199c23acce758 (patch)
treeaeba30bb08c5f47c57003544e378a377c297eee6 /base/message_pump_glib.h
parent164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff)
downloadexternal_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
Diffstat (limited to 'base/message_pump_glib.h')
-rw-r--r--base/message_pump_glib.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/base/message_pump_glib.h b/base/message_pump_glib.h
index f6d022a..06635de 100644
--- a/base/message_pump_glib.h
+++ b/base/message_pump_glib.h
@@ -57,10 +57,15 @@ class MessagePumpForUI : public MessagePump {
// Like MessagePump::Run, but GdkEvent objects are routed through dispatcher.
virtual void RunWithDispatcher(Delegate* delegate, Dispatcher* dispatcher);
+ // Run a single iteration of the mainloop. A return value of true indicates
+ // that an event was handled. |block| indicates if it should wait if no event
+ // is ready for processing.
+ virtual bool RunOnce(GMainContext* context, bool block);
+
virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); }
virtual void Quit();
virtual void ScheduleWork();
- virtual void ScheduleDelayedWork(const Time& delayed_work_time);
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time);
// Internal methods used for processing the pump callbacks. They are
// public for simplicity but should not be used directly. HandlePrepare
@@ -79,6 +84,14 @@ class MessagePumpForUI : public MessagePump {
// receiving a notification callback.
void RemoveObserver(Observer* observer);
+ // Dispatch an available GdkEvent. Essentially this allows a subclass to do
+ // some task before/after calling the default handler (EventDispatcher).
+ virtual void DispatchEvents(GdkEvent* event);
+
+ protected:
+ // Returns the dispatcher for the current run state (|state_->dispatcher|).
+ Dispatcher* GetDispatcher();
+
private:
// We may make recursive calls to Run, so we save state that needs to be
// separate between them in this structure type.
@@ -103,7 +116,7 @@ class MessagePumpForUI : public MessagePump {
GMainContext* context_;
// This is the time when we need to do delayed work.
- Time delayed_work_time_;
+ TimeTicks delayed_work_time_;
// The work source. It is shared by all calls to Run and destroyed when
// the message pump is destroyed.