Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: views/widget/widget.h

Issue 7358005: Makes sure widget is created at right size before showing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 WidgetDelegate* delegate; 136 WidgetDelegate* delegate;
137 bool child; 137 bool child;
138 bool transient; 138 bool transient;
139 bool transparent; 139 bool transparent;
140 bool accept_events; 140 bool accept_events;
141 bool can_activate; 141 bool can_activate;
142 bool keep_on_top; 142 bool keep_on_top;
143 Ownership ownership; 143 Ownership ownership;
144 bool mirror_origin_in_rtl; 144 bool mirror_origin_in_rtl;
145 bool has_dropshadow; 145 bool has_dropshadow;
146 // Whether the widget should be maximized.
147 bool maximize;
146 // Should the widget be double buffered? Default is false. 148 // Should the widget be double buffered? Default is false.
147 bool double_buffer; 149 bool double_buffer;
148 gfx::NativeView parent; 150 gfx::NativeView parent;
149 Widget* parent_widget; 151 Widget* parent_widget;
150 // Specifies the initial bounds of the Widget. Default is empty, which means 152 // Specifies the initial bounds of the Widget. Default is empty, which means
151 // the NativeWidget may specify a default size. 153 // the NativeWidget may specify a default size.
152 gfx::Rect bounds; 154 gfx::Rect bounds;
153 // When set, this value is used as the Widget's NativeWidget implementation. 155 // When set, this value is used as the Widget's NativeWidget implementation.
154 // The Widget will not construct a default one. Default is NULL. 156 // The Widget will not construct a default one. Default is NULL.
155 NativeWidget* native_widget; 157 NativeWidget* native_widget;
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // Returns whether capture should be released on mouse release. 612 // Returns whether capture should be released on mouse release.
611 virtual bool ShouldReleaseCaptureOnMouseReleased() const; 613 virtual bool ShouldReleaseCaptureOnMouseReleased() const;
612 614
613 // Persists the window's restored position and maximized state using the 615 // Persists the window's restored position and maximized state using the
614 // window delegate. 616 // window delegate.
615 void SaveWindowPosition(); 617 void SaveWindowPosition();
616 618
617 // Sizes and positions the window just after it is created. 619 // Sizes and positions the window just after it is created.
618 void SetInitialBounds(const gfx::Rect& bounds); 620 void SetInitialBounds(const gfx::Rect& bounds);
619 621
622 // Returns the bounds and maximized state from the delegate. Returns true if
623 // the delegate wants to use a specified bounds.
624 bool GetSavedBounds(gfx::Rect* bounds, bool* maximize);
625
620 internal::NativeWidgetPrivate* native_widget_; 626 internal::NativeWidgetPrivate* native_widget_;
621 627
622 ObserverList<Observer> observers_; 628 ObserverList<Observer> observers_;
623 629
624 // Non-owned pointer to the Widget's delegate. May be NULL if no delegate is 630 // Non-owned pointer to the Widget's delegate. May be NULL if no delegate is
625 // being used. 631 // being used.
626 WidgetDelegate* widget_delegate_; 632 WidgetDelegate* widget_delegate_;
627 633
628 // The root of the View hierarchy attached to this window. 634 // The root of the View hierarchy attached to this window.
629 // WARNING: see warning in tooltip_manager_ for ordering dependencies with 635 // WARNING: see warning in tooltip_manager_ for ordering dependencies with
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // or not it actually is. 672 // or not it actually is.
667 bool disable_inactive_rendering_; 673 bool disable_inactive_rendering_;
668 674
669 // Set to true if the widget is in the process of closing. 675 // Set to true if the widget is in the process of closing.
670 bool widget_closed_; 676 bool widget_closed_;
671 677
672 // The saved maximized state for this window. See note in SetInitialBounds 678 // The saved maximized state for this window. See note in SetInitialBounds
673 // that explains why we save this. 679 // that explains why we save this.
674 bool saved_maximized_state_; 680 bool saved_maximized_state_;
675 681
682 // The restored bounds used for the initial show. This is only used if
683 // |saved_maximized_state_| is true.
684 gfx::Rect initial_restored_bounds_;
685
676 // The smallest size the window can be. 686 // The smallest size the window can be.
677 gfx::Size minimum_size_; 687 gfx::Size minimum_size_;
678 688
679 // Focus is automatically set to the view provided by the delegate 689 // Focus is automatically set to the view provided by the delegate
680 // when the widget is shown. Set this value to false to override 690 // when the widget is shown. Set this value to false to override
681 // initial focus for the widget. 691 // initial focus for the widget.
682 bool focus_on_creation_; 692 bool focus_on_creation_;
683 693
684 // Factory used to create Compositors. Settable by tests. 694 // Factory used to create Compositors. Settable by tests.
685 static ui::Compositor*(*compositor_factory_)(); 695 static ui::Compositor*(*compositor_factory_)();
686 696
687 DISALLOW_COPY_AND_ASSIGN(Widget); 697 DISALLOW_COPY_AND_ASSIGN(Widget);
688 }; 698 };
689 699
690 } // namespace views 700 } // namespace views
691 701
692 #endif // VIEWS_WIDGET_WIDGET_H_ 702 #endif // VIEWS_WIDGET_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698