| 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_ROOT_WINDOW_HOST_WIN_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/aura/client/animation_host.h" | 8 #include "ui/aura/client/animation_host.h" |
| 9 #include "ui/aura/root_window_host.h" | 9 #include "ui/aura/root_window_host.h" |
| 10 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
| 11 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 11 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
| 12 #include "ui/views/win/hwnd_message_handler_delegate.h" | 12 #include "ui/views/win/hwnd_message_handler_delegate.h" |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 namespace client { | 15 namespace client { |
| 16 class DragDropClient; |
| 16 class FocusClient; | 17 class FocusClient; |
| 17 class ScreenPositionClient; | |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 class DesktopCursorClient; | 22 class DesktopCursorClient; |
| 23 class DesktopDispatcherClient; | |
| 24 class DesktopDragDropClientWin; | 23 class DesktopDragDropClientWin; |
| 25 class HWNDMessageHandler; | 24 class HWNDMessageHandler; |
| 26 | 25 |
| 27 namespace corewm { | 26 namespace corewm { |
| 28 class CursorManager; | |
| 29 class TooltipWin; | 27 class TooltipWin; |
| 30 } | 28 } |
| 31 | 29 |
| 32 class VIEWS_EXPORT DesktopRootWindowHostWin | 30 class VIEWS_EXPORT DesktopRootWindowHostWin |
| 33 : public DesktopRootWindowHost, | 31 : public DesktopRootWindowHost, |
| 34 public aura::client::AnimationHost, | 32 public aura::client::AnimationHost, |
| 35 public aura::RootWindowHost, | 33 public aura::RootWindowHost, |
| 36 public HWNDMessageHandlerDelegate { | 34 public HWNDMessageHandlerDelegate { |
| 37 public: | 35 public: |
| 38 DesktopRootWindowHostWin( | 36 DesktopRootWindowHostWin( |
| 39 internal::NativeWidgetDelegate* native_widget_delegate, | 37 internal::NativeWidgetDelegate* native_widget_delegate, |
| 40 DesktopNativeWidgetAura* desktop_native_widget_aura, | 38 DesktopNativeWidgetAura* desktop_native_widget_aura); |
| 41 const gfx::Rect& initial_bounds); | |
| 42 virtual ~DesktopRootWindowHostWin(); | 39 virtual ~DesktopRootWindowHostWin(); |
| 43 | 40 |
| 44 // A way of converting an HWND into a content window. | 41 // A way of converting an HWND into a content window. |
| 45 static aura::Window* GetContentWindowForHWND(HWND hwnd); | 42 static aura::Window* GetContentWindowForHWND(HWND hwnd); |
| 46 | 43 |
| 47 protected: | 44 protected: |
| 48 // Overridden from DesktopRootWindowHost: | 45 // Overridden from DesktopRootWindowHost: |
| 49 virtual aura::RootWindow* Init(aura::Window* content_window, | 46 virtual void Init(aura::Window* content_window, |
| 50 const Widget::InitParams& params) OVERRIDE; | 47 const Widget::InitParams& params, |
| 48 aura::RootWindow::CreateParams* rw_create_params) OVERRIDE; |
| 49 virtual void OnRootWindowCreated(aura::RootWindow* root, |
| 50 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> |
| 53 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE; |
| 52 virtual void Close() OVERRIDE; | 54 virtual void Close() OVERRIDE; |
| 53 virtual void CloseNow() OVERRIDE; | 55 virtual void CloseNow() OVERRIDE; |
| 54 virtual aura::RootWindowHost* AsRootWindowHost() OVERRIDE; | 56 virtual aura::RootWindowHost* AsRootWindowHost() OVERRIDE; |
| 55 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; | 57 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; |
| 56 virtual void ShowMaximizedWithBounds( | 58 virtual void ShowMaximizedWithBounds( |
| 57 const gfx::Rect& restored_bounds) OVERRIDE; | 59 const gfx::Rect& restored_bounds) OVERRIDE; |
| 58 virtual bool IsVisible() const OVERRIDE; | 60 virtual bool IsVisible() const OVERRIDE; |
| 59 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 61 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 60 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 62 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; |
| 61 virtual void GetWindowPlacement( | 63 virtual void GetWindowPlacement( |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 private: | 217 private: |
| 216 void SetWindowTransparency(); | 218 void SetWindowTransparency(); |
| 217 | 219 |
| 218 // Returns true if a modal window is active in the current root window chain. | 220 // Returns true if a modal window is active in the current root window chain. |
| 219 bool IsModalWindowActive() const; | 221 bool IsModalWindowActive() const; |
| 220 | 222 |
| 221 // We are owned by the RootWindow, but we have to have a back pointer to it. | 223 // We are owned by the RootWindow, but we have to have a back pointer to it. |
| 222 aura::RootWindow* root_window_; | 224 aura::RootWindow* root_window_; |
| 223 | 225 |
| 224 scoped_ptr<HWNDMessageHandler> message_handler_; | 226 scoped_ptr<HWNDMessageHandler> message_handler_; |
| 225 scoped_ptr<DesktopDispatcherClient> dispatcher_client_; | |
| 226 scoped_ptr<aura::client::FocusClient> focus_client_; | 227 scoped_ptr<aura::client::FocusClient> focus_client_; |
| 227 | 228 |
| 228 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura | 229 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura |
| 229 // instead of providing this route back to Widget. | 230 // instead of providing this route back to Widget. |
| 230 internal::NativeWidgetDelegate* native_widget_delegate_; | 231 internal::NativeWidgetDelegate* native_widget_delegate_; |
| 231 | 232 |
| 232 DesktopNativeWidgetAura* desktop_native_widget_aura_; | 233 DesktopNativeWidgetAura* desktop_native_widget_aura_; |
| 233 | 234 |
| 234 aura::RootWindowHostDelegate* root_window_host_delegate_; | 235 aura::RootWindowHostDelegate* root_window_host_delegate_; |
| 235 aura::Window* content_window_; | 236 aura::Window* content_window_; |
| 236 | 237 |
| 237 // In some cases, we set a screen position client on |root_window_|. If we | 238 // Owned by DesktopNativeWidgetAura. |
| 238 // do, we're responsible for the lifetime. | 239 DesktopDragDropClientWin* drag_drop_client_; |
| 239 scoped_ptr<aura::client::ScreenPositionClient> position_client_; | |
| 240 | |
| 241 // Controls visibility of the cursor. | |
| 242 scoped_ptr<views::corewm::CursorManager> cursor_client_; | |
| 243 | |
| 244 scoped_ptr<DesktopDragDropClientWin> drag_drop_client_; | |
| 245 | 240 |
| 246 // When certain windows are being shown, we augment the window size | 241 // When certain windows are being shown, we augment the window size |
| 247 // temporarily for animation. The following two members contain the top left | 242 // temporarily for animation. The following two members contain the top left |
| 248 // and bottom right offsets which are used to enlarge the window. | 243 // and bottom right offsets which are used to enlarge the window. |
| 249 gfx::Vector2d window_expansion_top_left_delta_; | 244 gfx::Vector2d window_expansion_top_left_delta_; |
| 250 gfx::Vector2d window_expansion_bottom_right_delta_; | 245 gfx::Vector2d window_expansion_bottom_right_delta_; |
| 251 | 246 |
| 252 // Whether the window close should be converted to a hide, and then actually | 247 // Whether the window close should be converted to a hide, and then actually |
| 253 // closed on the completion of the hide animation. This is cached because | 248 // closed on the completion of the hide animation. This is cached because |
| 254 // the property is set on the contained window which has a shorter lifetime. | 249 // the property is set on the contained window which has a shorter lifetime. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 268 // Owned by TooltipController, but we need to forward events to it so we keep | 263 // Owned by TooltipController, but we need to forward events to it so we keep |
| 269 // a reference. | 264 // a reference. |
| 270 corewm::TooltipWin* tooltip_; | 265 corewm::TooltipWin* tooltip_; |
| 271 | 266 |
| 272 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostWin); | 267 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostWin); |
| 273 }; | 268 }; |
| 274 | 269 |
| 275 } // namespace views | 270 } // namespace views |
| 276 | 271 |
| 277 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 272 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
| OLD | NEW |