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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 23033016: Remove autocheckout code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Horizontal padding between text and other elements (in pixels). 70 // Horizontal padding between text and other elements (in pixels).
71 const int kAroundTextPadding = 4; 71 const int kAroundTextPadding = 4;
72 72
73 // The space between the edges of a notification bar and the text within (in 73 // The space between the edges of a notification bar and the text within (in
74 // pixels). 74 // pixels).
75 const int kNotificationPadding = 17; 75 const int kNotificationPadding = 17;
76 76
77 // Vertical padding above and below each detail section (in pixels). 77 // Vertical padding above and below each detail section (in pixels).
78 const int kDetailSectionVerticalPadding = 10; 78 const int kDetailSectionVerticalPadding = 10;
79 79
80 const int kAutocheckoutStepsAreaPadding = 28;
81 const int kAutocheckoutStepInset = 20;
82
83 const int kAutocheckoutProgressBarWidth = 375;
84 const int kAutocheckoutProgressBarHeight = 15;
85
86 const int kArrowHeight = 7; 80 const int kArrowHeight = 7;
87 const int kArrowWidth = 2 * kArrowHeight; 81 const int kArrowWidth = 2 * kArrowHeight;
88 82
89 // The padding inside the edges of the dialog, in pixels. 83 // The padding inside the edges of the dialog, in pixels.
90 const int kDialogEdgePadding = 20; 84 const int kDialogEdgePadding = 20;
91 85
92 // Slight shading for mouse hover and legal document background. 86 // Slight shading for mouse hover and legal document background.
93 SkColor kShadingColor = SkColorSetARGB(7, 0, 0, 0); 87 SkColor kShadingColor = SkColorSetARGB(7, 0, 0, 0);
94 88
95 // A border color for the legal document view. 89 // A border color for the legal document view.
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 PreferredSizeChanged(); 258 PreferredSizeChanged();
265 } 259 }
266 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE { 260 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE {
267 PreferredSizeChanged(); 261 PreferredSizeChanged();
268 } 262 }
269 263
270 private: 264 private:
271 DISALLOW_COPY_AND_ASSIGN(LayoutPropagationView); 265 DISALLOW_COPY_AND_ASSIGN(LayoutPropagationView);
272 }; 266 };
273 267
274 // A class which displays the status of an individual step in an
275 // Autocheckout flow.
276 class AutocheckoutStepProgressView : public views::View {
277 public:
278 AutocheckoutStepProgressView(const base::string16& description,
279 const gfx::Font& font,
280 const SkColor color,
281 const bool is_icon_visible) {
282 views::GridLayout* layout = new views::GridLayout(this);
283 SetLayoutManager(layout);
284 const int kColumnSetId = 0;
285 views::ColumnSet* columns = layout->AddColumnSet(kColumnSetId);
286 columns->AddColumn(views::GridLayout::LEADING,
287 views::GridLayout::CENTER,
288 0,
289 views::GridLayout::USE_PREF,
290 0,
291 0);
292 columns->AddPaddingColumn(0, 8);
293 columns->AddColumn(views::GridLayout::LEADING,
294 views::GridLayout::CENTER,
295 0,
296 views::GridLayout::USE_PREF,
297 0,
298 0);
299 layout->StartRow(0, kColumnSetId);
300 views::Label* label = new views::Label();
301 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
302 label->set_border(views::Border::CreateEmptyBorder(0, 0, 0, 0));
303 label->SetText(description);
304 label->SetFont(font);
305 label->SetEnabledColor(color);
306
307 views::ImageView* icon = new views::ImageView();
308 icon->SetVisible(is_icon_visible);
309 icon->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
310 IDR_WALLET_STEP_CHECK).ToImageSkia());
311
312 layout->AddView(icon);
313 layout->AddView(label);
314 }
315
316 virtual ~AutocheckoutStepProgressView() {}
317
318 private:
319 DISALLOW_COPY_AND_ASSIGN(AutocheckoutStepProgressView);
320 };
321
322 // A tooltip icon (just an ImageView with a tooltip). Looks like (?). 268 // A tooltip icon (just an ImageView with a tooltip). Looks like (?).
323 class TooltipIcon : public views::ImageView { 269 class TooltipIcon : public views::ImageView {
324 public: 270 public:
325 explicit TooltipIcon(const base::string16& tooltip) : tooltip_(tooltip) { 271 explicit TooltipIcon(const base::string16& tooltip) : tooltip_(tooltip) {
326 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 272 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
327 IDR_AUTOFILL_TOOLTIP_ICON).ToImageSkia()); 273 IDR_AUTOFILL_TOOLTIP_ICON).ToImageSkia());
328 } 274 }
329 virtual ~TooltipIcon() {} 275 virtual ~TooltipIcon() {}
330 276
331 // views::View implementation 277 // views::View implementation
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 } 1075 }
1130 1076
1131 void AutofillDialogViews::SuggestionView::SetTextfield( 1077 void AutofillDialogViews::SuggestionView::SetTextfield(
1132 const base::string16& placeholder_text, 1078 const base::string16& placeholder_text,
1133 const gfx::Image& icon) { 1079 const gfx::Image& icon) {
1134 decorated_->set_placeholder_text(placeholder_text); 1080 decorated_->set_placeholder_text(placeholder_text);
1135 decorated_->SetIcon(icon); 1081 decorated_->SetIcon(icon);
1136 decorated_->SetVisible(!placeholder_text.empty()); 1082 decorated_->SetVisible(!placeholder_text.empty());
1137 } 1083 }
1138 1084
1139 // AutofillDialogViews::AutocheckoutStepsArea ---------------------------------
1140
1141 AutofillDialogViews::AutocheckoutStepsArea::AutocheckoutStepsArea() {
1142 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
1143 kAutocheckoutStepsAreaPadding,
1144 0,
1145 kAutocheckoutStepInset));
1146 }
1147
1148 void AutofillDialogViews::AutocheckoutStepsArea::SetSteps(
1149 const std::vector<DialogAutocheckoutStep>& steps) {
1150 RemoveAllChildViews(true);
1151 for (size_t i = 0; i < steps.size(); ++i) {
1152 const DialogAutocheckoutStep& step = steps[i];
1153 AutocheckoutStepProgressView* progressView =
1154 new AutocheckoutStepProgressView(step.GetDisplayText(),
1155 step.GetTextFont(),
1156 step.GetTextColor(),
1157 step.IsIconVisible());
1158
1159 AddChildView(progressView);
1160 }
1161
1162 PreferredSizeChanged();
1163 }
1164
1165 // AutofillDialogViews::AutocheckoutProgressBar
1166
1167 AutofillDialogViews::AutocheckoutProgressBar::AutocheckoutProgressBar() {}
1168 AutofillDialogViews::AutocheckoutProgressBar::~AutocheckoutProgressBar() {}
1169
1170 gfx::Size AutofillDialogViews::AutocheckoutProgressBar::GetPreferredSize() {
1171 return gfx::Size(kAutocheckoutProgressBarWidth,
1172 kAutocheckoutProgressBarHeight);
1173 }
1174
1175 // AutofillDialogView ---------------------------------------------------------- 1085 // AutofillDialogView ----------------------------------------------------------
1176 1086
1177 // static 1087 // static
1178 AutofillDialogView* AutofillDialogView::Create( 1088 AutofillDialogView* AutofillDialogView::Create(
1179 AutofillDialogViewDelegate* delegate) { 1089 AutofillDialogViewDelegate* delegate) {
1180 return new AutofillDialogViews(delegate); 1090 return new AutofillDialogViews(delegate);
1181 } 1091 }
1182 1092
1183 // AutofillDialogViews --------------------------------------------------------- 1093 // AutofillDialogViews ---------------------------------------------------------
1184 1094
1185 AutofillDialogViews::AutofillDialogViews(AutofillDialogViewDelegate* delegate) 1095 AutofillDialogViews::AutofillDialogViews(AutofillDialogViewDelegate* delegate)
1186 : delegate_(delegate), 1096 : delegate_(delegate),
1187 updates_scope_(0), 1097 updates_scope_(0),
1188 needs_update_(false), 1098 needs_update_(false),
1189 window_(NULL), 1099 window_(NULL),
1190 browser_resize_timer_(false, false), 1100 browser_resize_timer_(false, false),
1191 notification_area_(NULL), 1101 notification_area_(NULL),
1192 account_chooser_(NULL), 1102 account_chooser_(NULL),
1193 sign_in_webview_(NULL), 1103 sign_in_webview_(NULL),
1194 scrollable_area_(NULL), 1104 scrollable_area_(NULL),
1195 details_container_(NULL), 1105 details_container_(NULL),
1196 loading_shield_(NULL), 1106 loading_shield_(NULL),
1197 overlay_view_(NULL), 1107 overlay_view_(NULL),
1198 button_strip_extra_view_(NULL), 1108 button_strip_extra_view_(NULL),
1199 save_in_chrome_checkbox_(NULL), 1109 save_in_chrome_checkbox_(NULL),
1200 save_in_chrome_checkbox_container_(NULL), 1110 save_in_chrome_checkbox_container_(NULL),
1201 button_strip_image_(NULL), 1111 button_strip_image_(NULL),
1202 autocheckout_steps_area_(NULL),
1203 autocheckout_progress_bar_view_(NULL),
1204 autocheckout_progress_bar_(NULL),
1205 footnote_view_(NULL), 1112 footnote_view_(NULL),
1206 legal_document_view_(NULL), 1113 legal_document_view_(NULL),
1207 focus_manager_(NULL), 1114 focus_manager_(NULL),
1208 observer_(this) { 1115 observer_(this) {
1209 DCHECK(delegate); 1116 DCHECK(delegate);
1210 detail_groups_.insert(std::make_pair(SECTION_EMAIL, 1117 detail_groups_.insert(std::make_pair(SECTION_EMAIL,
1211 DetailsGroup(SECTION_EMAIL))); 1118 DetailsGroup(SECTION_EMAIL)));
1212 detail_groups_.insert(std::make_pair(SECTION_CC, 1119 detail_groups_.insert(std::make_pair(SECTION_CC,
1213 DetailsGroup(SECTION_CC))); 1120 DetailsGroup(SECTION_CC)));
1214 detail_groups_.insert(std::make_pair(SECTION_BILLING, 1121 detail_groups_.insert(std::make_pair(SECTION_BILLING,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 link_ranges[i], 1208 link_ranges[i],
1302 views::StyledLabel::RangeStyleInfo::CreateForLink()); 1209 views::StyledLabel::RangeStyleInfo::CreateForLink());
1303 } 1210 }
1304 } 1211 }
1305 1212
1306 footnote_view_->SetVisible(!text.empty()); 1213 footnote_view_->SetVisible(!text.empty());
1307 ContentsPreferredSizeChanged(); 1214 ContentsPreferredSizeChanged();
1308 } 1215 }
1309 } 1216 }
1310 1217
1311 void AutofillDialogViews::UpdateAutocheckoutStepsArea() {
1312 autocheckout_steps_area_->SetSteps(delegate_->CurrentAutocheckoutSteps());
1313 ContentsPreferredSizeChanged();
1314 }
1315
1316 void AutofillDialogViews::UpdateButtonStrip() { 1218 void AutofillDialogViews::UpdateButtonStrip() {
1317 button_strip_extra_view_->SetVisible( 1219 button_strip_extra_view_->SetVisible(
1318 GetDialogButtons() != ui::DIALOG_BUTTON_NONE); 1220 GetDialogButtons() != ui::DIALOG_BUTTON_NONE);
1319 UpdateButtonStripExtraView(); 1221 UpdateButtonStripExtraView();
1320 GetDialogClientView()->UpdateDialogButtons(); 1222 GetDialogClientView()->UpdateDialogButtons();
1321 1223
1322 overlay_view_->SetState(delegate_->GetDialogOverlay(), this); 1224 overlay_view_->SetState(delegate_->GetDialogOverlay(), this);
1323 1225
1324 ContentsPreferredSizeChanged(); 1226 ContentsPreferredSizeChanged();
1325 } 1227 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 ContentsPreferredSizeChanged(); 1307 ContentsPreferredSizeChanged();
1406 return &sign_in_webview_->web_contents()->GetController(); 1308 return &sign_in_webview_->web_contents()->GetController();
1407 } 1309 }
1408 1310
1409 void AutofillDialogViews::HideSignIn() { 1311 void AutofillDialogViews::HideSignIn() {
1410 sign_in_webview_->SetVisible(false); 1312 sign_in_webview_->SetVisible(false);
1411 UpdateButtonStrip(); 1313 UpdateButtonStrip();
1412 ContentsPreferredSizeChanged(); 1314 ContentsPreferredSizeChanged();
1413 } 1315 }
1414 1316
1415 void AutofillDialogViews::UpdateProgressBar(double value) {
1416 autocheckout_progress_bar_->SetValue(value);
1417 }
1418
1419 void AutofillDialogViews::ModelChanged() { 1317 void AutofillDialogViews::ModelChanged() {
1420 menu_runner_.reset(); 1318 menu_runner_.reset();
1421 1319
1422 for (DetailGroupMap::const_iterator iter = detail_groups_.begin(); 1320 for (DetailGroupMap::const_iterator iter = detail_groups_.begin();
1423 iter != detail_groups_.end(); ++iter) { 1321 iter != detail_groups_.end(); ++iter) {
1424 UpdateDetailsGroupState(iter->second); 1322 UpdateDetailsGroupState(iter->second);
1425 } 1323 }
1426 } 1324 }
1427 1325
1428 TestableAutofillDialogView* AutofillDialogViews::GetTestableView() { 1326 TestableAutofillDialogView* AutofillDialogViews::GetTestableView() {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 return; 1408 return;
1511 } 1409 }
1512 1410
1513 const int x = content_bounds.x(); 1411 const int x = content_bounds.x();
1514 const int y = content_bounds.y(); 1412 const int y = content_bounds.y();
1515 const int width = content_bounds.width(); 1413 const int width = content_bounds.width();
1516 // Layout notification area at top of dialog. 1414 // Layout notification area at top of dialog.
1517 int notification_height = notification_area_->GetHeightForWidth(width); 1415 int notification_height = notification_area_->GetHeightForWidth(width);
1518 notification_area_->SetBounds(x, y, width, notification_height); 1416 notification_area_->SetBounds(x, y, width, notification_height);
1519 1417
1520 // Layout Autocheckout steps at bottom of dialog.
1521 int steps_height = autocheckout_steps_area_->GetHeightForWidth(width);
1522 autocheckout_steps_area_->SetBounds(x, content_bounds.bottom() - steps_height,
1523 width, steps_height);
1524
1525 // The rest (the |scrollable_area_|) takes up whatever's left. 1418 // The rest (the |scrollable_area_|) takes up whatever's left.
1526 if (scrollable_area_->visible()) { 1419 if (scrollable_area_->visible()) {
1527 int scroll_y = y; 1420 int scroll_y = y;
1528 if (notification_height > 0) 1421 if (notification_height > 0)
1529 scroll_y += notification_height + views::kRelatedControlVerticalSpacing; 1422 scroll_y += notification_height + views::kRelatedControlVerticalSpacing;
1530 1423
1531 int scroll_bottom = content_bounds.bottom(); 1424 int scroll_bottom = content_bounds.bottom();
1532 if (steps_height > 0)
1533 scroll_bottom -= steps_height + views::kRelatedControlVerticalSpacing;
1534
1535 scrollable_area_->contents()->SizeToPreferredSize(); 1425 scrollable_area_->contents()->SizeToPreferredSize();
1536 scrollable_area_->SetBounds(x, scroll_y, width, scroll_bottom - scroll_y); 1426 scrollable_area_->SetBounds(x, scroll_y, width, scroll_bottom - scroll_y);
1537 } 1427 }
1538 1428
1539 if (loading_shield_->visible()) 1429 if (loading_shield_->visible())
1540 loading_shield_->SetBoundsRect(bounds()); 1430 loading_shield_->SetBoundsRect(bounds());
1541 1431
1542 if (error_bubble_) 1432 if (error_bubble_)
1543 error_bubble_->UpdatePosition(); 1433 error_bubble_->UpdatePosition();
1544 } 1434 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 int height = overlay_view_->GetHeightForContentsForWidth(width); 1648 int height = overlay_view_->GetHeightForContentsForWidth(width);
1759 if (height != 0) 1649 if (height != 0)
1760 return gfx::Size(width + insets.width(), height + insets.height()); 1650 return gfx::Size(width + insets.width(), height + insets.height());
1761 } 1651 }
1762 1652
1763 int height = 0; 1653 int height = 0;
1764 int notification_height = notification_area_->GetHeightForWidth(width); 1654 int notification_height = notification_area_->GetHeightForWidth(width);
1765 if (notification_height > 0) 1655 if (notification_height > 0)
1766 height += notification_height + views::kRelatedControlVerticalSpacing; 1656 height += notification_height + views::kRelatedControlVerticalSpacing;
1767 1657
1768 int steps_height = autocheckout_steps_area_->GetHeightForWidth(width);
1769 if (steps_height > 0)
1770 height += steps_height + views::kRelatedControlVerticalSpacing;
1771
1772 if (scrollable_area_->visible()) { 1658 if (scrollable_area_->visible()) {
1773 // Show as much of the scroll view as is possible without going past the 1659 // Show as much of the scroll view as is possible without going past the
1774 // bottom of the browser window. 1660 // bottom of the browser window.
1775 views::Widget* widget = 1661 views::Widget* widget =
1776 views::Widget::GetTopLevelWidgetForNativeView( 1662 views::Widget::GetTopLevelWidgetForNativeView(
1777 delegate_->GetWebContents()->GetView()->GetNativeView()); 1663 delegate_->GetWebContents()->GetView()->GetNativeView());
1778 int browser_window_height = 1664 int browser_window_height =
1779 widget ? widget->GetContentsView()->bounds().height() : INT_MAX; 1665 widget ? widget->GetContentsView()->bounds().height() : INT_MAX;
1780 const int kWindowDecorationHeight = 200; 1666 const int kWindowDecorationHeight = 200;
1781 int browser_constrained_height = 1667 int browser_constrained_height =
(...skipping 22 matching lines...) Expand all
1804 new views::Checkbox(delegate_->SaveLocallyText()); 1690 new views::Checkbox(delegate_->SaveLocallyText());
1805 save_in_chrome_checkbox_->SetChecked(true); 1691 save_in_chrome_checkbox_->SetChecked(true);
1806 save_in_chrome_checkbox_container_->AddChildView(save_in_chrome_checkbox_); 1692 save_in_chrome_checkbox_container_->AddChildView(save_in_chrome_checkbox_);
1807 1693
1808 save_in_chrome_checkbox_container_->AddChildView( 1694 save_in_chrome_checkbox_container_->AddChildView(
1809 new TooltipIcon(delegate_->SaveLocallyTooltip())); 1695 new TooltipIcon(delegate_->SaveLocallyTooltip()));
1810 1696
1811 button_strip_image_ = new views::ImageView(); 1697 button_strip_image_ = new views::ImageView();
1812 button_strip_extra_view_->AddChildView(button_strip_image_); 1698 button_strip_extra_view_->AddChildView(button_strip_image_);
1813 1699
1814 autocheckout_progress_bar_view_ = new views::View();
1815 views::GridLayout* progress_bar_layout =
1816 new views::GridLayout(autocheckout_progress_bar_view_);
1817 autocheckout_progress_bar_view_->SetLayoutManager(progress_bar_layout);
1818 const int kColumnSetId = 0;
1819 views::ColumnSet* columns = progress_bar_layout->AddColumnSet(kColumnSetId);
1820 columns->AddColumn(views::GridLayout::LEADING,
1821 views::GridLayout::CENTER,
1822 0,
1823 views::GridLayout::USE_PREF,
1824 0,
1825 0);
1826 progress_bar_layout->StartRow(1.0, kColumnSetId);
1827
1828 autocheckout_progress_bar_ = new AutocheckoutProgressBar();
1829 progress_bar_layout->AddView(autocheckout_progress_bar_);
1830 button_strip_extra_view_->AddChildView(autocheckout_progress_bar_view_);
1831
1832 account_chooser_ = new AccountChooser(delegate_); 1700 account_chooser_ = new AccountChooser(delegate_);
1833 notification_area_ = new NotificationArea(delegate_); 1701 notification_area_ = new NotificationArea(delegate_);
1834 notification_area_->set_arrow_centering_anchor(account_chooser_->AsWeakPtr()); 1702 notification_area_->set_arrow_centering_anchor(account_chooser_->AsWeakPtr());
1835 AddChildView(notification_area_); 1703 AddChildView(notification_area_);
1836 1704
1837 scrollable_area_ = new views::ScrollView(); 1705 scrollable_area_ = new views::ScrollView();
1838 scrollable_area_->set_hide_horizontal_scrollbar(true); 1706 scrollable_area_->set_hide_horizontal_scrollbar(true);
1839 scrollable_area_->SetContents(CreateDetailsContainer()); 1707 scrollable_area_->SetContents(CreateDetailsContainer());
1840 AddChildView(scrollable_area_); 1708 AddChildView(scrollable_area_);
1841 1709
1842 autocheckout_steps_area_ = new AutocheckoutStepsArea();
1843 AddChildView(autocheckout_steps_area_);
1844
1845 loading_shield_ = new views::Label(); 1710 loading_shield_ = new views::Label();
1846 loading_shield_->SetVisible(false); 1711 loading_shield_->SetVisible(false);
1847 loading_shield_->set_background(views::Background::CreateSolidBackground( 1712 loading_shield_->set_background(views::Background::CreateSolidBackground(
1848 GetNativeTheme()->GetSystemColor( 1713 GetNativeTheme()->GetSystemColor(
1849 ui::NativeTheme::kColorId_DialogBackground))); 1714 ui::NativeTheme::kColorId_DialogBackground)));
1850 loading_shield_->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( 1715 loading_shield_->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont(
1851 ui::ResourceBundle::BaseFont).DeriveFont(15)); 1716 ui::ResourceBundle::BaseFont).DeriveFont(15));
1852 AddChildView(loading_shield_); 1717 AddChildView(loading_shield_);
1853 1718
1854 sign_in_webview_ = new views::WebView(delegate_->profile()); 1719 sign_in_webview_ = new views::WebView(delegate_->profile());
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2281 decorated->SetIcon(icon); 2146 decorated->SetIcon(icon);
2282 } 2147 }
2283 2148
2284 void AutofillDialogViews::UpdateButtonStripExtraView() { 2149 void AutofillDialogViews::UpdateButtonStripExtraView() {
2285 save_in_chrome_checkbox_container_->SetVisible( 2150 save_in_chrome_checkbox_container_->SetVisible(
2286 delegate_->ShouldOfferToSaveInChrome()); 2151 delegate_->ShouldOfferToSaveInChrome());
2287 2152
2288 gfx::Image image = delegate_->ButtonStripImage(); 2153 gfx::Image image = delegate_->ButtonStripImage();
2289 button_strip_image_->SetVisible(!image.IsEmpty()); 2154 button_strip_image_->SetVisible(!image.IsEmpty());
2290 button_strip_image_->SetImage(image.AsImageSkia()); 2155 button_strip_image_->SetImage(image.AsImageSkia());
2291
2292 autocheckout_progress_bar_view_->SetVisible(
2293 delegate_->ShouldShowProgressBar());
2294 } 2156 }
2295 2157
2296 void AutofillDialogViews::ContentsPreferredSizeChanged() { 2158 void AutofillDialogViews::ContentsPreferredSizeChanged() {
2297 if (updates_scope_ != 0) { 2159 if (updates_scope_ != 0) {
2298 needs_update_ = true; 2160 needs_update_ = true;
2299 return; 2161 return;
2300 } 2162 }
2301 2163
2302 preferred_size_ = gfx::Size(); 2164 preferred_size_ = gfx::Size();
2303 2165
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2234 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2373 : section(section), 2235 : section(section),
2374 container(NULL), 2236 container(NULL),
2375 manual_input(NULL), 2237 manual_input(NULL),
2376 suggested_info(NULL), 2238 suggested_info(NULL),
2377 suggested_button(NULL) {} 2239 suggested_button(NULL) {}
2378 2240
2379 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2241 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2380 2242
2381 } // namespace autofill 2243 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698