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

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

Issue 1029263011: Don't call PaintChildren() from inside OnPaint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/location.h" 10 #include "base/location.h"
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 678
679 paint.setColor(color_utils::BlendTowardOppositeLuminance( 679 paint.setColor(color_utils::BlendTowardOppositeLuminance(
680 background_color, background_alpha)); 680 background_color, background_alpha));
681 paint.setStyle(SkPaint::kFill_Style); 681 paint.setStyle(SkPaint::kFill_Style);
682 canvas->DrawPath(arrow, paint); 682 canvas->DrawPath(arrow, paint);
683 paint.setColor(color_utils::BlendTowardOppositeLuminance( 683 paint.setColor(color_utils::BlendTowardOppositeLuminance(
684 background_color, subtle_border_alpha)); 684 background_color, subtle_border_alpha));
685 paint.setStyle(SkPaint::kStroke_Style); 685 paint.setStyle(SkPaint::kStroke_Style);
686 canvas->DrawPath(arrow, paint); 686 canvas->DrawPath(arrow, paint);
687 } 687 }
688
689 PaintChildren(canvas, views::CullSet());
690 } 688 }
691 689
692 void AutofillDialogViews::OverlayView::OnNativeThemeChanged( 690 void AutofillDialogViews::OverlayView::OnNativeThemeChanged(
693 const ui::NativeTheme* theme) { 691 const ui::NativeTheme* theme) {
694 set_background(views::Background::CreateSolidBackground( 692 set_background(views::Background::CreateSolidBackground(
695 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); 693 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground)));
696 } 694 }
697 695
698 views::BubbleBorder* AutofillDialogViews::OverlayView::GetBubbleBorder() { 696 views::BubbleBorder* AutofillDialogViews::OverlayView::GetBubbleBorder() {
699 views::View* frame = GetWidget()->non_client_view()->frame_view(); 697 views::View* frame = GetWidget()->non_client_view()->frame_view();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 return size; 754 return size;
757 } 755 }
758 756
759 const char* AutofillDialogViews::NotificationArea::GetClassName() const { 757 const char* AutofillDialogViews::NotificationArea::GetClassName() const {
760 return kNotificationAreaClassName; 758 return kNotificationAreaClassName;
761 } 759 }
762 760
763 void AutofillDialogViews::NotificationArea::PaintChildren( 761 void AutofillDialogViews::NotificationArea::PaintChildren(
764 gfx::Canvas* canvas, 762 gfx::Canvas* canvas,
765 const views::CullSet& cull_set) { 763 const views::CullSet& cull_set) {
766 }
767
768 void AutofillDialogViews::NotificationArea::OnPaint(gfx::Canvas* canvas) {
769 views::View::OnPaint(canvas);
770 views::View::PaintChildren(canvas, views::CullSet()); 764 views::View::PaintChildren(canvas, views::CullSet());
771
772 if (HasArrow()) { 765 if (HasArrow()) {
773 DrawArrow( 766 DrawArrow(
774 canvas, 767 canvas,
775 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f), 768 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f),
776 notifications_[0].GetBackgroundColor(), 769 notifications_[0].GetBackgroundColor(),
777 notifications_[0].GetBorderColor()); 770 notifications_[0].GetBorderColor());
778 } 771 }
779 } 772 }
780 773
781 void AutofillDialogViews::OnWidgetDestroying(views::Widget* widget) { 774 void AutofillDialogViews::OnWidgetDestroying(views::Widget* widget) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size(); 988 gfx::Size size = rb.GetImageNamed(ResourceIDForState()).Size();
996 const gfx::Insets insets = GetInsets(); 989 const gfx::Insets insets = GetInsets();
997 size.Enlarge(insets.width(), insets.height()); 990 size.Enlarge(insets.width(), insets.height());
998 return size; 991 return size;
999 } 992 }
1000 993
1001 const char* AutofillDialogViews::SuggestedButton::GetClassName() const { 994 const char* AutofillDialogViews::SuggestedButton::GetClassName() const {
1002 return kSuggestedButtonClassName; 995 return kSuggestedButtonClassName;
1003 } 996 }
1004 997
1005 void AutofillDialogViews::SuggestedButton::PaintChildren(
1006 gfx::Canvas* canvas,
1007 const views::CullSet& cull_set) {
1008 }
1009
1010 void AutofillDialogViews::SuggestedButton::OnPaint(gfx::Canvas* canvas) { 998 void AutofillDialogViews::SuggestedButton::OnPaint(gfx::Canvas* canvas) {
1011 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 999 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
1012 const gfx::Insets insets = GetInsets(); 1000 const gfx::Insets insets = GetInsets();
1013 canvas->DrawImageInt(*rb.GetImageSkiaNamed(ResourceIDForState()), 1001 canvas->DrawImageInt(*rb.GetImageSkiaNamed(ResourceIDForState()),
1014 insets.left(), insets.top()); 1002 insets.left(), insets.top());
1015 views::Painter::PaintFocusPainter(this, canvas, focus_painter()); 1003 views::Painter::PaintFocusPainter(this, canvas, focus_painter());
1016 } 1004 }
1017 1005
1018 int AutofillDialogViews::SuggestedButton::ResourceIDForState() const { 1006 int AutofillDialogViews::SuggestedButton::ResourceIDForState() const {
1019 views::Button::ButtonState button_state = state(); 1007 views::Button::ButtonState button_state = state();
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2488 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2501 : section(section), 2489 : section(section),
2502 container(NULL), 2490 container(NULL),
2503 manual_input(NULL), 2491 manual_input(NULL),
2504 suggested_info(NULL), 2492 suggested_info(NULL),
2505 suggested_button(NULL) {} 2493 suggested_button(NULL) {}
2506 2494
2507 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2495 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2508 2496
2509 } // namespace autofill 2497 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698