| 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_NATIVE_WIDGET_AURA_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "ui/aura/client/focus_change_observer.h" | 9 #include "ui/aura/client/focus_change_observer.h" |
| 10 #include "ui/aura/window_delegate.h" | 10 #include "ui/aura/window_delegate.h" |
| 11 #include "ui/aura/window_tree_host_observer.h" | 11 #include "ui/aura/window_tree_host_observer.h" |
| 12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
| 13 #include "ui/views/ime/input_method_delegate.h" | 13 #include "ui/views/ime/input_method_delegate.h" |
| 14 #include "ui/views/widget/native_widget_private.h" | 14 #include "ui/views/widget/native_widget_private.h" |
| 15 #include "ui/wm/core/compound_event_filter.h" | 15 #include "ui/wm/core/compound_event_filter.h" |
| 16 #include "ui/wm/public/activation_change_observer.h" | 16 #include "ui/wm/public/activation_change_observer.h" |
| 17 #include "ui/wm/public/activation_delegate.h" | 17 #include "ui/wm/public/activation_delegate.h" |
| 18 #include "ui/wm/public/cursor_delegate.h" | |
| 19 #include "ui/wm/public/drag_drop_delegate.h" | 18 #include "ui/wm/public/drag_drop_delegate.h" |
| 20 | 19 |
| 21 namespace aura { | 20 namespace aura { |
| 22 class WindowEventDispatcher; | 21 class WindowEventDispatcher; |
| 23 class WindowTreeHost; | 22 class WindowTreeHost; |
| 24 namespace client { | 23 namespace client { |
| 25 class DragDropClient; | 24 class DragDropClient; |
| 26 class FocusClient; | 25 class FocusClient; |
| 27 class ScreenPositionClient; | 26 class ScreenPositionClient; |
| 28 class WindowTreeClient; | 27 class WindowTreeClient; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 54 class WindowReorderer; | 53 class WindowReorderer; |
| 55 | 54 |
| 56 class VIEWS_EXPORT DesktopNativeWidgetAura | 55 class VIEWS_EXPORT DesktopNativeWidgetAura |
| 57 : public internal::NativeWidgetPrivate, | 56 : public internal::NativeWidgetPrivate, |
| 58 public aura::WindowDelegate, | 57 public aura::WindowDelegate, |
| 59 public aura::client::ActivationDelegate, | 58 public aura::client::ActivationDelegate, |
| 60 public aura::client::ActivationChangeObserver, | 59 public aura::client::ActivationChangeObserver, |
| 61 public aura::client::FocusChangeObserver, | 60 public aura::client::FocusChangeObserver, |
| 62 public views::internal::InputMethodDelegate, | 61 public views::internal::InputMethodDelegate, |
| 63 public aura::client::DragDropDelegate, | 62 public aura::client::DragDropDelegate, |
| 64 public aura::WindowTreeHostObserver, | 63 public aura::WindowTreeHostObserver { |
| 65 public wm::CursorDelegate { | |
| 66 public: | 64 public: |
| 67 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); | 65 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); |
| 68 virtual ~DesktopNativeWidgetAura(); | 66 virtual ~DesktopNativeWidgetAura(); |
| 69 | 67 |
| 70 // Maps from window to DesktopNativeWidgetAura. |window| must be a root | 68 // Maps from window to DesktopNativeWidgetAura. |window| must be a root |
| 71 // window. | 69 // window. |
| 72 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); | 70 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); |
| 73 | 71 |
| 74 // Called by our DesktopWindowTreeHost after it has deleted native resources; | 72 // Called by our DesktopWindowTreeHost after it has deleted native resources; |
| 75 // this is the signal that we should start our shutdown. | 73 // this is the signal that we should start our shutdown. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 virtual void EndMoveLoop() OVERRIDE; | 179 virtual void EndMoveLoop() OVERRIDE; |
| 182 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; | 180 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; |
| 183 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; | 181 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; |
| 184 virtual void OnRootViewLayout() const OVERRIDE; | 182 virtual void OnRootViewLayout() const OVERRIDE; |
| 185 | 183 |
| 186 // Overridden from aura::WindowDelegate: | 184 // Overridden from aura::WindowDelegate: |
| 187 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 185 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
| 188 virtual gfx::Size GetMaximumSize() const OVERRIDE; | 186 virtual gfx::Size GetMaximumSize() const OVERRIDE; |
| 189 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 187 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 190 const gfx::Rect& new_bounds) OVERRIDE {} | 188 const gfx::Rect& new_bounds) OVERRIDE {} |
| 189 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; |
| 191 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 190 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; |
| 192 virtual bool ShouldDescendIntoChildForEventHandling( | 191 virtual bool ShouldDescendIntoChildForEventHandling( |
| 193 aura::Window* child, | 192 aura::Window* child, |
| 194 const gfx::Point& location) OVERRIDE; | 193 const gfx::Point& location) OVERRIDE; |
| 195 virtual bool CanFocus() OVERRIDE; | 194 virtual bool CanFocus() OVERRIDE; |
| 196 virtual void OnCaptureLost() OVERRIDE; | 195 virtual void OnCaptureLost() OVERRIDE; |
| 197 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 196 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 198 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 197 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
| 199 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 198 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 200 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 199 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 230 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 229 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
| 231 virtual void OnDragExited() OVERRIDE; | 230 virtual void OnDragExited() OVERRIDE; |
| 232 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 231 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
| 233 | 232 |
| 234 // Overridden from aura::WindowTreeHostObserver: | 233 // Overridden from aura::WindowTreeHostObserver: |
| 235 virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) OVERRIDE; | 234 virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) OVERRIDE; |
| 236 virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE; | 235 virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE; |
| 237 virtual void OnHostMoved(const aura::WindowTreeHost* host, | 236 virtual void OnHostMoved(const aura::WindowTreeHost* host, |
| 238 const gfx::Point& new_origin) OVERRIDE; | 237 const gfx::Point& new_origin) OVERRIDE; |
| 239 | 238 |
| 240 // Overridden from wm::CursorDelegate: | |
| 241 virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) OVERRIDE; | |
| 242 | |
| 243 private: | 239 private: |
| 244 friend class FocusManagerEventHandler; | 240 friend class FocusManagerEventHandler; |
| 245 friend class RootWindowDestructionObserver; | 241 friend class RootWindowDestructionObserver; |
| 246 | 242 |
| 247 // Installs the input method filter. | 243 // Installs the input method filter. |
| 248 void InstallInputMethodEventFilter(); | 244 void InstallInputMethodEventFilter(); |
| 249 | 245 |
| 250 // To save a clear on platforms where the window is never transparent, the | 246 // To save a clear on platforms where the window is never transparent, the |
| 251 // window is only set as transparent when the glass frame is in use. | 247 // window is only set as transparent when the glass frame is in use. |
| 252 void UpdateWindowTransparency(); | 248 void UpdateWindowTransparency(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 320 |
| 325 // See class documentation for Widget in widget.h for a note about type. | 321 // See class documentation for Widget in widget.h for a note about type. |
| 326 Widget::InitParams::Type widget_type_; | 322 Widget::InitParams::Type widget_type_; |
| 327 | 323 |
| 328 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); | 324 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); |
| 329 }; | 325 }; |
| 330 | 326 |
| 331 } // namespace views | 327 } // namespace views |
| 332 | 328 |
| 333 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 329 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
| OLD | NEW |