OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
630 const string16& placeholder_text, | 630 const string16& placeholder_text, |
631 const gfx::ImageSkia& icon) { | 631 const gfx::ImageSkia& icon) { |
632 decorated_->textfield()->set_placeholder_text(placeholder_text); | 632 decorated_->textfield()->set_placeholder_text(placeholder_text); |
633 decorated_->textfield()->SetIcon(icon); | 633 decorated_->textfield()->SetIcon(icon); |
634 decorated_->SetVisible(true); | 634 decorated_->SetVisible(true); |
635 // The textfield will increase the height of the first row and cause the | 635 // The textfield will increase the height of the first row and cause the |
636 // label to be aligned properly, so the border is not necessary. | 636 // label to be aligned properly, so the border is not necessary. |
637 label_->set_border(NULL); | 637 label_->set_border(NULL); |
638 } | 638 } |
639 | 639 |
640 // AutofilDialogViews::ButtonStripView --------------------------------- | |
641 | |
642 AutofillDialogViews::ButtonStripView::ButtonStripView() {} | |
643 AutofillDialogViews::ButtonStripView::~ButtonStripView() {} | |
644 | |
645 void AutofillDialogViews::ButtonStripView::ChildVisibilityChanged( | |
646 views::View* child) { | |
647 PreferredSizeChanged(); | |
648 } | |
649 | |
640 // AutofilDialogViews::AutocheckoutProgressBar --------------------------------- | 650 // AutofilDialogViews::AutocheckoutProgressBar --------------------------------- |
641 | 651 |
642 AutofillDialogViews::AutocheckoutProgressBar::AutocheckoutProgressBar() {} | 652 AutofillDialogViews::AutocheckoutProgressBar::AutocheckoutProgressBar() {} |
653 AutofillDialogViews::AutocheckoutProgressBar::~AutocheckoutProgressBar() {} | |
643 | 654 |
644 gfx::Size AutofillDialogViews::AutocheckoutProgressBar::GetPreferredSize() { | 655 gfx::Size AutofillDialogViews::AutocheckoutProgressBar::GetPreferredSize() { |
645 return gfx::Size(kAutocheckoutProgressBarWidth, | 656 return gfx::Size(kAutocheckoutProgressBarWidth, |
646 kAutocheckoutProgressBarHeight); | 657 kAutocheckoutProgressBarHeight); |
647 } | 658 } |
648 | 659 |
649 // AutofillDialogView ---------------------------------------------------------- | 660 // AutofillDialogView ---------------------------------------------------------- |
650 | 661 |
651 // static | 662 // static |
652 AutofillDialogView* AutofillDialogView::Create( | 663 AutofillDialogView* AutofillDialogView::Create( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
727 | 738 |
728 void AutofillDialogViews::UpdateAccountChooser() { | 739 void AutofillDialogViews::UpdateAccountChooser() { |
729 account_chooser_->Update(); | 740 account_chooser_->Update(); |
730 | 741 |
731 // Update legal documents for the account. | 742 // Update legal documents for the account. |
732 if (footnote_view_) { | 743 if (footnote_view_) { |
733 string16 text = controller_->LegalDocumentsText(); | 744 string16 text = controller_->LegalDocumentsText(); |
734 if (text.empty()) { | 745 if (text.empty()) { |
735 footnote_view_->SetVisible(false); | 746 footnote_view_->SetVisible(false); |
736 } else { | 747 } else { |
737 footnote_view_->SetVisible(true); | 748 footnote_view_->SetVisible(true); |
Evan Stade
2013/05/07 22:25:11
and I think you'll need to move this to the end of
Dan Beam
2013/05/08 00:54:10
Done.
| |
738 legal_document_view_->SetText(text); | 749 legal_document_view_->SetText(text); |
739 | 750 |
740 const std::vector<ui::Range>& link_ranges = | 751 const std::vector<ui::Range>& link_ranges = |
741 controller_->LegalDocumentLinks(); | 752 controller_->LegalDocumentLinks(); |
742 for (size_t i = 0; i < link_ranges.size(); ++i) { | 753 for (size_t i = 0; i < link_ranges.size(); ++i) { |
743 legal_document_view_->AddStyleRange( | 754 legal_document_view_->AddStyleRange( |
744 link_ranges[i], | 755 link_ranges[i], |
745 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 756 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
746 } | 757 } |
747 } | 758 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1089 DCHECK(group); | 1100 DCHECK(group); |
1090 ValidateGroup(group, AutofillDialogController::VALIDATE_EDIT); | 1101 ValidateGroup(group, AutofillDialogController::VALIDATE_EDIT); |
1091 } | 1102 } |
1092 | 1103 |
1093 void AutofillDialogViews::StyledLabelLinkClicked(const ui::Range& range, | 1104 void AutofillDialogViews::StyledLabelLinkClicked(const ui::Range& range, |
1094 int event_flags) { | 1105 int event_flags) { |
1095 controller_->LegalDocumentLinkClicked(range); | 1106 controller_->LegalDocumentLinkClicked(range); |
1096 } | 1107 } |
1097 | 1108 |
1098 void AutofillDialogViews::InitChildViews() { | 1109 void AutofillDialogViews::InitChildViews() { |
1099 button_strip_extra_view_ = new views::View(); | 1110 button_strip_extra_view_ = new ButtonStripView(); |
1100 button_strip_extra_view_->SetLayoutManager( | 1111 button_strip_extra_view_->SetLayoutManager( |
1101 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 1112 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
1102 | 1113 |
1103 save_in_chrome_checkbox_ = | 1114 save_in_chrome_checkbox_ = |
1104 new views::Checkbox(controller_->SaveLocallyText()); | 1115 new views::Checkbox(controller_->SaveLocallyText()); |
1105 button_strip_extra_view_->AddChildView(save_in_chrome_checkbox_); | 1116 button_strip_extra_view_->AddChildView(save_in_chrome_checkbox_); |
1106 | 1117 |
1107 autocheckout_progress_bar_view_ = new views::View(); | 1118 autocheckout_progress_bar_view_ = new views::View(); |
1108 autocheckout_progress_bar_view_->SetLayoutManager( | 1119 autocheckout_progress_bar_view_->SetLayoutManager( |
1109 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 1120 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1581 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 1592 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
1582 : section(section), | 1593 : section(section), |
1583 container(NULL), | 1594 container(NULL), |
1584 manual_input(NULL), | 1595 manual_input(NULL), |
1585 suggested_info(NULL), | 1596 suggested_info(NULL), |
1586 suggested_button(NULL) {} | 1597 suggested_button(NULL) {} |
1587 | 1598 |
1588 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 1599 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
1589 | 1600 |
1590 } // namespace autofill | 1601 } // namespace autofill |
OLD | NEW |