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" | |
14 #include "ui/views/widget/native_widget_private.h" | 13 #include "ui/views/widget/native_widget_private.h" |
15 #include "ui/wm/core/compound_event_filter.h" | 14 #include "ui/wm/core/compound_event_filter.h" |
16 #include "ui/wm/public/activation_change_observer.h" | 15 #include "ui/wm/public/activation_change_observer.h" |
17 #include "ui/wm/public/activation_delegate.h" | 16 #include "ui/wm/public/activation_delegate.h" |
18 #include "ui/wm/public/drag_drop_delegate.h" | 17 #include "ui/wm/public/drag_drop_delegate.h" |
19 | 18 |
20 namespace aura { | 19 namespace aura { |
21 class WindowEventDispatcher; | 20 class WindowEventDispatcher; |
22 class WindowTreeHost; | 21 class WindowTreeHost; |
23 namespace client { | 22 namespace client { |
24 class DragDropClient; | 23 class DragDropClient; |
25 class FocusClient; | 24 class FocusClient; |
26 class ScreenPositionClient; | 25 class ScreenPositionClient; |
27 class WindowTreeClient; | 26 class WindowTreeClient; |
28 } | 27 } |
29 } | 28 } |
30 | 29 |
31 namespace wm { | 30 namespace wm { |
32 class CompoundEventFilter; | 31 class CompoundEventFilter; |
33 class CursorManager; | 32 class CursorManager; |
34 class FocusController; | 33 class FocusController; |
35 class InputMethodEventFilter; | |
36 class ShadowController; | 34 class ShadowController; |
37 class VisibilityController; | 35 class VisibilityController; |
38 class WindowModalityController; | 36 class WindowModalityController; |
39 } | 37 } |
40 | 38 |
41 namespace views { | 39 namespace views { |
42 namespace corewm { | 40 namespace corewm { |
43 class TooltipController; | 41 class TooltipController; |
44 } | 42 } |
45 class DesktopCaptureClient; | 43 class DesktopCaptureClient; |
46 class DesktopDispatcherClient; | 44 class DesktopDispatcherClient; |
47 class DesktopEventClient; | 45 class DesktopEventClient; |
48 class DesktopNativeCursorManager; | 46 class DesktopNativeCursorManager; |
49 class DesktopWindowTreeHost; | 47 class DesktopWindowTreeHost; |
50 class DropHelper; | 48 class DropHelper; |
51 class FocusManagerEventHandler; | 49 class FocusManagerEventHandler; |
52 class TooltipManagerAura; | 50 class TooltipManagerAura; |
53 class WindowReorderer; | 51 class WindowReorderer; |
54 | 52 |
55 class VIEWS_EXPORT DesktopNativeWidgetAura | 53 class VIEWS_EXPORT DesktopNativeWidgetAura |
56 : public internal::NativeWidgetPrivate, | 54 : public internal::NativeWidgetPrivate, |
57 public aura::WindowDelegate, | 55 public aura::WindowDelegate, |
58 public aura::client::ActivationDelegate, | 56 public aura::client::ActivationDelegate, |
59 public aura::client::ActivationChangeObserver, | 57 public aura::client::ActivationChangeObserver, |
60 public aura::client::FocusChangeObserver, | 58 public aura::client::FocusChangeObserver, |
61 public views::internal::InputMethodDelegate, | |
62 public aura::client::DragDropDelegate, | 59 public aura::client::DragDropDelegate, |
63 public aura::WindowTreeHostObserver { | 60 public aura::WindowTreeHostObserver { |
64 public: | 61 public: |
65 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); | 62 explicit DesktopNativeWidgetAura(internal::NativeWidgetDelegate* delegate); |
66 ~DesktopNativeWidgetAura() override; | 63 ~DesktopNativeWidgetAura() override; |
67 | 64 |
68 // Maps from window to DesktopNativeWidgetAura. |window| must be a root | 65 // Maps from window to DesktopNativeWidgetAura. |window| must be a root |
69 // window. | 66 // window. |
70 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); | 67 static DesktopNativeWidgetAura* ForWindow(aura::Window* window); |
71 | 68 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const ui::Compositor* GetCompositor() const override; | 102 const ui::Compositor* GetCompositor() const override; |
106 const ui::Layer* GetLayer() const override; | 103 const ui::Layer* GetLayer() const override; |
107 void ReorderNativeViews() override; | 104 void ReorderNativeViews() override; |
108 void ViewRemoved(View* view) override; | 105 void ViewRemoved(View* view) override; |
109 void SetNativeWindowProperty(const char* name, void* value) override; | 106 void SetNativeWindowProperty(const char* name, void* value) override; |
110 void* GetNativeWindowProperty(const char* name) const override; | 107 void* GetNativeWindowProperty(const char* name) const override; |
111 TooltipManager* GetTooltipManager() const override; | 108 TooltipManager* GetTooltipManager() const override; |
112 void SetCapture() override; | 109 void SetCapture() override; |
113 void ReleaseCapture() override; | 110 void ReleaseCapture() override; |
114 bool HasCapture() const override; | 111 bool HasCapture() const override; |
115 InputMethod* CreateInputMethod() override; | 112 ui::InputMethod* GetInputMethod() override; |
116 internal::InputMethodDelegate* GetInputMethodDelegate() override; | |
117 ui::InputMethod* GetHostInputMethod() override; | |
118 void CenterWindow(const gfx::Size& size) override; | 113 void CenterWindow(const gfx::Size& size) override; |
119 void GetWindowPlacement(gfx::Rect* bounds, | 114 void GetWindowPlacement(gfx::Rect* bounds, |
120 ui::WindowShowState* maximized) const override; | 115 ui::WindowShowState* maximized) const override; |
121 bool SetWindowTitle(const base::string16& title) override; | 116 bool SetWindowTitle(const base::string16& title) override; |
122 void SetWindowIcons(const gfx::ImageSkia& window_icon, | 117 void SetWindowIcons(const gfx::ImageSkia& window_icon, |
123 const gfx::ImageSkia& app_icon) override; | 118 const gfx::ImageSkia& app_icon) override; |
124 void InitModalType(ui::ModalType modal_type) override; | 119 void InitModalType(ui::ModalType modal_type) override; |
125 gfx::Rect GetWindowBoundsInScreen() const override; | 120 gfx::Rect GetWindowBoundsInScreen() const override; |
126 gfx::Rect GetClientAreaBoundsInScreen() const override; | 121 gfx::Rect GetClientAreaBoundsInScreen() const override; |
127 gfx::Rect GetRestoredBounds() const override; | 122 gfx::Rect GetRestoredBounds() const override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 void OnRootViewLayout() override; | 172 void OnRootViewLayout() override; |
178 bool IsTranslucentWindowOpacitySupported() const override; | 173 bool IsTranslucentWindowOpacitySupported() const override; |
179 void OnSizeConstraintsChanged() override; | 174 void OnSizeConstraintsChanged() override; |
180 void RepostNativeEvent(gfx::NativeEvent native_event) override; | 175 void RepostNativeEvent(gfx::NativeEvent native_event) override; |
181 | 176 |
182 // Overridden from aura::WindowDelegate: | 177 // Overridden from aura::WindowDelegate: |
183 gfx::Size GetMinimumSize() const override; | 178 gfx::Size GetMinimumSize() const override; |
184 gfx::Size GetMaximumSize() const override; | 179 gfx::Size GetMaximumSize() const override; |
185 void OnBoundsChanged(const gfx::Rect& old_bounds, | 180 void OnBoundsChanged(const gfx::Rect& old_bounds, |
186 const gfx::Rect& new_bounds) override {} | 181 const gfx::Rect& new_bounds) override {} |
187 ui::TextInputClient* GetFocusedTextInputClient() override; | |
188 gfx::NativeCursor GetCursor(const gfx::Point& point) override; | 182 gfx::NativeCursor GetCursor(const gfx::Point& point) override; |
189 int GetNonClientComponent(const gfx::Point& point) const override; | 183 int GetNonClientComponent(const gfx::Point& point) const override; |
190 bool ShouldDescendIntoChildForEventHandling( | 184 bool ShouldDescendIntoChildForEventHandling( |
191 aura::Window* child, | 185 aura::Window* child, |
192 const gfx::Point& location) override; | 186 const gfx::Point& location) override; |
193 bool CanFocus() override; | 187 bool CanFocus() override; |
194 void OnCaptureLost() override; | 188 void OnCaptureLost() override; |
195 void OnPaint(const ui::PaintContext& context) override; | 189 void OnPaint(const ui::PaintContext& context) override; |
196 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | 190 void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
197 void OnWindowDestroying(aura::Window* window) override; | 191 void OnWindowDestroying(aura::Window* window) override; |
(...skipping 14 matching lines...) Expand all Loading... |
212 // Overridden from aura::client::ActivationChangeObserver: | 206 // Overridden from aura::client::ActivationChangeObserver: |
213 void OnWindowActivated( | 207 void OnWindowActivated( |
214 aura::client::ActivationChangeObserver::ActivationReason reason, | 208 aura::client::ActivationChangeObserver::ActivationReason reason, |
215 aura::Window* gained_active, | 209 aura::Window* gained_active, |
216 aura::Window* lost_active) override; | 210 aura::Window* lost_active) override; |
217 | 211 |
218 // Overridden from aura::client::FocusChangeObserver: | 212 // Overridden from aura::client::FocusChangeObserver: |
219 void OnWindowFocused(aura::Window* gained_focus, | 213 void OnWindowFocused(aura::Window* gained_focus, |
220 aura::Window* lost_focus) override; | 214 aura::Window* lost_focus) override; |
221 | 215 |
222 // Overridden from views::internal::InputMethodDelegate: | |
223 void DispatchKeyEventPostIME(const ui::KeyEvent& key) override; | |
224 | |
225 // Overridden from aura::client::DragDropDelegate: | 216 // Overridden from aura::client::DragDropDelegate: |
226 void OnDragEntered(const ui::DropTargetEvent& event) override; | 217 void OnDragEntered(const ui::DropTargetEvent& event) override; |
227 int OnDragUpdated(const ui::DropTargetEvent& event) override; | 218 int OnDragUpdated(const ui::DropTargetEvent& event) override; |
228 void OnDragExited() override; | 219 void OnDragExited() override; |
229 int OnPerformDrop(const ui::DropTargetEvent& event) override; | 220 int OnPerformDrop(const ui::DropTargetEvent& event) override; |
230 | 221 |
231 // Overridden from aura::WindowTreeHostObserver: | 222 // Overridden from aura::WindowTreeHostObserver: |
232 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; | 223 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
233 void OnHostResized(const aura::WindowTreeHost* host) override; | 224 void OnHostResized(const aura::WindowTreeHost* host) override; |
234 void OnHostMoved(const aura::WindowTreeHost* host, | 225 void OnHostMoved(const aura::WindowTreeHost* host, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // The following factory is used for calls to close the NativeWidgetAura | 300 // The following factory is used for calls to close the NativeWidgetAura |
310 // instance. | 301 // instance. |
311 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; | 302 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; |
312 | 303 |
313 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); | 304 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); |
314 }; | 305 }; |
315 | 306 |
316 } // namespace views | 307 } // namespace views |
317 | 308 |
318 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 309 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
OLD | NEW |