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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0, kPanelHorizMargin), | 103 gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0, kPanelHorizMargin), |
104 margins()); | 104 margins()); |
105 // Note: In CreateBubble, the call to SizeToContents() will cause | 105 // Note: In CreateBubble, the call to SizeToContents() will cause |
106 // the relayout that this call requires. | 106 // the relayout that this call requires. |
107 frame->SetTitleFontList(GetTitleFontList()); | 107 frame->SetTitleFontList(GetTitleFontList()); |
108 frame->SetFootnoteView(CreateFootnoteView()); | 108 frame->SetFootnoteView(CreateFootnoteView()); |
109 | 109 |
110 BubbleBorder::Arrow adjusted_arrow = arrow(); | 110 BubbleBorder::Arrow adjusted_arrow = arrow(); |
111 if (base::i18n::IsRTL()) | 111 if (base::i18n::IsRTL()) |
112 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); | 112 adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); |
113 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>( | 113 frame->SetBubbleBorder(std::unique_ptr<BubbleBorder>( |
114 new BubbleBorder(adjusted_arrow, shadow(), color()))); | 114 new BubbleBorder(adjusted_arrow, shadow(), color()))); |
115 return frame; | 115 return frame; |
116 } | 116 } |
117 | 117 |
118 void BubbleDialogDelegateView::GetAccessibleState(ui::AXViewState* state) { | 118 void BubbleDialogDelegateView::GetAccessibleState(ui::AXViewState* state) { |
119 state->role = ui::AX_ROLE_DIALOG; | 119 state->role = ui::AX_ROLE_DIALOG; |
120 } | 120 } |
121 | 121 |
122 const char* BubbleDialogDelegateView::GetClassName() const { | 122 const char* BubbleDialogDelegateView::GetClassName() const { |
123 return kViewClassName; | 123 return kViewClassName; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // http://crbug.com/474622 for details. | 310 // http://crbug.com/474622 for details. |
311 if (widget == GetWidget() && visible) { | 311 if (widget == GetWidget() && visible) { |
312 ui::AXViewState state; | 312 ui::AXViewState state; |
313 GetAccessibleState(&state); | 313 GetAccessibleState(&state); |
314 if (state.role == ui::AX_ROLE_ALERT_DIALOG) | 314 if (state.role == ui::AX_ROLE_ALERT_DIALOG) |
315 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 315 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 } // namespace views | 319 } // namespace views |
OLD | NEW |