summaryrefslogtreecommitdiffstats
path: root/ui/aura/root_window_host_linux.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:09:23 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:09:23 +0000
commitbca7497622b009bca0597c48f8c43ec0a7121fbd (patch)
tree5c6ef8df8f8010a12a2c60a84d2ec8b2a96a7662 /ui/aura/root_window_host_linux.cc
parent1ec8ebdcc88980cc4fd819fd020159c2bdb1f098 (diff)
downloadchromium_src-bca7497622b009bca0597c48f8c43ec0a7121fbd.zip
chromium_src-bca7497622b009bca0597c48f8c43ec0a7121fbd.tar.gz
chromium_src-bca7497622b009bca0597c48f8c43ec0a7121fbd.tar.bz2
Moves the Linux dispatcher into its own object.
Like DispatcherWin, DispatcherLinux is owned by the Env singleton. http://crbug.com/112131 TEST=compiles, tests pass Review URL: https://chromiumcodereview.appspot.com/9447048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window_host_linux.cc')
-rw-r--r--ui/aura/root_window_host_linux.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index 57f6394..b3b32c5 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -10,6 +10,8 @@
#include "base/message_pump_x.h"
#include "ui/aura/cursor.h"
+#include "ui/aura/dispatcher_linux.h"
+#include "ui/aura/env.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -287,6 +289,8 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
CopyFromParent, // visual
CWBackPixmap,
&swa);
+ static_cast<DispatcherLinux*>(Env::GetInstance()->GetDispatcher())->
+ RootWindowHostCreated(xwindow_, this);
long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask |
KeyPressMask | KeyReleaseMask |
@@ -301,7 +305,6 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
if (base::MessagePumpForUI::HasXInput2())
ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_);
- base::MessagePumpX::SetDefaultDispatcher(this);
MessageLoopForUI::current()->AddDestructionObserver(this);
// Initialize invisible cursor.
@@ -317,6 +320,8 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds)
}
RootWindowHostLinux::~RootWindowHostLinux() {
+ static_cast<DispatcherLinux*>(Env::GetInstance()->GetDispatcher())->
+ RootWindowHostDestroying(xwindow_);
XDestroyWindow(xdisplay_, xwindow_);
// Clears XCursorCache.
@@ -325,7 +330,6 @@ RootWindowHostLinux::~RootWindowHostLinux() {
XFreeCursor(xdisplay_, invisible_cursor_);
MessageLoopForUI::current()->RemoveDestructionObserver(this);
- base::MessagePumpX::SetDefaultDispatcher(NULL);
}
base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
@@ -489,7 +493,8 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
break;
}
}
- return handled ? EVENT_PROCESSED : EVENT_IGNORED;
+ return handled ? base::MessagePumpDispatcher::EVENT_PROCESSED :
+ base::MessagePumpDispatcher::EVENT_IGNORED;
}
void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) {
@@ -626,10 +631,6 @@ void RootWindowHostLinux::PostNativeEvent(
XSendEvent(xdisplay_, xwindow_, False, 0, &xevent);
}
-MessageLoop::Dispatcher* RootWindowHostLinux::GetDispatcher() {
- return this;
-}
-
void RootWindowHostLinux::WillDestroyCurrentMessageLoop() {
aura::RootWindow::DeleteInstance();
}