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

Unified Diff: ui/views/widget/widget.cc

Issue 21967002: UpdateWindowTitle before SetInitialBounds in Widget::Init. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment and a dialog unit test. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 0b357f80d658efe1cec23e5a585b3b5083c3462b..e97c950261b349e69b376f44d9a4496302eb8ad7 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -348,12 +348,14 @@ void Widget::Init(const InitParams& in_params) {
non_client_view_->set_client_view(widget_delegate_->CreateClientView(this));
non_client_view_->SetOverlayView(widget_delegate_->CreateOverlayView());
SetContentsView(non_client_view_);
+ // Initialize the window's title before setting the window's initial bounds;
+ // the frame view's preferred height may depend on the presence of a title.
+ UpdateWindowTitle();
SetInitialBounds(params.bounds);
if (params.show_state == ui::SHOW_STATE_MAXIMIZED)
Maximize();
else if (params.show_state == ui::SHOW_STATE_MINIMIZED)
Minimize();
- UpdateWindowTitle();
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
SetInitialBoundsForFramelessWindow(params.bounds);
« no previous file with comments | « no previous file | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698