| 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/location.h" | 10 #include "base/location.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 ui::ResourceBundle::GetSharedInstance().GetFontList( | 392 ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 393 ui::ResourceBundle::LargeFont); | 393 ui::ResourceBundle::LargeFont); |
| 394 animation_.reset(new LoadingAnimation(this, font_list.GetHeight())); | 394 animation_.reset(new LoadingAnimation(this, font_list.GetHeight())); |
| 395 | 395 |
| 396 container_->AddChildView(new views::Label(text, font_list)); | 396 container_->AddChildView(new views::Label(text, font_list)); |
| 397 | 397 |
| 398 for (size_t i = 0; i < 3; ++i) { | 398 for (size_t i = 0; i < 3; ++i) { |
| 399 container_->AddChildView( | 399 container_->AddChildView( |
| 400 new views::Label(base::ASCIIToUTF16("."), font_list)); | 400 new views::Label(base::ASCIIToUTF16("."), font_list)); |
| 401 } | 401 } |
| 402 | |
| 403 OnNativeThemeChanged(GetNativeTheme()); | |
| 404 } | 402 } |
| 405 | 403 |
| 406 virtual ~LoadingAnimationView() {} | 404 virtual ~LoadingAnimationView() {} |
| 407 | 405 |
| 408 // views::View implementation. | 406 // views::View implementation. |
| 409 virtual void SetVisible(bool visible) OVERRIDE { | 407 virtual void SetVisible(bool visible) OVERRIDE { |
| 410 if (visible) | 408 if (visible) |
| 411 animation_->Start(); | 409 animation_->Start(); |
| 412 else | 410 else |
| 413 animation_->Reset(); | 411 animation_->Reset(); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 AutofillDialogViews::OverlayView::OverlayView( | 570 AutofillDialogViews::OverlayView::OverlayView( |
| 573 AutofillDialogViewDelegate* delegate) | 571 AutofillDialogViewDelegate* delegate) |
| 574 : delegate_(delegate), | 572 : delegate_(delegate), |
| 575 image_view_(new views::ImageView()), | 573 image_view_(new views::ImageView()), |
| 576 message_view_(new views::Label()) { | 574 message_view_(new views::Label()) { |
| 577 message_view_->SetAutoColorReadabilityEnabled(false); | 575 message_view_->SetAutoColorReadabilityEnabled(false); |
| 578 message_view_->SetMultiLine(true); | 576 message_view_->SetMultiLine(true); |
| 579 | 577 |
| 580 AddChildView(image_view_); | 578 AddChildView(image_view_); |
| 581 AddChildView(message_view_); | 579 AddChildView(message_view_); |
| 582 | |
| 583 OnNativeThemeChanged(GetNativeTheme()); | |
| 584 } | 580 } |
| 585 | 581 |
| 586 AutofillDialogViews::OverlayView::~OverlayView() {} | 582 AutofillDialogViews::OverlayView::~OverlayView() {} |
| 587 | 583 |
| 588 int AutofillDialogViews::OverlayView::GetHeightForContentsForWidth(int width) { | 584 int AutofillDialogViews::OverlayView::GetHeightForContentsForWidth(int width) { |
| 589 // In this case, 0 means "no preference". | 585 // In this case, 0 means "no preference". |
| 590 if (!message_view_->visible()) | 586 if (!message_view_->visible()) |
| 591 return 0; | 587 return 0; |
| 592 | 588 |
| 593 return kOverlayImageBottomMargin + | 589 return kOverlayImageBottomMargin + |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 new views::BoxLayout(views::BoxLayout::kVertical, | 1620 new views::BoxLayout(views::BoxLayout::kVertical, |
| 1625 kDialogEdgePadding, | 1621 kDialogEdgePadding, |
| 1626 kDialogEdgePadding, | 1622 kDialogEdgePadding, |
| 1627 0)); | 1623 0)); |
| 1628 footnote_view_->SetBorder( | 1624 footnote_view_->SetBorder( |
| 1629 views::Border::CreateSolidSidedBorder(1, 0, 0, 0, kSubtleBorderColor)); | 1625 views::Border::CreateSolidSidedBorder(1, 0, 0, 0, kSubtleBorderColor)); |
| 1630 footnote_view_->set_background( | 1626 footnote_view_->set_background( |
| 1631 views::Background::CreateSolidBackground(kShadingColor)); | 1627 views::Background::CreateSolidBackground(kShadingColor)); |
| 1632 | 1628 |
| 1633 legal_document_view_ = new views::StyledLabel(base::string16(), this); | 1629 legal_document_view_ = new views::StyledLabel(base::string16(), this); |
| 1634 OnNativeThemeChanged(GetNativeTheme()); | |
| 1635 | 1630 |
| 1636 footnote_view_->AddChildView(legal_document_view_); | 1631 footnote_view_->AddChildView(legal_document_view_); |
| 1637 footnote_view_->SetVisible(false); | 1632 footnote_view_->SetVisible(false); |
| 1638 | 1633 |
| 1639 return footnote_view_; | 1634 return footnote_view_; |
| 1640 } | 1635 } |
| 1641 | 1636 |
| 1642 views::View* AutofillDialogViews::CreateOverlayView() { | 1637 views::View* AutofillDialogViews::CreateOverlayView() { |
| 1643 return overlay_view_; | 1638 return overlay_view_; |
| 1644 } | 1639 } |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2507 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| 2513 : section(section), | 2508 : section(section), |
| 2514 container(NULL), | 2509 container(NULL), |
| 2515 manual_input(NULL), | 2510 manual_input(NULL), |
| 2516 suggested_info(NULL), | 2511 suggested_info(NULL), |
| 2517 suggested_button(NULL) {} | 2512 suggested_button(NULL) {} |
| 2518 | 2513 |
| 2519 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2514 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
| 2520 | 2515 |
| 2521 } // namespace autofill | 2516 } // namespace autofill |
| OLD | NEW |