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_NATIVE_WIDGET_AURA_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ |
6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "ui/aura/client/focus_change_observer.h" | 10 #include "ui/aura/client/focus_change_observer.h" |
11 #include "ui/aura/window_delegate.h" | 11 #include "ui/aura/window_delegate.h" |
12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
14 #include "ui/views/ime/input_method_delegate.h" | 14 #include "ui/views/ime/input_method_delegate.h" |
15 #include "ui/views/views_export.h" | 15 #include "ui/views/views_export.h" |
16 #include "ui/views/widget/native_widget_private.h" | 16 #include "ui/views/widget/native_widget_private.h" |
17 #include "ui/wm/public/activation_change_observer.h" | 17 #include "ui/wm/public/activation_change_observer.h" |
18 #include "ui/wm/public/activation_delegate.h" | 18 #include "ui/wm/public/activation_delegate.h" |
| 19 #include "ui/wm/public/cursor_delegate.h" |
19 #include "ui/wm/public/drag_drop_delegate.h" | 20 #include "ui/wm/public/drag_drop_delegate.h" |
20 | 21 |
21 namespace aura { | 22 namespace aura { |
22 class Window; | 23 class Window; |
23 } | 24 } |
24 namespace gfx { | 25 namespace gfx { |
25 class FontList; | 26 class FontList; |
26 } | 27 } |
27 | 28 |
28 namespace views { | 29 namespace views { |
29 | 30 |
30 class DropHelper; | 31 class DropHelper; |
31 class TooltipManagerAura; | 32 class TooltipManagerAura; |
32 class WindowReorderer; | 33 class WindowReorderer; |
33 | 34 |
34 class VIEWS_EXPORT NativeWidgetAura | 35 class VIEWS_EXPORT NativeWidgetAura |
35 : public internal::NativeWidgetPrivate, | 36 : public internal::NativeWidgetPrivate, |
36 public internal::InputMethodDelegate, | 37 public internal::InputMethodDelegate, |
37 public aura::WindowDelegate, | 38 public aura::WindowDelegate, |
38 public aura::client::ActivationDelegate, | 39 public aura::client::ActivationDelegate, |
39 public aura::client::ActivationChangeObserver, | 40 public aura::client::ActivationChangeObserver, |
40 public aura::client::FocusChangeObserver, | 41 public aura::client::FocusChangeObserver, |
41 public aura::client::DragDropDelegate { | 42 public aura::client::DragDropDelegate, |
| 43 public wm::CursorDelegate { |
42 public: | 44 public: |
43 explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate); | 45 explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate); |
44 | 46 |
45 // TODO(beng): Find a better place for this, and the similar method on | 47 // TODO(beng): Find a better place for this, and the similar method on |
46 // NativeWidgetWin. | 48 // NativeWidgetWin. |
47 static gfx::FontList GetWindowTitleFontList(); | 49 static gfx::FontList GetWindowTitleFontList(); |
48 | 50 |
49 // Called internally by NativeWidgetAura and DesktopNativeWidgetAura to | 51 // Called internally by NativeWidgetAura and DesktopNativeWidgetAura to |
50 // associate |native_widget| with |window|. | 52 // associate |native_widget| with |window|. |
51 static void RegisterNativeWidgetForWindow( | 53 static void RegisterNativeWidgetForWindow( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 virtual void OnRootViewLayout() const OVERRIDE; | 139 virtual void OnRootViewLayout() const OVERRIDE; |
138 | 140 |
139 // Overridden from views::InputMethodDelegate: | 141 // Overridden from views::InputMethodDelegate: |
140 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; | 142 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; |
141 | 143 |
142 // Overridden from aura::WindowDelegate: | 144 // Overridden from aura::WindowDelegate: |
143 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 145 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
144 virtual gfx::Size GetMaximumSize() const OVERRIDE; | 146 virtual gfx::Size GetMaximumSize() const OVERRIDE; |
145 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 147 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
146 const gfx::Rect& new_bounds) OVERRIDE; | 148 const gfx::Rect& new_bounds) OVERRIDE; |
147 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; | |
148 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 149 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; |
149 virtual bool ShouldDescendIntoChildForEventHandling( | 150 virtual bool ShouldDescendIntoChildForEventHandling( |
150 aura::Window* child, | 151 aura::Window* child, |
151 const gfx::Point& location) OVERRIDE; | 152 const gfx::Point& location) OVERRIDE; |
152 virtual bool CanFocus() OVERRIDE; | 153 virtual bool CanFocus() OVERRIDE; |
153 virtual void OnCaptureLost() OVERRIDE; | 154 virtual void OnCaptureLost() OVERRIDE; |
154 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 155 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
155 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 156 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
156 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 157 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
157 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 158 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
(...skipping 20 matching lines...) Expand all Loading... |
178 // Overridden from aura::client::FocusChangeObserver: | 179 // Overridden from aura::client::FocusChangeObserver: |
179 virtual void OnWindowFocused(aura::Window* gained_focus, | 180 virtual void OnWindowFocused(aura::Window* gained_focus, |
180 aura::Window* lost_focus) OVERRIDE; | 181 aura::Window* lost_focus) OVERRIDE; |
181 | 182 |
182 // Overridden from aura::client::DragDropDelegate: | 183 // Overridden from aura::client::DragDropDelegate: |
183 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 184 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
184 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 185 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
185 virtual void OnDragExited() OVERRIDE; | 186 virtual void OnDragExited() OVERRIDE; |
186 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 187 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
187 | 188 |
| 189 // Overridden from wm::CursorDelegate: |
| 190 virtual gfx::NativeCursor GetCursorForPoint(const gfx::Point& point) OVERRIDE; |
| 191 |
188 // Overridden from NativeWidget: | 192 // Overridden from NativeWidget: |
189 virtual ui::EventHandler* GetEventHandler() OVERRIDE; | 193 virtual ui::EventHandler* GetEventHandler() OVERRIDE; |
190 | 194 |
191 protected: | 195 protected: |
192 virtual ~NativeWidgetAura(); | 196 virtual ~NativeWidgetAura(); |
193 | 197 |
194 internal::NativeWidgetDelegate* delegate() { return delegate_; } | 198 internal::NativeWidgetDelegate* delegate() { return delegate_; } |
195 | 199 |
196 private: | 200 private: |
197 class ActiveWindowObserver; | 201 class ActiveWindowObserver; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 235 |
232 scoped_ptr<DropHelper> drop_helper_; | 236 scoped_ptr<DropHelper> drop_helper_; |
233 int last_drop_operation_; | 237 int last_drop_operation_; |
234 | 238 |
235 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura); | 239 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura); |
236 }; | 240 }; |
237 | 241 |
238 } // namespace views | 242 } // namespace views |
239 | 243 |
240 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ | 244 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ |
OLD | NEW |