Chromium Code Reviews| 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/root_window_host.h" | 8 #include "ui/aura/root_window_host.h" |
| 9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
| 10 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 10 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 const gfx::Rect& initial_bounds); | 40 const gfx::Rect& initial_bounds); |
| 41 virtual ~DesktopRootWindowHostWin(); | 41 virtual ~DesktopRootWindowHostWin(); |
| 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 DesktopRootWindowHost: | 47 // Overridden from DesktopRootWindowHost: |
| 48 virtual aura::RootWindow* Init(aura::Window* content_window, | 48 virtual aura::RootWindow* Init(aura::Window* content_window, |
| 49 const Widget::InitParams& params) OVERRIDE; | 49 const Widget::InitParams& params) OVERRIDE; |
| 50 virtual void InitFocus(aura::Window* window) OVERRIDE; | |
| 50 virtual void Close() OVERRIDE; | 51 virtual void Close() OVERRIDE; |
| 51 virtual void CloseNow() OVERRIDE; | 52 virtual void CloseNow() OVERRIDE; |
| 52 virtual aura::RootWindowHost* AsRootWindowHost() OVERRIDE; | 53 virtual aura::RootWindowHost* AsRootWindowHost() OVERRIDE; |
| 53 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; | 54 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; |
| 54 virtual void ShowMaximizedWithBounds( | 55 virtual void ShowMaximizedWithBounds( |
| 55 const gfx::Rect& restored_bounds) OVERRIDE; | 56 const gfx::Rect& restored_bounds) OVERRIDE; |
| 56 virtual bool IsVisible() const OVERRIDE; | 57 virtual bool IsVisible() const OVERRIDE; |
| 57 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 58 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 58 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 59 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; |
| 59 virtual void GetWindowPlacement( | 60 virtual void GetWindowPlacement( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; | 118 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; |
| 118 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, | 119 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
| 119 const gfx::Point& dest_offset, | 120 const gfx::Point& dest_offset, |
| 120 SkCanvas* canvas) OVERRIDE; | 121 SkCanvas* canvas) OVERRIDE; |
| 121 virtual bool GrabSnapshot( | 122 virtual bool GrabSnapshot( |
| 122 const gfx::Rect& snapshot_bounds, | 123 const gfx::Rect& snapshot_bounds, |
| 123 std::vector<unsigned char>* png_representation) OVERRIDE; | 124 std::vector<unsigned char>* png_representation) OVERRIDE; |
| 124 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 125 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
| 125 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 126 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
| 126 virtual void PrepareForShutdown() OVERRIDE; | 127 virtual void PrepareForShutdown() OVERRIDE; |
| 128 virtual void SetHostWindowExpansion(const gfx::Rect& extra) OVERRIDE; | |
| 127 | 129 |
| 128 // Overridden from HWNDMessageHandlerDelegate: | 130 // Overridden from HWNDMessageHandlerDelegate: |
| 129 virtual bool IsWidgetWindow() const OVERRIDE; | 131 virtual bool IsWidgetWindow() const OVERRIDE; |
| 130 virtual bool IsUsingCustomFrame() const OVERRIDE; | 132 virtual bool IsUsingCustomFrame() const OVERRIDE; |
| 131 virtual void SchedulePaint() OVERRIDE; | 133 virtual void SchedulePaint() OVERRIDE; |
| 132 virtual void EnableInactiveRendering() OVERRIDE; | 134 virtual void EnableInactiveRendering() OVERRIDE; |
| 133 virtual bool IsInactiveRenderingDisabled() OVERRIDE; | 135 virtual bool IsInactiveRenderingDisabled() OVERRIDE; |
| 134 virtual bool CanResize() const OVERRIDE; | 136 virtual bool CanResize() const OVERRIDE; |
| 135 virtual bool CanMaximize() const OVERRIDE; | 137 virtual bool CanMaximize() const OVERRIDE; |
| 136 virtual bool CanActivate() const OVERRIDE; | 138 virtual bool CanActivate() const OVERRIDE; |
| 137 virtual bool WidgetSizeIsClientSize() const OVERRIDE; | 139 virtual bool WidgetSizeIsClientSize() const OVERRIDE; |
| 138 virtual bool CanSaveFocus() const OVERRIDE; | 140 virtual bool CanSaveFocus() const OVERRIDE; |
| 139 virtual void SaveFocusOnDeactivate() OVERRIDE; | 141 virtual void SaveFocusOnDeactivate() OVERRIDE; |
| 140 virtual void RestoreFocusOnActivate() OVERRIDE; | 142 virtual void RestoreFocusOnActivate() OVERRIDE; |
| 141 virtual void RestoreFocusOnEnable() OVERRIDE; | 143 virtual void RestoreFocusOnEnable() OVERRIDE; |
| 142 virtual bool IsModal() const OVERRIDE; | 144 virtual bool IsModal() const OVERRIDE; |
| 143 virtual int GetInitialShowState() const OVERRIDE; | 145 virtual int GetInitialShowState() const OVERRIDE; |
| 144 virtual bool WillProcessWorkAreaChange() const OVERRIDE; | 146 virtual bool WillProcessWorkAreaChange() const OVERRIDE; |
| 145 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 147 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; |
| 146 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) OVERRIDE; | 148 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* path) OVERRIDE; |
| 147 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE; | 149 virtual bool GetClientAreaInsets(gfx::Insets* insets) const OVERRIDE; |
| 148 virtual void GetMinMaxSize(gfx::Size* min_size, | 150 virtual void GetMinMaxSize(gfx::Size* min_size, |
| 149 gfx::Size* max_size) const OVERRIDE; | 151 gfx::Size* max_size) const OVERRIDE; |
| 150 virtual gfx::Size GetRootViewSize() const OVERRIDE; | 152 virtual gfx::Size GetRootViewSize() const OVERRIDE; |
| 151 virtual void ResetWindowControls() OVERRIDE; | 153 virtual void ResetWindowControls() OVERRIDE; |
| 152 virtual void PaintLayeredWindow(gfx::Canvas* canvas) OVERRIDE; | 154 virtual void PaintLayeredWindow(gfx::Canvas* canvas) OVERRIDE; |
| 153 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 155 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
| 154 virtual bool ShouldHandleSystemCommands() const OVERRIDE; | 156 virtual bool ShouldHandleSystemCommands() const OVERRIDE; |
|
scottmg
2013/03/14 22:51:53
(due to rebase, not this CL)
| |
| 155 virtual InputMethod* GetInputMethod() OVERRIDE; | 157 virtual InputMethod* GetInputMethod() OVERRIDE; |
| 156 virtual void HandleAppDeactivated() OVERRIDE; | 158 virtual void HandleAppDeactivated() OVERRIDE; |
| 157 virtual void HandleActivationChanged(bool active) OVERRIDE; | 159 virtual void HandleActivationChanged(bool active) OVERRIDE; |
| 158 virtual bool HandleAppCommand(short command) OVERRIDE; | 160 virtual bool HandleAppCommand(short command) OVERRIDE; |
| 159 virtual void HandleCancelMode() OVERRIDE; | 161 virtual void HandleCancelMode() OVERRIDE; |
| 160 virtual void HandleCaptureLost() OVERRIDE; | 162 virtual void HandleCaptureLost() OVERRIDE; |
| 161 virtual void HandleClose() OVERRIDE; | 163 virtual void HandleClose() OVERRIDE; |
| 162 virtual bool HandleCommand(int command) OVERRIDE; | 164 virtual bool HandleCommand(int command) OVERRIDE; |
| 163 virtual void HandleAccelerator(const ui::Accelerator& accelerator) OVERRIDE; | 165 virtual void HandleAccelerator(const ui::Accelerator& accelerator) OVERRIDE; |
| 164 virtual void HandleCreate() OVERRIDE; | 166 virtual void HandleCreate() OVERRIDE; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 | 229 |
| 228 // In some cases, we set a screen position client on |root_window_|. If we | 230 // In some cases, we set a screen position client on |root_window_|. If we |
| 229 // do, we're responsible for the lifetime. | 231 // do, we're responsible for the lifetime. |
| 230 scoped_ptr<aura::client::ScreenPositionClient> position_client_; | 232 scoped_ptr<aura::client::ScreenPositionClient> position_client_; |
| 231 | 233 |
| 232 // Controls visibility of the cursor. | 234 // Controls visibility of the cursor. |
| 233 scoped_ptr<views::corewm::CursorManager> cursor_client_; | 235 scoped_ptr<views::corewm::CursorManager> cursor_client_; |
| 234 | 236 |
| 235 scoped_ptr<DesktopDragDropClientWin> drag_drop_client_; | 237 scoped_ptr<DesktopDragDropClientWin> drag_drop_client_; |
| 236 | 238 |
| 239 // Extra size added to the host window. Typically, the window size matches | |
| 240 // the contained content, however, when performing a translating or scaling | |
| 241 // animation the window has to be enlarged so that the content is not | |
| 242 // clipped. | |
| 243 gfx::Rect window_expansion_; | |
| 244 | |
| 237 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostWin); | 245 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostWin); |
| 238 }; | 246 }; |
| 239 | 247 |
| 240 } // namespace views | 248 } // namespace views |
| 241 | 249 |
| 242 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ | 250 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WIN_H_ |
| OLD | NEW |