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