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_WIDGET_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ |
6 #define UI_VIEWS_WIDGET_WIDGET_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <stack> | 10 #include <stack> |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 // Whether the widget should be maximized or minimized. | 242 // Whether the widget should be maximized or minimized. |
243 ui::WindowShowState show_state; | 243 ui::WindowShowState show_state; |
244 gfx::NativeView parent; | 244 gfx::NativeView parent; |
245 // Used only by mus and is necessitated by mus not being a NativeView. | 245 // Used only by mus and is necessitated by mus not being a NativeView. |
246 mus::Window* parent_mus = nullptr; | 246 mus::Window* parent_mus = nullptr; |
247 // Specifies the initial bounds of the Widget. Default is empty, which means | 247 // Specifies the initial bounds of the Widget. Default is empty, which means |
248 // the NativeWidget may specify a default size. If the parent is specified, | 248 // the NativeWidget may specify a default size. If the parent is specified, |
249 // |bounds| is in the parent's coordinate system. If the parent is not | 249 // |bounds| is in the parent's coordinate system. If the parent is not |
250 // specified, it's in screen's global coordinate system. | 250 // specified, it's in screen's global coordinate system. |
251 gfx::Rect bounds; | 251 gfx::Rect bounds; |
252 // The initial workspace of the Widget. Default is -1, which means the | |
253 // current workspace. | |
254 int workspace; | |
252 // When set, this value is used as the Widget's NativeWidget implementation. | 255 // When set, this value is used as the Widget's NativeWidget implementation. |
253 // The Widget will not construct a default one. Default is NULL. | 256 // The Widget will not construct a default one. Default is NULL. |
254 NativeWidget* native_widget; | 257 NativeWidget* native_widget; |
255 // Aura-only. Provides a DesktopWindowTreeHost implementation to use instead | 258 // Aura-only. Provides a DesktopWindowTreeHost implementation to use instead |
256 // of the default one. | 259 // of the default one. |
257 // TODO(beng): Figure out if there's a better way to expose this, e.g. get | 260 // TODO(beng): Figure out if there's a better way to expose this, e.g. get |
258 // rid of NW subclasses and do this all via message handling. | 261 // rid of NW subclasses and do this all via message handling. |
259 DesktopWindowTreeHost* desktop_window_tree_host; | 262 DesktopWindowTreeHost* desktop_window_tree_host; |
260 // Only used by NativeWidgetAura. Specifies the type of layer for the | 263 // Only used by NativeWidgetAura. Specifies the type of layer for the |
261 // aura::Window. Default is ui::LAYER_TEXTURED. | 264 // aura::Window. Default is ui::LAYER_TEXTURED. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 | 420 |
418 // Returns the bounds of the Widget in screen coordinates. | 421 // Returns the bounds of the Widget in screen coordinates. |
419 gfx::Rect GetWindowBoundsInScreen() const; | 422 gfx::Rect GetWindowBoundsInScreen() const; |
420 | 423 |
421 // Returns the bounds of the Widget's client area in screen coordinates. | 424 // Returns the bounds of the Widget's client area in screen coordinates. |
422 gfx::Rect GetClientAreaBoundsInScreen() const; | 425 gfx::Rect GetClientAreaBoundsInScreen() const; |
423 | 426 |
424 // Retrieves the restored bounds for the window. | 427 // Retrieves the restored bounds for the window. |
425 gfx::Rect GetRestoredBounds() const; | 428 gfx::Rect GetRestoredBounds() const; |
426 | 429 |
430 // Retrieves the restored workspace for the window. | |
431 int GetRestoredWorkspace() const; | |
sky
2016/05/02 15:11:23
This is the workspace the window is on, right? How
Tom (Use chromium acct)
2016/05/02 20:32:38
yes & done
| |
432 | |
427 // Sizes and/or places the widget to the specified bounds, size or position. | 433 // Sizes and/or places the widget to the specified bounds, size or position. |
428 void SetBounds(const gfx::Rect& bounds); | 434 void SetBounds(const gfx::Rect& bounds); |
429 void SetSize(const gfx::Size& size); | 435 void SetSize(const gfx::Size& size); |
430 | 436 |
431 // Sizes the window to the specified size and centerizes it. | 437 // Sizes the window to the specified size and centerizes it. |
432 void CenterWindow(const gfx::Size& size); | 438 void CenterWindow(const gfx::Size& size); |
433 | 439 |
434 // Like SetBounds(), but ensures the Widget is fully visible on screen, | 440 // Like SetBounds(), but ensures the Widget is fully visible on screen, |
435 // resizing and/or repositioning as necessary. This is only useful for | 441 // resizing and/or repositioning as necessary. This is only useful for |
436 // non-child widgets. | 442 // non-child widgets. |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
780 void OnNativeBlur() override; | 786 void OnNativeBlur() override; |
781 void OnNativeWidgetVisibilityChanging(bool visible) override; | 787 void OnNativeWidgetVisibilityChanging(bool visible) override; |
782 void OnNativeWidgetVisibilityChanged(bool visible) override; | 788 void OnNativeWidgetVisibilityChanged(bool visible) override; |
783 void OnNativeWidgetCreated(bool desktop_widget) override; | 789 void OnNativeWidgetCreated(bool desktop_widget) override; |
784 void OnNativeWidgetDestroying() override; | 790 void OnNativeWidgetDestroying() override; |
785 void OnNativeWidgetDestroyed() override; | 791 void OnNativeWidgetDestroyed() override; |
786 gfx::Size GetMinimumSize() const override; | 792 gfx::Size GetMinimumSize() const override; |
787 gfx::Size GetMaximumSize() const override; | 793 gfx::Size GetMaximumSize() const override; |
788 void OnNativeWidgetMove() override; | 794 void OnNativeWidgetMove() override; |
789 void OnNativeWidgetSizeChanged(const gfx::Size& new_size) override; | 795 void OnNativeWidgetSizeChanged(const gfx::Size& new_size) override; |
796 void OnNativeWidgetWorkspaceChanged(int workspace_id) override; | |
790 void OnNativeWidgetWindowShowStateChanged() override; | 797 void OnNativeWidgetWindowShowStateChanged() override; |
791 void OnNativeWidgetBeginUserBoundsChange() override; | 798 void OnNativeWidgetBeginUserBoundsChange() override; |
792 void OnNativeWidgetEndUserBoundsChange() override; | 799 void OnNativeWidgetEndUserBoundsChange() override; |
793 bool HasFocusManager() const override; | 800 bool HasFocusManager() const override; |
794 void OnNativeWidgetPaint(const ui::PaintContext& context) override; | 801 void OnNativeWidgetPaint(const ui::PaintContext& context) override; |
795 int GetNonClientComponent(const gfx::Point& point) override; | 802 int GetNonClientComponent(const gfx::Point& point) override; |
796 void OnKeyEvent(ui::KeyEvent* event) override; | 803 void OnKeyEvent(ui::KeyEvent* event) override; |
797 void OnMouseEvent(ui::MouseEvent* event) override; | 804 void OnMouseEvent(ui::MouseEvent* event) override; |
798 void OnMouseCaptureLost() override; | 805 void OnMouseCaptureLost() override; |
799 void OnScrollEvent(ui::ScrollEvent* event) override; | 806 void OnScrollEvent(ui::ScrollEvent* event) override; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
961 bool movement_disabled_; | 968 bool movement_disabled_; |
962 | 969 |
963 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 970 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
964 | 971 |
965 DISALLOW_COPY_AND_ASSIGN(Widget); | 972 DISALLOW_COPY_AND_ASSIGN(Widget); |
966 }; | 973 }; |
967 | 974 |
968 } // namespace views | 975 } // namespace views |
969 | 976 |
970 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 977 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |