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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 2737913002: Fix missing buttons on the Edit Bookmark dialog. (Closed)
Patch Set: update comment Created 3 years, 9 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 | « ui/views/window/dialog_client_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 5c10986b1309fd2188efeec1a47ffef3f2a3a3ae..fcf37d9f71fb28c991b67e3baf29771bcd52a150 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -190,7 +190,7 @@ void DialogClientView::ViewHierarchyChanged(
return;
// SetupViews() removes all children, managing data members itself.
- if (preserve_button_row_data_members_)
+ if (adding_or_removing_views_)
return;
// Otherwise, this should only happen during teardown. Ensure there are no
@@ -240,7 +240,7 @@ DialogDelegate* DialogClientView::GetDialogDelegate() const {
}
void DialogClientView::ChildPreferredSizeChanged(View* child) {
- if (child == extra_view_)
+ if (!adding_or_removing_views_ && child == extra_view_)
Layout();
}
@@ -316,6 +316,7 @@ DialogClientView::GetButtonRowViews() {
}
void DialogClientView::SetupLayout() {
+ base::AutoReset<bool> auto_reset(&adding_or_removing_views_, true);
GridLayout* layout = new GridLayout(button_row_container_);
layout->set_minimum_size(minimum_size_);
@@ -401,14 +402,11 @@ void DialogClientView::SetupLayout() {
}
void DialogClientView::SetupViews() {
- {
- base::AutoReset<bool> auto_reset(&preserve_button_row_data_members_, true);
- button_row_container_->RemoveAllChildViews(false /* delete children */);
- // If SetupLayout() "stored" a hidden |extra_view_| in |this|, ensure it can
- // be re-added to the layout when becoming visible.
- if (extra_view_)
- RemoveChildView(extra_view_);
- }
+ button_row_container_->RemoveAllChildViews(false /* delete children */);
+ // If SetupLayout() "stored" a hidden |extra_view_| in |this|, ensure it can
+ // be re-added to the layout when becoming visible.
+ if (extra_view_)
+ RemoveChildView(extra_view_);
UpdateDialogButton(&ok_button_, ui::DIALOG_BUTTON_OK);
UpdateDialogButton(&cancel_button_, ui::DIALOG_BUTTON_CANCEL);
« no previous file with comments | « ui/views/window/dialog_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698