| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/views/bubble/bubble_dialog_delegate.h" | 5 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/color_utils.h" | 10 #include "ui/gfx/color_utils.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 GetBubbleFrameView()->bubble_border()->set_alignment(alignment); | 182 GetBubbleFrameView()->bubble_border()->set_alignment(alignment); |
| 183 SizeToContents(); | 183 SizeToContents(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void BubbleDialogDelegateView::SetArrowPaintType( | 186 void BubbleDialogDelegateView::SetArrowPaintType( |
| 187 BubbleBorder::ArrowPaintType paint_type) { | 187 BubbleBorder::ArrowPaintType paint_type) { |
| 188 GetBubbleFrameView()->bubble_border()->set_paint_arrow(paint_type); | 188 GetBubbleFrameView()->bubble_border()->set_paint_arrow(paint_type); |
| 189 SizeToContents(); | 189 SizeToContents(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void BubbleDialogDelegateView::SetBorderInteriorThickness(int thickness) { |
| 193 GetBubbleFrameView()->bubble_border()->SetBorderInteriorThickness(thickness); |
| 194 SizeToContents(); |
| 195 } |
| 196 |
| 192 void BubbleDialogDelegateView::OnAnchorBoundsChanged() { | 197 void BubbleDialogDelegateView::OnAnchorBoundsChanged() { |
| 193 SizeToContents(); | 198 SizeToContents(); |
| 194 } | 199 } |
| 195 | 200 |
| 196 BubbleDialogDelegateView::BubbleDialogDelegateView() | 201 BubbleDialogDelegateView::BubbleDialogDelegateView() |
| 197 : BubbleDialogDelegateView(nullptr, BubbleBorder::TOP_LEFT) {} | 202 : BubbleDialogDelegateView(nullptr, BubbleBorder::TOP_LEFT) {} |
| 198 | 203 |
| 199 BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view, | 204 BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view, |
| 200 BubbleBorder::Arrow arrow) | 205 BubbleBorder::Arrow arrow) |
| 201 : close_on_deactivate_(true), | 206 : close_on_deactivate_(true), |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // http://crbug.com/474622 for details. | 313 // http://crbug.com/474622 for details. |
| 309 if (widget == GetWidget() && visible) { | 314 if (widget == GetWidget() && visible) { |
| 310 ui::AXViewState state; | 315 ui::AXViewState state; |
| 311 GetAccessibleState(&state); | 316 GetAccessibleState(&state); |
| 312 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 317 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
| 313 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 318 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 314 } | 319 } |
| 315 } | 320 } |
| 316 | 321 |
| 317 } // namespace views | 322 } // namespace views |
| OLD | NEW |