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/activation_change_observer.h" | 9 #include "ui/aura/client/activation_change_observer.h" |
10 #include "ui/aura/client/activation_delegate.h" | 10 #include "ui/aura/client/activation_delegate.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class ShadowController; | 35 class ShadowController; |
36 class TooltipController; | 36 class TooltipController; |
37 class VisibilityController; | 37 class VisibilityController; |
38 class WindowModalityController; | 38 class WindowModalityController; |
39 } | 39 } |
40 | 40 |
41 class DesktopCaptureClient; | 41 class DesktopCaptureClient; |
42 class DesktopDispatcherClient; | 42 class DesktopDispatcherClient; |
43 class DesktopEventClient; | 43 class DesktopEventClient; |
44 class DesktopNativeCursorManager; | 44 class DesktopNativeCursorManager; |
45 class DesktopRootWindowHost; | 45 class DesktopWindowTreeHost; |
46 class DropHelper; | 46 class DropHelper; |
47 class FocusManagerEventHandler; | 47 class FocusManagerEventHandler; |
48 class TooltipManagerAura; | 48 class TooltipManagerAura; |
49 class WindowReorderer; | 49 class WindowReorderer; |
50 | 50 |
51 class VIEWS_EXPORT DesktopNativeWidgetAura | 51 class VIEWS_EXPORT DesktopNativeWidgetAura |
52 : public internal::NativeWidgetPrivate, | 52 : public internal::NativeWidgetPrivate, |
53 public aura::WindowDelegate, | 53 public aura::WindowDelegate, |
54 public aura::client::ActivationDelegate, | 54 public aura::client::ActivationDelegate, |
55 public aura::client::ActivationChangeObserver, | 55 public aura::client::ActivationChangeObserver, |
56 public aura::client::FocusChangeObserver, | 56 public aura::client::FocusChangeObserver, |
57 public views::internal::InputMethodDelegate, | 57 public views::internal::InputMethodDelegate, |
58 public aura::client::DragDropDelegate, | 58 public aura::client::DragDropDelegate, |
59 public aura::RootWindowObserver { | 59 public aura::RootWindowObserver { |
60 public: | 60 public: |
61 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); | 61 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); |
62 virtual ~DesktopNativeWidgetAura(); | 62 virtual ~DesktopNativeWidgetAura(); |
63 | 63 |
64 // Maps from window to DesktopNativeWidgetAura. | 64 // Maps from window to DesktopNativeWidgetAura. |
65 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); | 65 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); |
66 | 66 |
67 // Called by our DesktopRootWindowHost after it has deleted native resources; | 67 // Called by our DesktopWindowTreeHost after it has deleted native resources; |
68 // this is the signal that we should start our shutdown. | 68 // this is the signal that we should start our shutdown. |
69 virtual void OnHostClosed(); | 69 virtual void OnHostClosed(); |
70 | 70 |
71 // Called from ~DesktopRootWindowHost. This takes the RootWindow as by the | 71 // Called from ~DesktopWindowTreeHost. This takes the RootWindow as by the |
72 // time we get here |root_window_| is NULL. | 72 // time we get here |root_window_| is NULL. |
73 virtual void OnDesktopRootWindowHostDestroyed(aura::RootWindow* root); | 73 virtual void OnDesktopWindowTreeHostDestroyed(aura::RootWindow* root); |
74 | 74 |
75 corewm::InputMethodEventFilter* input_method_event_filter() { | 75 corewm::InputMethodEventFilter* input_method_event_filter() { |
76 return input_method_event_filter_.get(); | 76 return input_method_event_filter_.get(); |
77 } | 77 } |
78 corewm::CompoundEventFilter* root_window_event_filter() { | 78 corewm::CompoundEventFilter* root_window_event_filter() { |
79 return root_window_event_filter_; | 79 return root_window_event_filter_; |
80 } | 80 } |
81 aura::RootWindow* root_window() { | 81 aura::RootWindow* root_window() { |
82 return root_window_.get(); | 82 return root_window_.get(); |
83 } | 83 } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // Overridden from views::internal::InputMethodDelegate: | 215 // Overridden from views::internal::InputMethodDelegate: |
216 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; | 216 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; |
217 | 217 |
218 // Overridden from aura::client::DragDropDelegate: | 218 // Overridden from aura::client::DragDropDelegate: |
219 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 219 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
220 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 220 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
221 virtual void OnDragExited() OVERRIDE; | 221 virtual void OnDragExited() OVERRIDE; |
222 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 222 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
223 | 223 |
224 // Overridden from aura::RootWindowObserver: | 224 // Overridden from aura::RootWindowObserver: |
225 virtual void OnRootWindowHostCloseRequested( | 225 virtual void OnWindowTreeHostCloseRequested( |
226 const aura::RootWindow* root) OVERRIDE; | 226 const aura::RootWindow* root) OVERRIDE; |
227 virtual void OnRootWindowHostResized(const aura::RootWindow* root) OVERRIDE; | 227 virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE; |
228 virtual void OnRootWindowHostMoved(const aura::RootWindow* root, | 228 virtual void OnWindowTreeHostMoved(const aura::RootWindow* root, |
229 const gfx::Point& new_origin) OVERRIDE; | 229 const gfx::Point& new_origin) OVERRIDE; |
230 | 230 |
231 private: | 231 private: |
232 friend class FocusManagerEventHandler; | 232 friend class FocusManagerEventHandler; |
233 | 233 |
234 // Installs the input method filter. | 234 // Installs the input method filter. |
235 void InstallInputMethodEventFilter(); | 235 void InstallInputMethodEventFilter(); |
236 | 236 |
237 // To save a clear on platforms where the window is never transparent, the | 237 // To save a clear on platforms where the window is never transparent, the |
238 // window is only set as transparent when the glass frame is in use. | 238 // window is only set as transparent when the glass frame is in use. |
239 void UpdateWindowTransparency(); | 239 void UpdateWindowTransparency(); |
240 | 240 |
241 // See class documentation for Widget in widget.h for a note about ownership. | 241 // See class documentation for Widget in widget.h for a note about ownership. |
242 Widget::InitParams::Ownership ownership_; | 242 Widget::InitParams::Ownership ownership_; |
243 | 243 |
244 scoped_ptr<DesktopCaptureClient> capture_client_; | 244 scoped_ptr<DesktopCaptureClient> capture_client_; |
245 | 245 |
246 // The NativeWidget owns the RootWindow. Required because the RootWindow owns | 246 // The NativeWidget owns the RootWindow. Required because the RootWindow owns |
247 // its RootWindowHost, so DesktopRootWindowHost can't own it. | 247 // its WindowTreeHost, so DesktopWindowTreeHost can't own it. |
248 scoped_ptr<aura::RootWindow> root_window_; | 248 scoped_ptr<aura::RootWindow> root_window_; |
249 | 249 |
250 // The following factory is used for calls to close the NativeWidgetAura | 250 // The following factory is used for calls to close the NativeWidgetAura |
251 // instance. | 251 // instance. |
252 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; | 252 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; |
253 | 253 |
254 // Can we be made active? | 254 // Can we be made active? |
255 bool can_activate_; | 255 bool can_activate_; |
256 | 256 |
257 // Ownership passed to RootWindow on Init. | 257 // Ownership passed to RootWindow on Init. |
258 DesktopRootWindowHost* desktop_root_window_host_; | 258 DesktopWindowTreeHost* desktop_root_window_host_; |
259 | 259 |
260 // Child of the root, contains |content_window_|. | 260 // Child of the root, contains |content_window_|. |
261 aura::Window* content_window_container_; | 261 aura::Window* content_window_container_; |
262 | 262 |
263 // Child of |content_window_container_|. This is the return value from | 263 // Child of |content_window_container_|. This is the return value from |
264 // GetNativeView(). | 264 // GetNativeView(). |
265 // WARNING: this may be NULL, in particular during shutdown it becomes NULL. | 265 // WARNING: this may be NULL, in particular during shutdown it becomes NULL. |
266 aura::Window* content_window_; | 266 aura::Window* content_window_; |
267 | 267 |
268 internal::NativeWidgetDelegate* native_widget_delegate_; | 268 internal::NativeWidgetDelegate* native_widget_delegate_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 306 |
307 // See class documentation for Widget in widget.h for a note about type. | 307 // See class documentation for Widget in widget.h for a note about type. |
308 Widget::InitParams::Type widget_type_; | 308 Widget::InitParams::Type widget_type_; |
309 | 309 |
310 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); | 310 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); |
311 }; | 311 }; |
312 | 312 |
313 } // namespace views | 313 } // namespace views |
314 | 314 |
315 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 315 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
OLD | NEW |