| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 paint.setColor(color_utils::BlendTowardOppositeLuminance( | 685 paint.setColor(color_utils::BlendTowardOppositeLuminance( |
| 686 background_color, background_alpha)); | 686 background_color, background_alpha)); |
| 687 paint.setStyle(SkPaint::kFill_Style); | 687 paint.setStyle(SkPaint::kFill_Style); |
| 688 canvas->DrawPath(arrow, paint); | 688 canvas->DrawPath(arrow, paint); |
| 689 paint.setColor(color_utils::BlendTowardOppositeLuminance( | 689 paint.setColor(color_utils::BlendTowardOppositeLuminance( |
| 690 background_color, subtle_border_alpha)); | 690 background_color, subtle_border_alpha)); |
| 691 paint.setStyle(SkPaint::kStroke_Style); | 691 paint.setStyle(SkPaint::kStroke_Style); |
| 692 canvas->DrawPath(arrow, paint); | 692 canvas->DrawPath(arrow, paint); |
| 693 } | 693 } |
| 694 | 694 |
| 695 PaintChildren(canvas); | 695 PaintChildren(canvas, views::CullSet()); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void AutofillDialogViews::OverlayView::OnNativeThemeChanged( | 698 void AutofillDialogViews::OverlayView::OnNativeThemeChanged( |
| 699 const ui::NativeTheme* theme) { | 699 const ui::NativeTheme* theme) { |
| 700 set_background(views::Background::CreateSolidBackground( | 700 set_background(views::Background::CreateSolidBackground( |
| 701 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); | 701 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); |
| 702 } | 702 } |
| 703 | 703 |
| 704 views::BubbleBorder* AutofillDialogViews::OverlayView::GetBubbleBorder() { | 704 views::BubbleBorder* AutofillDialogViews::OverlayView::GetBubbleBorder() { |
| 705 views::View* frame = GetWidget()->non_client_view()->frame_view(); | 705 views::View* frame = GetWidget()->non_client_view()->frame_view(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 // Ensure that long notifications wrap and don't enlarge the dialog. | 760 // Ensure that long notifications wrap and don't enlarge the dialog. |
| 761 size.set_width(1); | 761 size.set_width(1); |
| 762 return size; | 762 return size; |
| 763 } | 763 } |
| 764 | 764 |
| 765 const char* AutofillDialogViews::NotificationArea::GetClassName() const { | 765 const char* AutofillDialogViews::NotificationArea::GetClassName() const { |
| 766 return kNotificationAreaClassName; | 766 return kNotificationAreaClassName; |
| 767 } | 767 } |
| 768 | 768 |
| 769 void AutofillDialogViews::NotificationArea::PaintChildren( | 769 void AutofillDialogViews::NotificationArea::PaintChildren( |
| 770 gfx::Canvas* canvas) {} | 770 gfx::Canvas* canvas, |
| 771 const views::CullSet& cull_set) { |
| 772 } |
| 771 | 773 |
| 772 void AutofillDialogViews::NotificationArea::OnPaint(gfx::Canvas* canvas) { | 774 void AutofillDialogViews::NotificationArea::OnPaint(gfx::Canvas* canvas) { |
| 773 views::View::OnPaint(canvas); | 775 views::View::OnPaint(canvas); |
| 774 views::View::PaintChildren(canvas); | 776 views::View::PaintChildren(canvas, views::CullSet()); |
| 775 | 777 |
| 776 if (HasArrow()) { | 778 if (HasArrow()) { |
| 777 DrawArrow( | 779 DrawArrow( |
| 778 canvas, | 780 canvas, |
| 779 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f), | 781 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f), |
| 780 notifications_[0].GetBackgroundColor(), | 782 notifications_[0].GetBackgroundColor(), |
| 781 notifications_[0].GetBorderColor()); | 783 notifications_[0].GetBorderColor()); |
| 782 } | 784 } |
| 783 } | 785 } |
| 784 | 786 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size(); | 998 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size(); |
| 997 const gfx::Insets insets = GetInsets(); | 999 const gfx::Insets insets = GetInsets(); |
| 998 size.Enlarge(insets.width(), insets.height()); | 1000 size.Enlarge(insets.width(), insets.height()); |
| 999 return size; | 1001 return size; |
| 1000 } | 1002 } |
| 1001 | 1003 |
| 1002 const char* AutofillDialogViews::SuggestedButton::GetClassName() const { | 1004 const char* AutofillDialogViews::SuggestedButton::GetClassName() const { |
| 1003 return kSuggestedButtonClassName; | 1005 return kSuggestedButtonClassName; |
| 1004 } | 1006 } |
| 1005 | 1007 |
| 1006 void AutofillDialogViews::SuggestedButton::PaintChildren(gfx::Canvas* canvas) {} | 1008 void AutofillDialogViews::SuggestedButton::PaintChildren( |
| 1009 gfx::Canvas* canvas, |
| 1010 const views::CullSet& cull_set) { |
| 1011 } |
| 1007 | 1012 |
| 1008 void AutofillDialogViews::SuggestedButton::OnPaint(gfx::Canvas* canvas) { | 1013 void AutofillDialogViews::SuggestedButton::OnPaint(gfx::Canvas* canvas) { |
| 1009 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 1014 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 1010 const gfx::Insets insets = GetInsets(); | 1015 const gfx::Insets insets = GetInsets(); |
| 1011 canvas->DrawImageInt(*rb.GetImageSkiaNamed(ResourceIDForState()), | 1016 canvas->DrawImageInt(*rb.GetImageSkiaNamed(ResourceIDForState()), |
| 1012 insets.left(), insets.top()); | 1017 insets.left(), insets.top()); |
| 1013 views::Painter::PaintFocusPainter(this, canvas, focus_painter()); | 1018 views::Painter::PaintFocusPainter(this, canvas, focus_painter()); |
| 1014 } | 1019 } |
| 1015 | 1020 |
| 1016 int AutofillDialogViews::SuggestedButton::ResourceIDForState() const { | 1021 int AutofillDialogViews::SuggestedButton::ResourceIDForState() const { |
| (...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2511 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| 2507 : section(section), | 2512 : section(section), |
| 2508 container(NULL), | 2513 container(NULL), |
| 2509 manual_input(NULL), | 2514 manual_input(NULL), |
| 2510 suggested_info(NULL), | 2515 suggested_info(NULL), |
| 2511 suggested_button(NULL) {} | 2516 suggested_button(NULL) {} |
| 2512 | 2517 |
| 2513 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2518 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
| 2514 | 2519 |
| 2515 } // namespace autofill | 2520 } // namespace autofill |
| OLD | NEW |