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