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_WIN_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_WIN_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_WIN_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_WIN_H_ |
7 | 7 |
8 #include "ui/aura/window_tree_host.h" | 8 #include "ui/aura/window_tree_host.h" |
9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
10 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 10 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 internal::NativeWidgetDelegate* native_widget_delegate, | 39 internal::NativeWidgetDelegate* native_widget_delegate, |
40 DesktopNativeWidgetAura* desktop_native_widget_aura); | 40 DesktopNativeWidgetAura* desktop_native_widget_aura); |
41 virtual ~DesktopWindowTreeHostWin(); | 41 virtual ~DesktopWindowTreeHostWin(); |
42 | 42 |
43 // A way of converting an HWND into a content window. | 43 // A way of converting an HWND into a content window. |
44 static aura::Window* GetContentWindowForHWND(HWND hwnd); | 44 static aura::Window* GetContentWindowForHWND(HWND hwnd); |
45 | 45 |
46 protected: | 46 protected: |
47 // Overridden from DesktopWindowTreeHost: | 47 // Overridden from DesktopWindowTreeHost: |
48 virtual void Init(aura::Window* content_window, | 48 virtual void Init(aura::Window* content_window, |
49 const Widget::InitParams& params) OVERRIDE; | 49 const Widget::InitParams& params) override; |
50 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE; | 50 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) override; |
51 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; | 51 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() override; |
52 virtual scoped_ptr<aura::client::DragDropClient> | 52 virtual scoped_ptr<aura::client::DragDropClient> |
53 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE; | 53 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) override; |
54 virtual void Close() OVERRIDE; | 54 virtual void Close() override; |
55 virtual void CloseNow() OVERRIDE; | 55 virtual void CloseNow() override; |
56 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE; | 56 virtual aura::WindowTreeHost* AsWindowTreeHost() override; |
57 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; | 57 virtual void ShowWindowWithState(ui::WindowShowState show_state) override; |
58 virtual void ShowMaximizedWithBounds( | 58 virtual void ShowMaximizedWithBounds( |
59 const gfx::Rect& restored_bounds) OVERRIDE; | 59 const gfx::Rect& restored_bounds) override; |
60 virtual bool IsVisible() const OVERRIDE; | 60 virtual bool IsVisible() const override; |
61 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 61 virtual void SetSize(const gfx::Size& size) override; |
62 virtual void StackAtTop() OVERRIDE; | 62 virtual void StackAtTop() override; |
63 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 63 virtual void CenterWindow(const gfx::Size& size) override; |
64 virtual void GetWindowPlacement( | 64 virtual void GetWindowPlacement( |
65 gfx::Rect* bounds, | 65 gfx::Rect* bounds, |
66 ui::WindowShowState* show_state) const OVERRIDE; | 66 ui::WindowShowState* show_state) const override; |
67 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; | 67 virtual gfx::Rect GetWindowBoundsInScreen() const override; |
68 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; | 68 virtual gfx::Rect GetClientAreaBoundsInScreen() const override; |
69 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 69 virtual gfx::Rect GetRestoredBounds() const override; |
70 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; | 70 virtual gfx::Rect GetWorkAreaBoundsInScreen() const override; |
71 virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE; | 71 virtual void SetShape(gfx::NativeRegion native_region) override; |
72 virtual void Activate() OVERRIDE; | 72 virtual void Activate() override; |
73 virtual void Deactivate() OVERRIDE; | 73 virtual void Deactivate() override; |
74 virtual bool IsActive() const OVERRIDE; | 74 virtual bool IsActive() const override; |
75 virtual void Maximize() OVERRIDE; | 75 virtual void Maximize() override; |
76 virtual void Minimize() OVERRIDE; | 76 virtual void Minimize() override; |
77 virtual void Restore() OVERRIDE; | 77 virtual void Restore() override; |
78 virtual bool IsMaximized() const OVERRIDE; | 78 virtual bool IsMaximized() const override; |
79 virtual bool IsMinimized() const OVERRIDE; | 79 virtual bool IsMinimized() const override; |
80 virtual bool HasCapture() const OVERRIDE; | 80 virtual bool HasCapture() const override; |
81 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; | 81 virtual void SetAlwaysOnTop(bool always_on_top) override; |
82 virtual bool IsAlwaysOnTop() const OVERRIDE; | 82 virtual bool IsAlwaysOnTop() const override; |
83 virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE; | 83 virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; |
84 virtual bool SetWindowTitle(const base::string16& title) OVERRIDE; | 84 virtual bool SetWindowTitle(const base::string16& title) override; |
85 virtual void ClearNativeFocus() OVERRIDE; | 85 virtual void ClearNativeFocus() override; |
86 virtual Widget::MoveLoopResult RunMoveLoop( | 86 virtual Widget::MoveLoopResult RunMoveLoop( |
87 const gfx::Vector2d& drag_offset, | 87 const gfx::Vector2d& drag_offset, |
88 Widget::MoveLoopSource source, | 88 Widget::MoveLoopSource source, |
89 Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE; | 89 Widget::MoveLoopEscapeBehavior escape_behavior) override; |
90 virtual void EndMoveLoop() OVERRIDE; | 90 virtual void EndMoveLoop() override; |
91 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; | 91 virtual void SetVisibilityChangedAnimationsEnabled(bool value) override; |
92 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 92 virtual bool ShouldUseNativeFrame() const override; |
93 virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE; | 93 virtual bool ShouldWindowContentsBeTransparent() const override; |
94 virtual void FrameTypeChanged() OVERRIDE; | 94 virtual void FrameTypeChanged() override; |
95 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 95 virtual void SetFullscreen(bool fullscreen) override; |
96 virtual bool IsFullscreen() const OVERRIDE; | 96 virtual bool IsFullscreen() const override; |
97 virtual void SetOpacity(unsigned char opacity) OVERRIDE; | 97 virtual void SetOpacity(unsigned char opacity) override; |
98 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, | 98 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, |
99 const gfx::ImageSkia& app_icon) OVERRIDE; | 99 const gfx::ImageSkia& app_icon) override; |
100 virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; | 100 virtual void InitModalType(ui::ModalType modal_type) override; |
101 virtual void FlashFrame(bool flash_frame) OVERRIDE; | 101 virtual void FlashFrame(bool flash_frame) override; |
102 virtual void OnRootViewLayout() OVERRIDE; | 102 virtual void OnRootViewLayout() override; |
103 virtual void OnNativeWidgetFocus() OVERRIDE; | 103 virtual void OnNativeWidgetFocus() override; |
104 virtual void OnNativeWidgetBlur() OVERRIDE; | 104 virtual void OnNativeWidgetBlur() override; |
105 virtual bool IsAnimatingClosed() const OVERRIDE; | 105 virtual bool IsAnimatingClosed() const override; |
106 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; | 106 virtual bool IsTranslucentWindowOpacitySupported() const override; |
107 virtual void SizeConstraintsChanged() OVERRIDE; | 107 virtual void SizeConstraintsChanged() override; |
108 | 108 |
109 // Overridden from aura::WindowTreeHost: | 109 // Overridden from aura::WindowTreeHost: |
110 virtual ui::EventSource* GetEventSource() OVERRIDE; | 110 virtual ui::EventSource* GetEventSource() override; |
111 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 111 virtual gfx::AcceleratedWidget GetAcceleratedWidget() override; |
112 virtual void Show() OVERRIDE; | 112 virtual void Show() override; |
113 virtual void Hide() OVERRIDE; | 113 virtual void Hide() override; |
114 virtual gfx::Rect GetBounds() const OVERRIDE; | 114 virtual gfx::Rect GetBounds() const override; |
115 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 115 virtual void SetBounds(const gfx::Rect& bounds) override; |
116 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 116 virtual gfx::Point GetLocationOnNativeScreen() const override; |
117 virtual void SetCapture() OVERRIDE; | 117 virtual void SetCapture() override; |
118 virtual void ReleaseCapture() OVERRIDE; | 118 virtual void ReleaseCapture() override; |
119 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 119 virtual void PostNativeEvent(const base::NativeEvent& native_event) override; |
120 virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE; | 120 virtual void SetCursorNative(gfx::NativeCursor cursor) override; |
121 virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE; | 121 virtual void OnCursorVisibilityChangedNative(bool show) override; |
122 virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE; | 122 virtual void MoveCursorToNative(const gfx::Point& location) override; |
123 | 123 |
124 // Overridden frm ui::EventSource | 124 // Overridden frm ui::EventSource |
125 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 125 virtual ui::EventProcessor* GetEventProcessor() override; |
126 | 126 |
127 // Overridden from aura::client::AnimationHost | 127 // Overridden from aura::client::AnimationHost |
128 virtual void SetHostTransitionOffsets( | 128 virtual void SetHostTransitionOffsets( |
129 const gfx::Vector2d& top_left_delta, | 129 const gfx::Vector2d& top_left_delta, |
130 const gfx::Vector2d& bottom_right_delta) OVERRIDE; | 130 const gfx::Vector2d& bottom_right_delta) override; |
131 virtual void OnWindowHidingAnimationCompleted() OVERRIDE; | 131 virtual void OnWindowHidingAnimationCompleted() override; |
132 | 132 |
133 // Overridden from HWNDMessageHandlerDelegate: | 133 // Overridden from HWNDMessageHandlerDelegate: |
134 virtual bool IsWidgetWindow() const OVERRIDE; | 134 virtual bool IsWidgetWindow() const override; |
135 virtual bool IsUsingCustomFrame() const OVERRIDE; | 135 virtual bool IsUsingCustomFrame() const override; |
136 virtual void SchedulePaint() OVERRIDE; | 136 virtual void SchedulePaint() override; |
137 virtual void EnableInactiveRendering() OVERRIDE; | 137 virtual void EnableInactiveRendering() override; |
138 virtual bool IsInactiveRenderingDisabled() OVERRIDE; | 138 virtual bool IsInactiveRenderingDisabled() override; |
139 virtual bool CanResize() const OVERRIDE; | 139 virtual bool CanResize() const override; |
140 virtual bool CanMaximize() const OVERRIDE; | 140 virtual bool CanMaximize() const override; |
141 virtual bool CanMinimize() const OVERRIDE; | 141 virtual bool CanMinimize() const override; |
142 virtual bool CanActivate() const OVERRIDE; | 142 virtual bool CanActivate() const override; |
143 virtual bool WidgetSizeIsClientSize() const OVERRIDE; | 143 virtual bool WidgetSizeIsClientSize() const override; |
144 virtual bool IsModal() const OVERRIDE; | 144 virtual bool IsModal() const override; |
145 virtual int GetInitialShowState() const OVERRIDE; | 145 virtual int GetInitialShowState() const override; |
146 virtual bool WillProcessWorkAreaChange() const OVERRIDE; | 146 virtual bool WillProcessWorkAreaChange() const override; |
147 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 147 virtual int GetNonClientComponent(const gfx::Point& point) const override; |
148 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) OVERRIDE; | 148 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) override; |
149 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE; | 149 virtual bool GetClientAreaInsets(gfx::Insets* insets) const override; |
150 virtual void GetMinMaxSize(gfx::Size* min_size, | 150 virtual void GetMinMaxSize(gfx::Size* min_size, |
151 gfx::Size* max_size) const OVERRIDE; | 151 gfx::Size* max_size) const override; |
152 virtual gfx::Size GetRootViewSize() const OVERRIDE; | 152 virtual gfx::Size GetRootViewSize() const override; |
153 virtual void ResetWindowControls() OVERRIDE; | 153 virtual void ResetWindowControls() override; |
154 virtual void PaintLayeredWindow(gfx::Canvas* canvas) OVERRIDE; | 154 virtual void PaintLayeredWindow(gfx::Canvas* canvas) override; |
155 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 155 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; |
156 virtual bool ShouldHandleSystemCommands() const OVERRIDE; | 156 virtual bool ShouldHandleSystemCommands() const override; |
157 virtual InputMethod* GetInputMethod() OVERRIDE; | 157 virtual InputMethod* GetInputMethod() override; |
158 virtual void HandleAppDeactivated() OVERRIDE; | 158 virtual void HandleAppDeactivated() override; |
159 virtual void HandleActivationChanged(bool active) OVERRIDE; | 159 virtual void HandleActivationChanged(bool active) override; |
160 virtual bool HandleAppCommand(short command) OVERRIDE; | 160 virtual bool HandleAppCommand(short command) override; |
161 virtual void HandleCancelMode() OVERRIDE; | 161 virtual void HandleCancelMode() override; |
162 virtual void HandleCaptureLost() OVERRIDE; | 162 virtual void HandleCaptureLost() override; |
163 virtual void HandleClose() OVERRIDE; | 163 virtual void HandleClose() override; |
164 virtual bool HandleCommand(int command) OVERRIDE; | 164 virtual bool HandleCommand(int command) override; |
165 virtual void HandleAccelerator(const ui::Accelerator& accelerator) OVERRIDE; | 165 virtual void HandleAccelerator(const ui::Accelerator& accelerator) override; |
166 virtual void HandleCreate() OVERRIDE; | 166 virtual void HandleCreate() override; |
167 virtual void HandleDestroying() OVERRIDE; | 167 virtual void HandleDestroying() override; |
168 virtual void HandleDestroyed() OVERRIDE; | 168 virtual void HandleDestroyed() override; |
169 virtual bool HandleInitialFocus(ui::WindowShowState show_state) OVERRIDE; | 169 virtual bool HandleInitialFocus(ui::WindowShowState show_state) override; |
170 virtual void HandleDisplayChange() OVERRIDE; | 170 virtual void HandleDisplayChange() override; |
171 virtual void HandleBeginWMSizeMove() OVERRIDE; | 171 virtual void HandleBeginWMSizeMove() override; |
172 virtual void HandleEndWMSizeMove() OVERRIDE; | 172 virtual void HandleEndWMSizeMove() override; |
173 virtual void HandleMove() OVERRIDE; | 173 virtual void HandleMove() override; |
174 virtual void HandleWorkAreaChanged() OVERRIDE; | 174 virtual void HandleWorkAreaChanged() override; |
175 virtual void HandleVisibilityChanging(bool visible) OVERRIDE; | 175 virtual void HandleVisibilityChanging(bool visible) override; |
176 virtual void HandleVisibilityChanged(bool visible) OVERRIDE; | 176 virtual void HandleVisibilityChanged(bool visible) override; |
177 virtual void HandleClientSizeChanged(const gfx::Size& new_size) OVERRIDE; | 177 virtual void HandleClientSizeChanged(const gfx::Size& new_size) override; |
178 virtual void HandleFrameChanged() OVERRIDE; | 178 virtual void HandleFrameChanged() override; |
179 virtual void HandleNativeFocus(HWND last_focused_window) OVERRIDE; | 179 virtual void HandleNativeFocus(HWND last_focused_window) override; |
180 virtual void HandleNativeBlur(HWND focused_window) OVERRIDE; | 180 virtual void HandleNativeBlur(HWND focused_window) override; |
181 virtual bool HandleMouseEvent(const ui::MouseEvent& event) OVERRIDE; | 181 virtual bool HandleMouseEvent(const ui::MouseEvent& event) override; |
182 virtual bool HandleKeyEvent(const ui::KeyEvent& event) OVERRIDE; | 182 virtual bool HandleKeyEvent(const ui::KeyEvent& event) override; |
183 virtual bool HandleUntranslatedKeyEvent(const ui::KeyEvent& event) OVERRIDE; | 183 virtual bool HandleUntranslatedKeyEvent(const ui::KeyEvent& event) override; |
184 virtual void HandleTouchEvent(const ui::TouchEvent& event) OVERRIDE; | 184 virtual void HandleTouchEvent(const ui::TouchEvent& event) override; |
185 virtual bool HandleIMEMessage(UINT message, | 185 virtual bool HandleIMEMessage(UINT message, |
186 WPARAM w_param, | 186 WPARAM w_param, |
187 LPARAM l_param, | 187 LPARAM l_param, |
188 LRESULT* result) OVERRIDE; | 188 LRESULT* result) override; |
189 virtual void HandleInputLanguageChange(DWORD character_set, | 189 virtual void HandleInputLanguageChange(DWORD character_set, |
190 HKL input_language_id) OVERRIDE; | 190 HKL input_language_id) override; |
191 virtual bool HandlePaintAccelerated(const gfx::Rect& invalid_rect) OVERRIDE; | 191 virtual bool HandlePaintAccelerated(const gfx::Rect& invalid_rect) override; |
192 virtual void HandlePaint(gfx::Canvas* canvas) OVERRIDE; | 192 virtual void HandlePaint(gfx::Canvas* canvas) override; |
193 virtual bool HandleTooltipNotify(int w_param, | 193 virtual bool HandleTooltipNotify(int w_param, |
194 NMHDR* l_param, | 194 NMHDR* l_param, |
195 LRESULT* l_result) OVERRIDE; | 195 LRESULT* l_result) override; |
196 virtual void HandleMenuLoop(bool in_menu_loop) OVERRIDE; | 196 virtual void HandleMenuLoop(bool in_menu_loop) override; |
197 virtual bool PreHandleMSG(UINT message, | 197 virtual bool PreHandleMSG(UINT message, |
198 WPARAM w_param, | 198 WPARAM w_param, |
199 LPARAM l_param, | 199 LPARAM l_param, |
200 LRESULT* result) OVERRIDE; | 200 LRESULT* result) override; |
201 virtual void PostHandleMSG(UINT message, | 201 virtual void PostHandleMSG(UINT message, |
202 WPARAM w_param, | 202 WPARAM w_param, |
203 LPARAM l_param) OVERRIDE; | 203 LPARAM l_param) override; |
204 virtual bool HandleScrollEvent(const ui::ScrollEvent& event) OVERRIDE; | 204 virtual bool HandleScrollEvent(const ui::ScrollEvent& event) override; |
205 virtual void HandleWindowSizeChanging() OVERRIDE; | 205 virtual void HandleWindowSizeChanging() override; |
206 | 206 |
207 Widget* GetWidget(); | 207 Widget* GetWidget(); |
208 const Widget* GetWidget() const; | 208 const Widget* GetWidget() const; |
209 HWND GetHWND() const; | 209 HWND GetHWND() const; |
210 | 210 |
211 private: | 211 private: |
212 void SetWindowTransparency(); | 212 void SetWindowTransparency(); |
213 | 213 |
214 // Returns true if a modal window is active in the current root window chain. | 214 // Returns true if a modal window is active in the current root window chain. |
215 bool IsModalWindowActive() const; | 215 bool IsModalWindowActive() const; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 // Set to true if we are about to enter a sizing loop. | 274 // Set to true if we are about to enter a sizing loop. |
275 bool in_sizing_loop_; | 275 bool in_sizing_loop_; |
276 | 276 |
277 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostWin); | 277 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostWin); |
278 }; | 278 }; |
279 | 279 |
280 } // namespace views | 280 } // namespace views |
281 | 281 |
282 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_WIN_H_ | 282 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_WIN_H_ |
OLD | NEW |