diff options
author | rjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 19:35:50 +0000 |
---|---|---|
committer | rjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 19:35:50 +0000 |
commit | 4b170c5fbe7fcf69487424d580ce4dbeb7035a01 (patch) | |
tree | 350b297be642f4e0b50a5b1fe05f9c6007f4336e /base/message_loop.cc | |
parent | 923b561488b3b5fd733c703c287c720d3c3f3088 (diff) | |
download | chromium_src-4b170c5fbe7fcf69487424d580ce4dbeb7035a01.zip chromium_src-4b170c5fbe7fcf69487424d580ce4dbeb7035a01.tar.gz chromium_src-4b170c5fbe7fcf69487424d580ce4dbeb7035a01.tar.bz2 |
Add a message pump for touchui=1
The message pump reads events directly from X. For most events, it passes them
on to GDK for normal processing. It consumes some events (e.g. keypress events)
to demonstrate how it's intended to work. This, of course, makes chrome mostly
unusable since you can only use the mouse to do things. But this is a small
first step towards capturing events through MPX (e.g. touch etc.) and processing
them as chrome pleases.
glib message pump: Slightly change architecture
This changeset breaks down the glib message pump a little so that it can be
easily subclassed. The next set of commits will introduce a subclass that still
uses GTK and GDK widgets, but reads events directly from X instead of through
GTK/GDK.
Review URL: http://codereview.chromium.org/3748002
Patch from Sadrul Chowdhury <sadrul@chromium.org>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.cc')
-rw-r--r-- | base/message_loop.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 8f6c997b..f335ca1 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -23,6 +23,9 @@ #if defined(OS_POSIX) && !defined(OS_MACOSX) #include "base/message_pump_glib.h" #endif +#if defined(TOUCH_UI) +#include "base/message_pump_glib_x.h" +#endif using base::Time; using base::TimeDelta; @@ -134,6 +137,9 @@ MessageLoop::MessageLoop(Type type) #elif defined(OS_MACOSX) #define MESSAGE_PUMP_UI base::MessagePumpMac::Create() #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() +#elif defined(TOUCH_UI) +#define MESSAGE_PUMP_UI new base::MessagePumpGlibX() +#define MESSAGE_PUMP_IO new base::MessagePumpLibevent() #elif defined(OS_POSIX) // POSIX but not MACOSX. #define MESSAGE_PUMP_UI new base::MessagePumpForUI() #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() @@ -533,9 +539,9 @@ bool MessageLoop::DoWork() { return false; } -bool MessageLoop::DoDelayedWork(Time* next_delayed_work_time) { +bool MessageLoop::DoDelayedWork(base::Time* next_delayed_work_time) { if (!nestable_tasks_allowed_ || delayed_work_queue_.empty()) { - *next_delayed_work_time = Time(); + *next_delayed_work_time = base::Time(); return false; } |