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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 14895004: Fixing autocheckout progress bar repaint bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | ui/views/window/dialog_client_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..df5a3f818356e4e80d592af34995dd7579f5fd70 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -206,6 +206,22 @@ class ErrorBubbleContents : public views::View {
DISALLOW_COPY_AND_ASSIGN(ErrorBubbleContents);
};
+// ButtonStripView wraps the Autocheckout progress bar and the "[X] Save details
+// in Chrome" checkbox and listens for visibility changes.
+class ButtonStripView : public views::View {
+ public:
+ ButtonStripView() {}
+ virtual ~ButtonStripView() {}
+
+ protected:
+ virtual void ChildVisibilityChanged(views::View* child) OVERRIDE {
+ PreferredSizeChanged();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonStripView);
+};
+
} // namespace
// AutofillDialogViews::SizeLimitedScrollView ----------------------------------
@@ -726,6 +742,7 @@ void AutofillDialogViews::SuggestionView::ShowTextfield(
// AutofilDialogViews::AutocheckoutProgressBar ---------------------------------
AutofillDialogViews::AutocheckoutProgressBar::AutocheckoutProgressBar() {}
+AutofillDialogViews::AutocheckoutProgressBar::~AutocheckoutProgressBar() {}
gfx::Size AutofillDialogViews::AutocheckoutProgressBar::GetPreferredSize() {
return gfx::Size(kAutocheckoutProgressBarWidth,
@@ -816,13 +833,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 +846,7 @@ void AutofillDialogViews::UpdateAccountChooser() {
}
}
+ footnote_view_->SetVisible(!text.empty());
ContentsPreferredSizeChanged();
}
}
@@ -1181,7 +1196,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));
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | ui/views/window/dialog_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698