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 13 matching lines...) Expand all Loading... |
24 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 24 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
25 #include "content/public/browser/native_web_keyboard_event.h" | 25 #include "content/public/browser/native_web_keyboard_event.h" |
26 #include "content/public/browser/navigation_controller.h" | 26 #include "content/public/browser/navigation_controller.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 #include "grit/theme_resources.h" | 28 #include "grit/theme_resources.h" |
29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
30 #include "ui/base/models/combobox_model.h" | 30 #include "ui/base/models/combobox_model.h" |
31 #include "ui/base/models/menu_model.h" | 31 #include "ui/base/models/menu_model.h" |
32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
33 #include "ui/compositor/paint_context.h" | 33 #include "ui/compositor/paint_context.h" |
| 34 #include "ui/compositor/paint_recorder.h" |
34 #include "ui/events/event_handler.h" | 35 #include "ui/events/event_handler.h" |
35 #include "ui/gfx/animation/animation_delegate.h" | 36 #include "ui/gfx/animation/animation_delegate.h" |
36 #include "ui/gfx/canvas.h" | 37 #include "ui/gfx/canvas.h" |
37 #include "ui/gfx/color_utils.h" | 38 #include "ui/gfx/color_utils.h" |
38 #include "ui/gfx/font_list.h" | 39 #include "ui/gfx/font_list.h" |
39 #include "ui/gfx/geometry/point.h" | 40 #include "ui/gfx/geometry/point.h" |
40 #include "ui/gfx/path.h" | 41 #include "ui/gfx/path.h" |
41 #include "ui/gfx/skia_util.h" | 42 #include "ui/gfx/skia_util.h" |
42 #include "ui/views/background.h" | 43 #include "ui/views/background.h" |
43 #include "ui/views/border.h" | 44 #include "ui/views/border.h" |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 return size; | 750 return size; |
750 } | 751 } |
751 | 752 |
752 const char* AutofillDialogViews::NotificationArea::GetClassName() const { | 753 const char* AutofillDialogViews::NotificationArea::GetClassName() const { |
753 return kNotificationAreaClassName; | 754 return kNotificationAreaClassName; |
754 } | 755 } |
755 | 756 |
756 void AutofillDialogViews::NotificationArea::PaintChildren( | 757 void AutofillDialogViews::NotificationArea::PaintChildren( |
757 const ui::PaintContext& context) { | 758 const ui::PaintContext& context) { |
758 views::View::PaintChildren(context); | 759 views::View::PaintChildren(context); |
759 gfx::Canvas* canvas = context.canvas(); | |
760 if (HasArrow()) { | 760 if (HasArrow()) { |
| 761 ui::PaintRecorder recorder(context); |
761 DrawArrow( | 762 DrawArrow( |
762 canvas, | 763 recorder.canvas(), |
763 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f), | 764 GetMirroredXInView(width() - arrow_centering_anchor_->width() / 2.0f), |
764 notifications_[0].GetBackgroundColor(), | 765 notifications_[0].GetBackgroundColor(), |
765 notifications_[0].GetBorderColor()); | 766 notifications_[0].GetBorderColor()); |
766 } | 767 } |
767 } | 768 } |
768 | 769 |
769 void AutofillDialogViews::OnWidgetDestroying(views::Widget* widget) { | 770 void AutofillDialogViews::OnWidgetDestroying(views::Widget* widget) { |
770 if (widget == window_) | 771 if (widget == window_) |
771 window_->GetRootView()->RemovePostTargetHandler(event_handler_.get()); | 772 window_->GetRootView()->RemovePostTargetHandler(event_handler_.get()); |
772 } | 773 } |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2484 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
2484 : section(section), | 2485 : section(section), |
2485 container(NULL), | 2486 container(NULL), |
2486 manual_input(NULL), | 2487 manual_input(NULL), |
2487 suggested_info(NULL), | 2488 suggested_info(NULL), |
2488 suggested_button(NULL) {} | 2489 suggested_button(NULL) {} |
2489 | 2490 |
2490 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2491 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
2491 | 2492 |
2492 } // namespace autofill | 2493 } // namespace autofill |
OLD | NEW |