Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
index e048444c44d1621d3fab1a9e0af32f89a9a2a3b7..8e9156df407990ca263af7cba757504c5095f475 100644 |
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
@@ -723,9 +723,20 @@ void AutofillDialogViews::SuggestionView::ShowTextfield( |
label_->set_border(NULL); |
} |
+// AutofilDialogViews::ButtonStripView ----------------------------------------- |
+ |
+AutofillDialogViews::ButtonStripView::ButtonStripView() {} |
+AutofillDialogViews::ButtonStripView::~ButtonStripView() {} |
+ |
+void AutofillDialogViews::ButtonStripView::ChildVisibilityChanged( |
+ views::View* child) { |
+ PreferredSizeChanged(); |
+} |
+ |
// AutofilDialogViews::AutocheckoutProgressBar --------------------------------- |
AutofillDialogViews::AutocheckoutProgressBar::AutocheckoutProgressBar() {} |
+AutofillDialogViews::AutocheckoutProgressBar::~AutocheckoutProgressBar() {} |
gfx::Size AutofillDialogViews::AutocheckoutProgressBar::GetPreferredSize() { |
return gfx::Size(kAutocheckoutProgressBarWidth, |
@@ -816,13 +827,10 @@ void AutofillDialogViews::UpdateAccountChooser() { |
// Update legal documents for the account. |
if (footnote_view_) { |
- string16 text = controller_->LegalDocumentsText(); |
- if (text.empty()) { |
- footnote_view_->SetVisible(false); |
- } else { |
- footnote_view_->SetVisible(true); |
- legal_document_view_->SetText(text); |
+ const string16 text = controller_->LegalDocumentsText(); |
+ legal_document_view_->SetText(text); |
+ if (!text.empty()) { |
const std::vector<ui::Range>& link_ranges = |
controller_->LegalDocumentLinks(); |
for (size_t i = 0; i < link_ranges.size(); ++i) { |
@@ -832,6 +840,7 @@ void AutofillDialogViews::UpdateAccountChooser() { |
} |
} |
+ footnote_view_->SetVisible(!text.empty()); |
ContentsPreferredSizeChanged(); |
} |
} |
@@ -1181,7 +1190,7 @@ void AutofillDialogViews::StyledLabelLinkClicked(const ui::Range& range, |
} |
void AutofillDialogViews::InitChildViews() { |
- button_strip_extra_view_ = new views::View(); |
+ button_strip_extra_view_ = new ButtonStripView(); |
button_strip_extra_view_->SetLayoutManager( |
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |