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