Index: ui/views/widget/desktop_aura/x11_capture_window.h |
diff --git a/ui/views/widget/desktop_aura/x11_capture_window.h b/ui/views/widget/desktop_aura/x11_capture_window.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..51e7bbf7d01188e57400844f37d0063c7b2699d9 |
--- /dev/null |
+++ b/ui/views/widget/desktop_aura/x11_capture_window.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_CAPTURE_WINDOW_H_ |
+#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_CAPTURE_WINDOW_H_ |
+ |
+#include "base/basictypes.h" |
+#include "ui/events/platform/platform_event_dispatcher.h" |
+ |
+typedef unsigned long XID; |
+ |
+namespace views { |
+ |
+// Wrapper for an X11 window which grabs mouse events whenever a |
+// DesktopWindowTreeHostX11 gains capture. |
+class X11CaptureWindow : public ui::PlatformEventDispatcher { |
+ public: |
+ X11CaptureWindow(); |
+ virtual ~X11CaptureWindow(); |
+ |
+ XID xwindow() { |
+ return xwindow_; |
+ } |
+ |
+ private: |
+ virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; |
+ virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; |
+ |
+ bool captured_; |
+ XID xwindow_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(X11CaptureWindow); |
+}; |
+ |
+} // namespace views |
+ |
+#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_CAPTURE_WINDOW_H_ |