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