OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_H_ |
6 #define VIEWS_WIDGET_WIDGET_H_ | 6 #define VIEWS_WIDGET_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 WidgetDelegate* delegate; | 127 WidgetDelegate* delegate; |
128 bool child; | 128 bool child; |
129 bool transient; | 129 bool transient; |
130 bool transparent; | 130 bool transparent; |
131 bool accept_events; | 131 bool accept_events; |
132 bool can_activate; | 132 bool can_activate; |
133 bool keep_on_top; | 133 bool keep_on_top; |
134 Ownership ownership; | 134 Ownership ownership; |
135 bool mirror_origin_in_rtl; | 135 bool mirror_origin_in_rtl; |
136 bool has_dropshadow; | 136 bool has_dropshadow; |
| 137 // This is set internally by Widget from the delegate. |
| 138 bool maximize; |
137 // Should the widget be double buffered? Default is false. | 139 // Should the widget be double buffered? Default is false. |
138 bool double_buffer; | 140 bool double_buffer; |
139 gfx::NativeView parent; | 141 gfx::NativeView parent; |
140 Widget* parent_widget; | 142 Widget* parent_widget; |
141 // Specifies the initial bounds of the Widget. Default is empty, which means | 143 // Specifies the initial bounds of the Widget. Default is empty, which means |
142 // the NativeWidget may specify a default size. | 144 // the NativeWidget may specify a default size. |
143 gfx::Rect bounds; | 145 gfx::Rect bounds; |
144 // When set, this value is used as the Widget's NativeWidget implementation. | 146 // When set, this value is used as the Widget's NativeWidget implementation. |
145 // The Widget will not construct a default one. Default is NULL. | 147 // The Widget will not construct a default one. Default is NULL. |
146 NativeWidget* native_widget; | 148 NativeWidget* native_widget; |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 // Returns whether capture should be released on mouse release. | 586 // Returns whether capture should be released on mouse release. |
585 virtual bool ShouldReleaseCaptureOnMouseReleased() const; | 587 virtual bool ShouldReleaseCaptureOnMouseReleased() const; |
586 | 588 |
587 // Persists the window's restored position and maximized state using the | 589 // Persists the window's restored position and maximized state using the |
588 // window delegate. | 590 // window delegate. |
589 void SaveWindowPosition(); | 591 void SaveWindowPosition(); |
590 | 592 |
591 // Sizes and positions the window just after it is created. | 593 // Sizes and positions the window just after it is created. |
592 void SetInitialBounds(const gfx::Rect& bounds); | 594 void SetInitialBounds(const gfx::Rect& bounds); |
593 | 595 |
| 596 // Returns the bounds and maximized state from the delegate. Returns true if |
| 597 // the delegate wants to use a specified bounds. |
| 598 bool GetSavedBounds(gfx::Rect* bounds, bool* maximize); |
| 599 |
594 internal::NativeWidgetPrivate* native_widget_; | 600 internal::NativeWidgetPrivate* native_widget_; |
595 | 601 |
596 // Non-owned pointer to the Widget's delegate. May be NULL if no delegate is | 602 // Non-owned pointer to the Widget's delegate. May be NULL if no delegate is |
597 // being used. | 603 // being used. |
598 WidgetDelegate* widget_delegate_; | 604 WidgetDelegate* widget_delegate_; |
599 | 605 |
600 // The root of the View hierarchy attached to this window. | 606 // The root of the View hierarchy attached to this window. |
601 // WARNING: see warning in tooltip_manager_ for ordering dependencies with | 607 // WARNING: see warning in tooltip_manager_ for ordering dependencies with |
602 // this and tooltip_manager_. | 608 // this and tooltip_manager_. |
603 scoped_ptr<internal::RootView> root_view_; | 609 scoped_ptr<internal::RootView> root_view_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 // or not it actually is. | 644 // or not it actually is. |
639 bool disable_inactive_rendering_; | 645 bool disable_inactive_rendering_; |
640 | 646 |
641 // Set to true if the widget is in the process of closing. | 647 // Set to true if the widget is in the process of closing. |
642 bool widget_closed_; | 648 bool widget_closed_; |
643 | 649 |
644 // The saved maximized state for this window. See note in SetInitialBounds | 650 // The saved maximized state for this window. See note in SetInitialBounds |
645 // that explains why we save this. | 651 // that explains why we save this. |
646 bool saved_maximized_state_; | 652 bool saved_maximized_state_; |
647 | 653 |
| 654 // The restored bounds used for the initial show. This is only used if |
| 655 // |saved_maximized_state_| is true. |
| 656 gfx::Rect initial_restored_bounds_; |
| 657 |
648 // The smallest size the window can be. | 658 // The smallest size the window can be. |
649 gfx::Size minimum_size_; | 659 gfx::Size minimum_size_; |
650 | 660 |
651 // Factory used to create Compositors. Settable by tests. | 661 // Factory used to create Compositors. Settable by tests. |
652 static ui::Compositor*(*compositor_factory_)(); | 662 static ui::Compositor*(*compositor_factory_)(); |
653 | 663 |
654 DISALLOW_COPY_AND_ASSIGN(Widget); | 664 DISALLOW_COPY_AND_ASSIGN(Widget); |
655 }; | 665 }; |
656 | 666 |
657 } // namespace views | 667 } // namespace views |
658 | 668 |
659 #endif // VIEWS_WIDGET_WIDGET_H_ | 669 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |