| OLD | NEW |
| 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_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
| 7 | 7 |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
| 10 #undef RootWindow | 10 #undef RootWindow |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // dispatcher. The window dispatcher sends these events to here. | 44 // dispatcher. The window dispatcher sends these events to here. |
| 45 void ProcessXEvent(const base::NativeEvent& event); | 45 void ProcessXEvent(const base::NativeEvent& event); |
| 46 | 46 |
| 47 // Overridden from MessagePumpDispatcher: | 47 // Overridden from MessagePumpDispatcher: |
| 48 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 48 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
| 49 | 49 |
| 50 // Overridden from aura::EnvObserver: | 50 // Overridden from aura::EnvObserver: |
| 51 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; | 51 virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; |
| 52 virtual void OnWillDestroyEnv() OVERRIDE; | 52 virtual void OnWillDestroyEnv() OVERRIDE; |
| 53 | 53 |
| 54 // Allows to override wm_supports_active_window_ value for tests. If the WM |
| 55 // supports _NET_ACTIVE_WINDOW, activation is async otherwise it is sync. |
| 56 void SetWMSupportsActiveWindowForTests(bool value) { |
| 57 wm_supports_active_window_ = value; |
| 58 } |
| 59 |
| 54 private: | 60 private: |
| 55 explicit X11DesktopHandler(); | 61 explicit X11DesktopHandler(); |
| 56 virtual ~X11DesktopHandler(); | 62 virtual ~X11DesktopHandler(); |
| 57 | 63 |
| 58 // Handles changes in activation. | 64 // Handles changes in activation. |
| 59 void OnActiveWindowChanged(::Window window); | 65 void OnActiveWindowChanged(::Window window); |
| 60 | 66 |
| 61 // The display and the native X window hosting the root window. | 67 // The display and the native X window hosting the root window. |
| 62 XDisplay* xdisplay_; | 68 XDisplay* xdisplay_; |
| 63 | 69 |
| 64 // The native root window. | 70 // The native root window. |
| 65 ::Window x_root_window_; | 71 ::Window x_root_window_; |
| 66 | 72 |
| 67 // The activated window. | 73 // The activated window. |
| 68 ::Window current_window_; | 74 ::Window current_window_; |
| 69 | 75 |
| 70 ui::X11AtomCache atom_cache_; | 76 ui::X11AtomCache atom_cache_; |
| 71 | 77 |
| 72 bool wm_supports_active_window_; | 78 bool wm_supports_active_window_; |
| 73 | 79 |
| 74 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); | 80 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); |
| 75 }; | 81 }; |
| 76 | 82 |
| 77 } // namespace views | 83 } // namespace views |
| 78 | 84 |
| 79 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 85 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
| OLD | NEW |