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

Side by Side Diff: ui/aura/dispatcher_linux.h

Issue 10377161: aura-x11: Install the dispatcher as a message-pump observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/dispatcher_linux.cc » ('j') | ui/aura/root_window_host_linux.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_AURA_DISPATCHER_LINUX_H_ 5 #ifndef UI_AURA_DISPATCHER_LINUX_H_
6 #define UI_AURA_DISPATCHER_LINUX_H_ 6 #define UI_AURA_DISPATCHER_LINUX_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. 11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
12 #undef RootWindow 12 #undef RootWindow
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/message_loop.h" 16 #include "base/message_loop.h"
17 17
18 namespace aura { 18 namespace aura {
19 19
20 class DispatcherLinux : public MessageLoop::Dispatcher { 20 class DispatcherLinux : public MessageLoop::Dispatcher,
21 public base::MessagePumpObserver {
21 public: 22 public:
22 DispatcherLinux(); 23 DispatcherLinux();
23 virtual ~DispatcherLinux(); 24 virtual ~DispatcherLinux();
24 25
25 void WindowDispatcherCreated(::Window window, 26 void WindowDispatcherCreated(::Window window,
26 MessageLoop::Dispatcher* dispatcher); 27 MessageLoop::Dispatcher* dispatcher);
27 void WindowDispatcherDestroying(::Window window); 28 void WindowDispatcherDestroying(::Window window);
28 29
29 // Overridden from MessageLoop::Dispatcher: 30 // Overridden from MessageLoop::Dispatcher:
30 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; 31 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
31 32
33 // Overridden from base::MessagePumpObserver:
34 virtual base::EventStatus WillProcessEvent(
35 const base::NativeEvent& event) OVERRIDE;
36 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
37
32 private: 38 private:
33 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap; 39 typedef std::map< ::Window, MessageLoop::Dispatcher* > DispatchersMap;
34 40
35 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const; 41 MessageLoop::Dispatcher* GetDispatcherForXEvent(XEvent* xev) const;
36 42
37 DispatchersMap dispatchers_; 43 DispatchersMap dispatchers_;
38 44
39 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux); 45 DISALLOW_COPY_AND_ASSIGN(DispatcherLinux);
40 }; 46 };
41 47
42 } // namespace aura 48 } // namespace aura
43 49
44 #endif // UI_AURA_DISPATCHER_LINUX_H_ 50 #endif // UI_AURA_DISPATCHER_LINUX_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/dispatcher_linux.cc » ('j') | ui/aura/root_window_host_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698