| 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_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
| 7 | 7 |
| 8 #include <X11/extensions/shape.h> | 8 #include <X11/extensions/shape.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 // Swaps the current handler for events in the non client view with |handler|. | 82 // Swaps the current handler for events in the non client view with |handler|. |
| 83 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); | 83 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); |
| 84 | 84 |
| 85 // Deallocates the internal list of open windows. | 85 // Deallocates the internal list of open windows. |
| 86 static void CleanUpWindowList(); | 86 static void CleanUpWindowList(); |
| 87 | 87 |
| 88 protected: | 88 protected: |
| 89 // Overridden from DesktopWindowTreeHost: | 89 // Overridden from DesktopWindowTreeHost: |
| 90 virtual void Init(aura::Window* content_window, | 90 virtual void Init(aura::Window* content_window, |
| 91 const Widget::InitParams& params) OVERRIDE; | 91 const Widget::InitParams& params) override; |
| 92 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE; | 92 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) override; |
| 93 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; | 93 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() override; |
| 94 virtual scoped_ptr<aura::client::DragDropClient> | 94 virtual scoped_ptr<aura::client::DragDropClient> |
| 95 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE; | 95 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) override; |
| 96 virtual void Close() OVERRIDE; | 96 virtual void Close() override; |
| 97 virtual void CloseNow() OVERRIDE; | 97 virtual void CloseNow() override; |
| 98 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE; | 98 virtual aura::WindowTreeHost* AsWindowTreeHost() override; |
| 99 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; | 99 virtual void ShowWindowWithState(ui::WindowShowState show_state) override; |
| 100 virtual void ShowMaximizedWithBounds( | 100 virtual void ShowMaximizedWithBounds( |
| 101 const gfx::Rect& restored_bounds) OVERRIDE; | 101 const gfx::Rect& restored_bounds) override; |
| 102 virtual bool IsVisible() const OVERRIDE; | 102 virtual bool IsVisible() const override; |
| 103 virtual void SetSize(const gfx::Size& requested_size) OVERRIDE; | 103 virtual void SetSize(const gfx::Size& requested_size) override; |
| 104 virtual void StackAtTop() OVERRIDE; | 104 virtual void StackAtTop() override; |
| 105 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 105 virtual void CenterWindow(const gfx::Size& size) override; |
| 106 virtual void GetWindowPlacement( | 106 virtual void GetWindowPlacement( |
| 107 gfx::Rect* bounds, | 107 gfx::Rect* bounds, |
| 108 ui::WindowShowState* show_state) const OVERRIDE; | 108 ui::WindowShowState* show_state) const override; |
| 109 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; | 109 virtual gfx::Rect GetWindowBoundsInScreen() const override; |
| 110 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; | 110 virtual gfx::Rect GetClientAreaBoundsInScreen() const override; |
| 111 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 111 virtual gfx::Rect GetRestoredBounds() const override; |
| 112 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; | 112 virtual gfx::Rect GetWorkAreaBoundsInScreen() const override; |
| 113 virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE; | 113 virtual void SetShape(gfx::NativeRegion native_region) override; |
| 114 virtual void Activate() OVERRIDE; | 114 virtual void Activate() override; |
| 115 virtual void Deactivate() OVERRIDE; | 115 virtual void Deactivate() override; |
| 116 virtual bool IsActive() const OVERRIDE; | 116 virtual bool IsActive() const override; |
| 117 virtual void Maximize() OVERRIDE; | 117 virtual void Maximize() override; |
| 118 virtual void Minimize() OVERRIDE; | 118 virtual void Minimize() override; |
| 119 virtual void Restore() OVERRIDE; | 119 virtual void Restore() override; |
| 120 virtual bool IsMaximized() const OVERRIDE; | 120 virtual bool IsMaximized() const override; |
| 121 virtual bool IsMinimized() const OVERRIDE; | 121 virtual bool IsMinimized() const override; |
| 122 virtual bool HasCapture() const OVERRIDE; | 122 virtual bool HasCapture() const override; |
| 123 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; | 123 virtual void SetAlwaysOnTop(bool always_on_top) override; |
| 124 virtual bool IsAlwaysOnTop() const OVERRIDE; | 124 virtual bool IsAlwaysOnTop() const override; |
| 125 virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE; | 125 virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; |
| 126 virtual bool SetWindowTitle(const base::string16& title) OVERRIDE; | 126 virtual bool SetWindowTitle(const base::string16& title) override; |
| 127 virtual void ClearNativeFocus() OVERRIDE; | 127 virtual void ClearNativeFocus() override; |
| 128 virtual Widget::MoveLoopResult RunMoveLoop( | 128 virtual Widget::MoveLoopResult RunMoveLoop( |
| 129 const gfx::Vector2d& drag_offset, | 129 const gfx::Vector2d& drag_offset, |
| 130 Widget::MoveLoopSource source, | 130 Widget::MoveLoopSource source, |
| 131 Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE; | 131 Widget::MoveLoopEscapeBehavior escape_behavior) override; |
| 132 virtual void EndMoveLoop() OVERRIDE; | 132 virtual void EndMoveLoop() override; |
| 133 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; | 133 virtual void SetVisibilityChangedAnimationsEnabled(bool value) override; |
| 134 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 134 virtual bool ShouldUseNativeFrame() const override; |
| 135 virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE; | 135 virtual bool ShouldWindowContentsBeTransparent() const override; |
| 136 virtual void FrameTypeChanged() OVERRIDE; | 136 virtual void FrameTypeChanged() override; |
| 137 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 137 virtual void SetFullscreen(bool fullscreen) override; |
| 138 virtual bool IsFullscreen() const OVERRIDE; | 138 virtual bool IsFullscreen() const override; |
| 139 virtual void SetOpacity(unsigned char opacity) OVERRIDE; | 139 virtual void SetOpacity(unsigned char opacity) override; |
| 140 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, | 140 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, |
| 141 const gfx::ImageSkia& app_icon) OVERRIDE; | 141 const gfx::ImageSkia& app_icon) override; |
| 142 virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; | 142 virtual void InitModalType(ui::ModalType modal_type) override; |
| 143 virtual void FlashFrame(bool flash_frame) OVERRIDE; | 143 virtual void FlashFrame(bool flash_frame) override; |
| 144 virtual void OnRootViewLayout() OVERRIDE; | 144 virtual void OnRootViewLayout() override; |
| 145 virtual void OnNativeWidgetFocus() OVERRIDE; | 145 virtual void OnNativeWidgetFocus() override; |
| 146 virtual void OnNativeWidgetBlur() OVERRIDE; | 146 virtual void OnNativeWidgetBlur() override; |
| 147 virtual bool IsAnimatingClosed() const OVERRIDE; | 147 virtual bool IsAnimatingClosed() const override; |
| 148 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; | 148 virtual bool IsTranslucentWindowOpacitySupported() const override; |
| 149 virtual void SizeConstraintsChanged() OVERRIDE; | 149 virtual void SizeConstraintsChanged() override; |
| 150 | 150 |
| 151 // Overridden from aura::WindowTreeHost: | 151 // Overridden from aura::WindowTreeHost: |
| 152 virtual ui::EventSource* GetEventSource() OVERRIDE; | 152 virtual ui::EventSource* GetEventSource() override; |
| 153 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 153 virtual gfx::AcceleratedWidget GetAcceleratedWidget() override; |
| 154 virtual void Show() OVERRIDE; | 154 virtual void Show() override; |
| 155 virtual void Hide() OVERRIDE; | 155 virtual void Hide() override; |
| 156 virtual gfx::Rect GetBounds() const OVERRIDE; | 156 virtual gfx::Rect GetBounds() const override; |
| 157 virtual void SetBounds(const gfx::Rect& requested_bounds) OVERRIDE; | 157 virtual void SetBounds(const gfx::Rect& requested_bounds) override; |
| 158 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 158 virtual gfx::Point GetLocationOnNativeScreen() const override; |
| 159 virtual void SetCapture() OVERRIDE; | 159 virtual void SetCapture() override; |
| 160 virtual void ReleaseCapture() OVERRIDE; | 160 virtual void ReleaseCapture() override; |
| 161 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 161 virtual void PostNativeEvent(const base::NativeEvent& native_event) override; |
| 162 virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE; | 162 virtual void SetCursorNative(gfx::NativeCursor cursor) override; |
| 163 virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE; | 163 virtual void MoveCursorToNative(const gfx::Point& location) override; |
| 164 virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE; | 164 virtual void OnCursorVisibilityChangedNative(bool show) override; |
| 165 | 165 |
| 166 // Overridden frm ui::EventSource | 166 // Overridden frm ui::EventSource |
| 167 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 167 virtual ui::EventProcessor* GetEventProcessor() override; |
| 168 | 168 |
| 169 private: | 169 private: |
| 170 // Initializes our X11 surface to draw on. This method performs all | 170 // Initializes our X11 surface to draw on. This method performs all |
| 171 // initialization related to talking to the X11 server. | 171 // initialization related to talking to the X11 server. |
| 172 void InitX11Window(const Widget::InitParams& params); | 172 void InitX11Window(const Widget::InitParams& params); |
| 173 | 173 |
| 174 // Creates an aura::WindowEventDispatcher to contain the |content_window|, | 174 // Creates an aura::WindowEventDispatcher to contain the |content_window|, |
| 175 // along with all aura client objects that direct behavior. | 175 // along with all aura client objects that direct behavior. |
| 176 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); | 176 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); |
| 177 | 177 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 // Map the window (shows it) taking into account the given |show_state|. | 229 // Map the window (shows it) taking into account the given |show_state|. |
| 230 void MapWindow(ui::WindowShowState show_state); | 230 void MapWindow(ui::WindowShowState show_state); |
| 231 | 231 |
| 232 void SetWindowTransparency(); | 232 void SetWindowTransparency(); |
| 233 | 233 |
| 234 // Relayout the widget's client and non-client views. | 234 // Relayout the widget's client and non-client views. |
| 235 void Relayout(); | 235 void Relayout(); |
| 236 | 236 |
| 237 // ui::PlatformEventDispatcher: | 237 // ui::PlatformEventDispatcher: |
| 238 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; | 238 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
| 239 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; | 239 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
| 240 | 240 |
| 241 void DelayedResize(const gfx::Size& size); | 241 void DelayedResize(const gfx::Size& size); |
| 242 | 242 |
| 243 // X11 things | 243 // X11 things |
| 244 // The display and the native X window hosting the root window. | 244 // The display and the native X window hosting the root window. |
| 245 XDisplay* xdisplay_; | 245 XDisplay* xdisplay_; |
| 246 ::Window xwindow_; | 246 ::Window xwindow_; |
| 247 | 247 |
| 248 // The native root window. | 248 // The native root window. |
| 249 ::Window x_root_window_; | 249 ::Window x_root_window_; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 base::CancelableCallback<void()> delayed_resize_task_; | 339 base::CancelableCallback<void()> delayed_resize_task_; |
| 340 | 340 |
| 341 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; | 341 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |
| 342 | 342 |
| 343 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 343 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 } // namespace views | 346 } // namespace views |
| 347 | 347 |
| 348 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 348 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
| OLD | NEW |