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" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 aura::WindowTreeHost* host() { | 88 aura::WindowTreeHost* host() { |
89 return host_.get(); | 89 return host_.get(); |
90 } | 90 } |
91 | 91 |
92 // Ensures that the correct window is activated/deactivated based on whether | 92 // Ensures that the correct window is activated/deactivated based on whether |
93 // we are being activated/deactivated. | 93 // we are being activated/deactivated. |
94 void HandleActivationChanged(bool active); | 94 void HandleActivationChanged(bool active); |
95 | 95 |
96 protected: | 96 protected: |
97 // Overridden from internal::NativeWidgetPrivate: | 97 // Overridden from internal::NativeWidgetPrivate: |
98 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; | 98 virtual void InitNativeWidget(const Widget::InitParams& params) override; |
99 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 99 virtual NonClientFrameView* CreateNonClientFrameView() override; |
100 virtual bool ShouldUseNativeFrame() const OVERRIDE; | 100 virtual bool ShouldUseNativeFrame() const override; |
101 virtual bool ShouldWindowContentsBeTransparent() const OVERRIDE; | 101 virtual bool ShouldWindowContentsBeTransparent() const override; |
102 virtual void FrameTypeChanged() OVERRIDE; | 102 virtual void FrameTypeChanged() override; |
103 virtual Widget* GetWidget() OVERRIDE; | 103 virtual Widget* GetWidget() override; |
104 virtual const Widget* GetWidget() const OVERRIDE; | 104 virtual const Widget* GetWidget() const override; |
105 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 105 virtual gfx::NativeView GetNativeView() const override; |
106 virtual gfx::NativeWindow GetNativeWindow() const OVERRIDE; | 106 virtual gfx::NativeWindow GetNativeWindow() const override; |
107 virtual Widget* GetTopLevelWidget() OVERRIDE; | 107 virtual Widget* GetTopLevelWidget() override; |
108 virtual const ui::Compositor* GetCompositor() const OVERRIDE; | 108 virtual const ui::Compositor* GetCompositor() const override; |
109 virtual ui::Compositor* GetCompositor() OVERRIDE; | 109 virtual ui::Compositor* GetCompositor() override; |
110 virtual ui::Layer* GetLayer() OVERRIDE; | 110 virtual ui::Layer* GetLayer() override; |
111 virtual void ReorderNativeViews() OVERRIDE; | 111 virtual void ReorderNativeViews() override; |
112 virtual void ViewRemoved(View* view) OVERRIDE; | 112 virtual void ViewRemoved(View* view) override; |
113 virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; | 113 virtual void SetNativeWindowProperty(const char* name, void* value) override; |
114 virtual void* GetNativeWindowProperty(const char* name) const OVERRIDE; | 114 virtual void* GetNativeWindowProperty(const char* name) const override; |
115 virtual TooltipManager* GetTooltipManager() const OVERRIDE; | 115 virtual TooltipManager* GetTooltipManager() const override; |
116 virtual void SetCapture() OVERRIDE; | 116 virtual void SetCapture() override; |
117 virtual void ReleaseCapture() OVERRIDE; | 117 virtual void ReleaseCapture() override; |
118 virtual bool HasCapture() const OVERRIDE; | 118 virtual bool HasCapture() const override; |
119 virtual InputMethod* CreateInputMethod() OVERRIDE; | 119 virtual InputMethod* CreateInputMethod() override; |
120 virtual internal::InputMethodDelegate* GetInputMethodDelegate() OVERRIDE; | 120 virtual internal::InputMethodDelegate* GetInputMethodDelegate() override; |
121 virtual ui::InputMethod* GetHostInputMethod() OVERRIDE; | 121 virtual ui::InputMethod* GetHostInputMethod() override; |
122 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 122 virtual void CenterWindow(const gfx::Size& size) override; |
123 virtual void GetWindowPlacement( | 123 virtual void GetWindowPlacement( |
124 gfx::Rect* bounds, | 124 gfx::Rect* bounds, |
125 ui::WindowShowState* maximized) const OVERRIDE; | 125 ui::WindowShowState* maximized) const override; |
126 virtual bool SetWindowTitle(const base::string16& title) OVERRIDE; | 126 virtual bool SetWindowTitle(const base::string16& title) override; |
127 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, | 127 virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, |
128 const gfx::ImageSkia& app_icon) OVERRIDE; | 128 const gfx::ImageSkia& app_icon) override; |
129 virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; | 129 virtual void InitModalType(ui::ModalType modal_type) override; |
130 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; | 130 virtual gfx::Rect GetWindowBoundsInScreen() const override; |
131 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; | 131 virtual gfx::Rect GetClientAreaBoundsInScreen() const override; |
132 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 132 virtual gfx::Rect GetRestoredBounds() const override; |
133 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 133 virtual void SetBounds(const gfx::Rect& bounds) override; |
134 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 134 virtual void SetSize(const gfx::Size& size) override; |
135 virtual void StackAbove(gfx::NativeView native_view) OVERRIDE; | 135 virtual void StackAbove(gfx::NativeView native_view) override; |
136 virtual void StackAtTop() OVERRIDE; | 136 virtual void StackAtTop() override; |
137 virtual void StackBelow(gfx::NativeView native_view) OVERRIDE; | 137 virtual void StackBelow(gfx::NativeView native_view) override; |
138 virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; | 138 virtual void SetShape(gfx::NativeRegion shape) override; |
139 virtual void Close() OVERRIDE; | 139 virtual void Close() override; |
140 virtual void CloseNow() OVERRIDE; | 140 virtual void CloseNow() override; |
141 virtual void Show() OVERRIDE; | 141 virtual void Show() override; |
142 virtual void Hide() OVERRIDE; | 142 virtual void Hide() override; |
143 virtual void ShowMaximizedWithBounds( | 143 virtual void ShowMaximizedWithBounds( |
144 const gfx::Rect& restored_bounds) OVERRIDE; | 144 const gfx::Rect& restored_bounds) override; |
145 virtual void ShowWithWindowState(ui::WindowShowState state) OVERRIDE; | 145 virtual void ShowWithWindowState(ui::WindowShowState state) override; |
146 virtual bool IsVisible() const OVERRIDE; | 146 virtual bool IsVisible() const override; |
147 virtual void Activate() OVERRIDE; | 147 virtual void Activate() override; |
148 virtual void Deactivate() OVERRIDE; | 148 virtual void Deactivate() override; |
149 virtual bool IsActive() const OVERRIDE; | 149 virtual bool IsActive() const override; |
150 virtual void SetAlwaysOnTop(bool always_on_top) OVERRIDE; | 150 virtual void SetAlwaysOnTop(bool always_on_top) override; |
151 virtual bool IsAlwaysOnTop() const OVERRIDE; | 151 virtual bool IsAlwaysOnTop() const override; |
152 virtual void SetVisibleOnAllWorkspaces(bool always_visible) OVERRIDE; | 152 virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; |
153 virtual void Maximize() OVERRIDE; | 153 virtual void Maximize() override; |
154 virtual void Minimize() OVERRIDE; | 154 virtual void Minimize() override; |
155 virtual bool IsMaximized() const OVERRIDE; | 155 virtual bool IsMaximized() const override; |
156 virtual bool IsMinimized() const OVERRIDE; | 156 virtual bool IsMinimized() const override; |
157 virtual void Restore() OVERRIDE; | 157 virtual void Restore() override; |
158 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 158 virtual void SetFullscreen(bool fullscreen) override; |
159 virtual bool IsFullscreen() const OVERRIDE; | 159 virtual bool IsFullscreen() const override; |
160 virtual void SetOpacity(unsigned char opacity) OVERRIDE; | 160 virtual void SetOpacity(unsigned char opacity) override; |
161 virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE; | 161 virtual void SetUseDragFrame(bool use_drag_frame) override; |
162 virtual void FlashFrame(bool flash_frame) OVERRIDE; | 162 virtual void FlashFrame(bool flash_frame) override; |
163 virtual void RunShellDrag(View* view, | 163 virtual void RunShellDrag(View* view, |
164 const ui::OSExchangeData& data, | 164 const ui::OSExchangeData& data, |
165 const gfx::Point& location, | 165 const gfx::Point& location, |
166 int operation, | 166 int operation, |
167 ui::DragDropTypes::DragEventSource source) OVERRIDE; | 167 ui::DragDropTypes::DragEventSource source) override; |
168 virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; | 168 virtual void SchedulePaintInRect(const gfx::Rect& rect) override; |
169 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 169 virtual void SetCursor(gfx::NativeCursor cursor) override; |
170 virtual bool IsMouseEventsEnabled() const OVERRIDE; | 170 virtual bool IsMouseEventsEnabled() const override; |
171 virtual void ClearNativeFocus() OVERRIDE; | 171 virtual void ClearNativeFocus() override; |
172 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; | 172 virtual gfx::Rect GetWorkAreaBoundsInScreen() const override; |
173 virtual Widget::MoveLoopResult RunMoveLoop( | 173 virtual Widget::MoveLoopResult RunMoveLoop( |
174 const gfx::Vector2d& drag_offset, | 174 const gfx::Vector2d& drag_offset, |
175 Widget::MoveLoopSource source, | 175 Widget::MoveLoopSource source, |
176 Widget::MoveLoopEscapeBehavior escape_behavior) OVERRIDE; | 176 Widget::MoveLoopEscapeBehavior escape_behavior) override; |
177 virtual void EndMoveLoop() OVERRIDE; | 177 virtual void EndMoveLoop() override; |
178 virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; | 178 virtual void SetVisibilityChangedAnimationsEnabled(bool value) override; |
179 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; | 179 virtual ui::NativeTheme* GetNativeTheme() const override; |
180 virtual void OnRootViewLayout() OVERRIDE; | 180 virtual void OnRootViewLayout() override; |
181 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; | 181 virtual bool IsTranslucentWindowOpacitySupported() const override; |
182 virtual void OnSizeConstraintsChanged() OVERRIDE; | 182 virtual void OnSizeConstraintsChanged() override; |
183 virtual void RepostNativeEvent(gfx::NativeEvent native_event) OVERRIDE; | 183 virtual void RepostNativeEvent(gfx::NativeEvent native_event) override; |
184 | 184 |
185 // Overridden from aura::WindowDelegate: | 185 // Overridden from aura::WindowDelegate: |
186 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 186 virtual gfx::Size GetMinimumSize() const override; |
187 virtual gfx::Size GetMaximumSize() const OVERRIDE; | 187 virtual gfx::Size GetMaximumSize() const override; |
188 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 188 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
189 const gfx::Rect& new_bounds) OVERRIDE {} | 189 const gfx::Rect& new_bounds) override {} |
190 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; | 190 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override; |
191 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 191 virtual int GetNonClientComponent(const gfx::Point& point) const override; |
192 virtual bool ShouldDescendIntoChildForEventHandling( | 192 virtual bool ShouldDescendIntoChildForEventHandling( |
193 aura::Window* child, | 193 aura::Window* child, |
194 const gfx::Point& location) OVERRIDE; | 194 const gfx::Point& location) override; |
195 virtual bool CanFocus() OVERRIDE; | 195 virtual bool CanFocus() override; |
196 virtual void OnCaptureLost() OVERRIDE; | 196 virtual void OnCaptureLost() override; |
197 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 197 virtual void OnPaint(gfx::Canvas* canvas) override; |
198 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 198 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
199 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 199 virtual void OnWindowDestroying(aura::Window* window) override; |
200 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 200 virtual void OnWindowDestroyed(aura::Window* window) override; |
201 virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE; | 201 virtual void OnWindowTargetVisibilityChanged(bool visible) override; |
202 virtual bool HasHitTestMask() const OVERRIDE; | 202 virtual bool HasHitTestMask() const override; |
203 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; | 203 virtual void GetHitTestMask(gfx::Path* mask) const override; |
204 | 204 |
205 // Overridden from ui::EventHandler: | 205 // Overridden from ui::EventHandler: |
206 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | 206 virtual void OnKeyEvent(ui::KeyEvent* event) override; |
207 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 207 virtual void OnMouseEvent(ui::MouseEvent* event) override; |
208 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | 208 virtual void OnScrollEvent(ui::ScrollEvent* event) override; |
209 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 209 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
210 | 210 |
211 // Overridden from aura::client::ActivationDelegate: | 211 // Overridden from aura::client::ActivationDelegate: |
212 virtual bool ShouldActivate() const OVERRIDE; | 212 virtual bool ShouldActivate() const override; |
213 | 213 |
214 // Overridden from aura::client::ActivationChangeObserver: | 214 // Overridden from aura::client::ActivationChangeObserver: |
215 virtual void OnWindowActivated(aura::Window* gained_active, | 215 virtual void OnWindowActivated(aura::Window* gained_active, |
216 aura::Window* lost_active) OVERRIDE; | 216 aura::Window* lost_active) override; |
217 | 217 |
218 // Overridden from aura::client::FocusChangeObserver: | 218 // Overridden from aura::client::FocusChangeObserver: |
219 virtual void OnWindowFocused(aura::Window* gained_focus, | 219 virtual void OnWindowFocused(aura::Window* gained_focus, |
220 aura::Window* lost_focus) OVERRIDE; | 220 aura::Window* lost_focus) override; |
221 | 221 |
222 // Overridden from views::internal::InputMethodDelegate: | 222 // Overridden from views::internal::InputMethodDelegate: |
223 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; | 223 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) override; |
224 | 224 |
225 // Overridden from aura::client::DragDropDelegate: | 225 // Overridden from aura::client::DragDropDelegate: |
226 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 226 virtual void OnDragEntered(const ui::DropTargetEvent& event) override; |
227 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 227 virtual int OnDragUpdated(const ui::DropTargetEvent& event) override; |
228 virtual void OnDragExited() OVERRIDE; | 228 virtual void OnDragExited() override; |
229 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 229 virtual int OnPerformDrop(const ui::DropTargetEvent& event) override; |
230 | 230 |
231 // Overridden from aura::WindowTreeHostObserver: | 231 // Overridden from aura::WindowTreeHostObserver: |
232 virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) OVERRIDE; | 232 virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
233 virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE; | 233 virtual void OnHostResized(const aura::WindowTreeHost* host) override; |
234 virtual void OnHostMoved(const aura::WindowTreeHost* host, | 234 virtual void OnHostMoved(const aura::WindowTreeHost* host, |
235 const gfx::Point& new_origin) OVERRIDE; | 235 const gfx::Point& new_origin) override; |
236 | 236 |
237 private: | 237 private: |
238 friend class FocusManagerEventHandler; | 238 friend class FocusManagerEventHandler; |
239 friend class RootWindowDestructionObserver; | 239 friend class RootWindowDestructionObserver; |
240 | 240 |
241 // Installs the input method filter. | 241 // Installs the input method filter. |
242 void InstallInputMethodEventFilter(); | 242 void InstallInputMethodEventFilter(); |
243 | 243 |
244 // To save a clear on platforms where the window is never transparent, the | 244 // To save a clear on platforms where the window is never transparent, the |
245 // window is only set as transparent when the glass frame is in use. | 245 // window is only set as transparent when the glass frame is in use. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // The following factory is used for calls to close the NativeWidgetAura | 314 // The following factory is used for calls to close the NativeWidgetAura |
315 // instance. | 315 // instance. |
316 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; | 316 base::WeakPtrFactory<DesktopNativeWidgetAura> close_widget_factory_; |
317 | 317 |
318 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); | 318 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); |
319 }; | 319 }; |
320 | 320 |
321 } // namespace views | 321 } // namespace views |
322 | 322 |
323 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 323 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |
OLD | NEW |